38 use json_module,
only : json_file
66 real(kind=
rp) :: kappa
84 procedure, pass(this) :: init_from_components => &
91 procedure, pass(this) :: extract_properties => &
105 character(len=*),
intent(in) :: scheme_name
106 type(
coef_t),
intent(in) :: coef
107 integer,
intent(in) :: msk(:)
108 integer,
intent(in) :: facet(:)
109 type(json_file),
intent(inout) :: json
110 real(kind=
rp) :: kappa, b, z0
118 call this%init_from_components(scheme_name, coef, msk, facet, sampler, &
127 type(
coef_t),
intent(in) :: coef
128 character(len=*),
intent(in) :: scheme_name
129 type(json_file),
intent(inout) :: json
130 character(len=LOG_SIZE) :: log_buf
132 call this%partial_init_base(coef, scheme_name, json)
138 write(log_buf,
'(A)')
'Model : Rough log law'
140 write(log_buf,
'(A, E15.7)')
'kappa : ', this%kappa
142 write(log_buf,
'(A, E15.7)')
'B : ', this%B
144 write(log_buf,
'(A, E15.7)')
'z0 : ', this%z0
155 integer,
intent(in) :: msk(:)
156 integer,
intent(in) :: facet(:)
157 character(len=*),
optional,
intent(in) :: bc_name
158 type(
user_t),
target,
optional,
intent(in) :: user
160 call this%finalize_base(msk, facet, bc_name,
user)
162 call this%rho_w%init(this%n_nodes)
163 call this%validate_single_sample()
164 call this%u_s%init(this%n_nodes)
165 call this%v_s%init(this%n_nodes)
166 call this%w_s%init(this%n_nodes)
178 this%rho%size(), this%rho_w%size())
181 this%rho%size(), this%rho_w%size())
195 facet, sampler, kappa, B, z0)
197 character(len=*),
intent(in) :: scheme_name
198 type(
coef_t),
intent(in) :: coef
199 integer,
intent(in) :: msk(:)
200 integer,
intent(in) :: facet(:)
202 real(kind=
rp),
intent(in) :: kappa, b, z0
205 call this%init_base(scheme_name, coef, msk, facet, sampler)
211 call this%rho_w%init(this%n_nodes)
212 call this%validate_single_sample()
213 call this%u_s%init(this%n_nodes)
214 call this%v_s%init(this%n_nodes)
215 call this%w_s%init(this%n_nodes)
224 if (any(this%sampler%h%x(1:this%n_nodes) .le. this%z0))
then
225 call neko_error(
"Roughlog WM: Sampling height h must be greater " // &
226 "than roughness z0. Increase the sampling height or decrease z0.")
227 else if (this%z0 .eq. 0.0_rp)
then
228 call neko_error(
"Roughlog WM: Roughness z0 must be greater than 0.")
236 call this%rho_w%free()
240 call this%free_base()
249 real(kind=
rp),
intent(in) :: t
250 integer,
intent(in) :: tstep
256 call this%extract_properties()
262 call this%sampler%sample(u, this%u_s)
263 call this%sampler%sample(v, this%v_s)
264 call this%sampler%sample(w, this%w_s)
269 this%n_x%x_d, this%n_y%x_d, this%n_z%x_d, &
270 this%sampler%h%x_d, this%tau_x%x_d, this%tau_y%x_d, &
271 this%tau_z%x_d, this%n_nodes, this%kappa, &
272 this%rho_w%x_d, this%B, this%z0, tstep)
275 this%n_x%x, this%n_y%x, this%n_z%x, &
276 this%sampler%h%x, this%tau_x%x, this%tau_y%x, this%tau_z%x, &
277 this%n_nodes, this%kappa, &
278 this%rho_w%x, this%B, this%z0, tstep)
__global__ void rough_log_law_compute(const T *__restrict__ u_d, const T *__restrict__ v_d, const T *__restrict__ w_d, const T *__restrict__ n_x_d, const T *__restrict__ n_y_d, const T *__restrict__ n_z_d, const T *__restrict__ h_d, T *__restrict__ tau_x_d, T *__restrict__ tau_y_d, T *__restrict__ tau_z_d, const int n_nodes, const T kappa, const T *__restrict__ rho_w_d, const T B, const T z0)
subroutine, public device_masked_gather_copy_0(a_d, b_d, mask_d, n, n_mask, strm)
Gather a masked vector .
Utilities for retrieving parameters from the case files.
type(log_t), public neko_log
Global log stream.
integer, parameter, public log_size
subroutine, public masked_gather_copy_0(a, b, mask, n, n_mask)
Gather a masked vector to reduced contigous vector .
integer, parameter neko_bcknd_device
integer, parameter, public rp
Global precision used in computations.
Defines a registry for storing solution fields.
type(registry_t), target, public neko_registry
Global field registry.
Implements the CPU kernel for the rough_log_law_t type.
subroutine, public rough_log_law_compute_cpu(u, v, w, n_x, n_y, n_z, h, tau_x, tau_y, tau_z, n_nodes, kappa, rho_w, b, z0, tstep)
Compute the wall shear stress on CPU using the rough log-law model.
Implements the device kernel for the rough_log_law_t type.
subroutine, public rough_log_law_compute_device(u_d, v_d, w_d, n_x_d, n_y_d, n_z_d, h_d, tau_x_d, tau_y_d, tau_z_d, n_nodes, kappa, rho_w_d, b, z0, tstep)
Compute the wall shear stress on device using the rough log-law model.
Implements rough_log_law_t.
subroutine rough_log_law_init_from_components(this, scheme_name, coef, msk, facet, sampler, kappa, b, z0)
Constructor from components.
subroutine rough_log_law_extract_properties(this)
Extract the values of rho at the boundary.
subroutine rough_log_law_partial_init(this, coef, scheme_name, json)
Constructor from JSON.
subroutine rough_log_law_init(this, scheme_name, coef, msk, facet, json)
Constructor from JSON.
subroutine rough_log_law_validate_sampling_height(this)
subroutine rough_log_law_finalize(this, msk, facet, bc_name, user)
Finalize the construction using the mask and facet arrays of the bc.
subroutine rough_log_law_free(this)
Destructor for the rough_log_law_t (base) class.
Defines a registry for storing and requesting temporary objects This can be used when you have a func...
type(scratch_registry_t), target, public neko_scratch_registry
Global scratch registry.
Interfaces for user interaction with NEKO.
Factory for wall-model samplers.
subroutine, public wall_sampler_factory(object, json)
Wall sampler factory.
Defines the abstract interface for wall-model field samplers.
Coefficients defined on a given (mesh, ) tuple. Arrays use indices (i,j,k,e): element e,...
Wall model based on the log-law for a rough wall. The formula defining the law is ....
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.
Base type for sampling solution fields at points associated with wall nodes. Samples belonging to one...