37 use,
intrinsic :: iso_c_binding, only : c_ptr
43 use json_module,
only : json_file
66 procedure, pass(this) :: apply_scalar_dev => &
68 procedure, pass(this) :: apply_vector_dev => &
77 integer,
intent(in) :: n
78 real(kind=
rp),
intent(inout),
dimension(n) :: x
80 logical,
intent(in),
optional :: strong
82 call neko_error(
"The wall model bc is not applicable to scalar fields.")
95 integer,
intent(in) :: n
96 real(kind=
rp),
intent(inout),
dimension(n) :: x
97 real(kind=
rp),
intent(inout),
dimension(n) :: y
98 real(kind=
rp),
intent(inout),
dimension(n) :: z
100 logical,
intent(in),
optional :: strong
101 integer :: i, m, k, fid
102 real(kind=
rp) :: magtau
105 if (
present(strong))
then
111 if (.not.
present(time))
then
112 call neko_error(
"wall_model_bc_apply_vector: time is required.")
115 if (.not. strong_)
then
117 call this%wall_model%compute(
real(time%t, kind=
rp), time%tstep)
120 call this%wall_model%compute_mag_field()
124 call this%set_stress(this%wall_model%tau_x, this%wall_model%tau_y, &
125 this%wall_model%tau_z)
129 call this%shear_stress_t%apply_vector(x, y, z, n, time, strong_)
137 type(c_ptr),
intent(inout) :: x_d
139 logical,
intent(in),
optional :: strong
140 type(c_ptr),
intent(inout) :: strm
142 call neko_error(
"The wall model bc is not applicable to scalar fields.")
151 type(c_ptr),
intent(inout) :: x_d
152 type(c_ptr),
intent(inout) :: y_d
153 type(c_ptr),
intent(inout) :: z_d
155 logical,
intent(in),
optional :: strong
157 type(c_ptr),
intent(inout) :: strm
159 if (
present(strong))
then
165 if (.not.
present(time))
then
166 call neko_error(
"wall_model_bc_apply_vector_dev: time is required.")
169 if (.not. strong_)
then
171 call this%wall_model%compute(
real(time%t, kind=
rp), time%tstep)
174 call this%wall_model%compute_mag_field()
178 call this%set_stress(this%wall_model%tau_x, this%wall_model%tau_y, &
179 this%wall_model%tau_z)
183 call this%shear_stress_t%apply_vector_dev(x_d, y_d, z_d, &
193 type(
coef_t),
target,
intent(in) :: coef
194 type(json_file),
intent(inout) :: json
195 character(len=:),
allocatable :: scheme_name, type_name
196 real(kind=
rp) :: value(3) = [0, 0, 0]
198 call json_get(json,
"scheme_name", scheme_name)
200 call this%shear_stress_t%init_from_components(coef,
value)
202 call json_get(json,
"model", type_name)
203 call wall_model_allocator(this%wall_model, type_name)
204 call this%wall_model%partial_init(coef, scheme_name, json)
211 call this%shear_stress_t%free()
212 call this%wall_model%free()
214 if (
allocated(this%wall_model))
then
215 deallocate(this%wall_model)
225 call this%shear_stress_t%finalize()
226 call this%wall_model%finalize(this%facet_node_msk, this%facet)
228 if (
associated(this%user))
then
229 call this%wall_model%finalize(this%facet_node_msk, this%facet, &
230 this%name, this%user)
232 call this%wall_model%finalize(this%facet_node_msk, this%facet, this%name)
Retrieves a parameter by name or throws an error.
Utilities for retrieving parameters from the case files.
integer, parameter, public rp
Global precision used in computations.
Defines a shear stress boundary condition for a vector field. Maintainer: Timofey Mukha.
Module with things related to the simulation time.
Interfaces for user interaction with NEKO.
Defines the wall_model_bc_t type. Maintainer: Timofey Mukha.
subroutine wall_model_bc_init(this, coef, json)
Constructor.
subroutine wall_model_bc_apply_scalar(this, x, n, time, strong)
Apply shear stress for a scalar field x.
subroutine wall_model_bc_apply_scalar_dev(this, x_d, time, strong, strm)
Boundary condition apply for a generic wall_model_bc condition to a vector x (device version)
subroutine wall_model_bc_apply_vector_dev(this, x_d, y_d, z_d, time, strong, strm)
Boundary condition apply for a generic wall_model_bc condition to vectors x, y and z (device version)
subroutine wall_model_bc_apply_vector(this, x, y, z, n, time, strong)
Apply the boundary condition to the right-hand side.
subroutine wall_model_bc_free(this)
Destructor.
subroutine wall_model_bc_finalize(this)
Finalize by building mask arrays and init'ing the wall model.
Coefficients defined on a given (mesh, ) tuple. Arrays use indices (i,j,k,e): element e,...
A shear stress boundary condition.
A struct that contains all info about the time, expand as needed.
A type collecting all the overridable user routines and flag to suppress type injection from custom m...
Base abstract type for wall-stress models for wall-modelled LES.
A shear stress boundary condition, computing the stress values using a wall model.