37 use,
intrinsic :: iso_c_binding, only : c_ptr
43 use json_module,
only : json_file
63 procedure, pass(this) :: apply_scalar_dev => &
65 procedure, pass(this) :: apply_vector_dev => &
74 integer,
intent(in) :: n
75 real(kind=
rp),
intent(inout),
dimension(n) :: x
77 logical,
intent(in),
optional :: strong
79 call neko_error(
"The wall model bc is not applicable to scalar fields.")
92 integer,
intent(in) :: n
93 real(kind=
rp),
intent(inout),
dimension(n) :: x
94 real(kind=
rp),
intent(inout),
dimension(n) :: y
95 real(kind=
rp),
intent(inout),
dimension(n) :: z
97 logical,
intent(in),
optional :: strong
98 integer :: i, m, k, fid
99 real(kind=
rp) :: magtau
102 if (
present(strong))
then
108 if (.not.
present(time))
then
109 call neko_error(
"wall_model_bc_apply_vector: time is required.")
112 if (.not. strong_)
then
115 call this%wall_model%compute(time%t, time%tstep)
118 call this%wall_model%compute_mag_field()
122 call this%set_stress(this%wall_model%tau_x, this%wall_model%tau_y, &
123 this%wall_model%tau_z)
128 call this%shear_stress_t%apply_vector(x, y, z, n, time, strong_)
136 type(c_ptr),
intent(inout) :: x_d
138 logical,
intent(in),
optional :: strong
139 type(c_ptr),
intent(inout) :: strm
141 call neko_error(
"The wall model bc is not applicable to scalar fields.")
150 type(c_ptr),
intent(inout) :: x_d
151 type(c_ptr),
intent(inout) :: y_d
152 type(c_ptr),
intent(inout) :: z_d
154 logical,
intent(in),
optional :: strong
156 type(c_ptr),
intent(inout) :: strm
158 if (
present(strong))
then
164 if (.not.
present(time))
then
165 call neko_error(
"wall_model_bc_apply_vector_dev: time is required.")
168 if (.not. strong_)
then
171 call this%wall_model%compute(time%t, 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)
184 call this%shear_stress_t%apply_vector_dev(x_d, y_d, z_d, &
194 type(
coef_t),
target,
intent(in) :: coef
195 type(json_file),
intent(inout) :: json
196 real(kind=
rp) :: value(3) = [0, 0, 0]
197 character(len=:),
allocatable :: type_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)
205 call this%wall_model%partial_init(coef, json)
212 call this%shear_stress_t%free()
213 call this%wall_model%free()
215 if (
allocated(this%wall_model))
then
216 deallocate(this%wall_model)
224 logical,
optional,
intent(in) :: only_facets
226 if (
present(only_facets))
then
227 if (.not. only_facets)
then
228 call neko_error(
"For wall_model_bc_t, only_facets has to be true.")
232 call this%shear_stress_t%finalize(.true.)
233 call this%wall_model%finalize(this%msk, this%facet)
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.
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, only_facets)
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.
Base abstract type for wall-stress models for wall-modelled LES.
A shear stress boundary condition, computing the stress values using a wall model.