38 use json_module,
only : json_file
63 real(kind=
rp) :: kappa
79 procedure, pass(this) :: init_from_components => &
100 character(len=*),
intent(in) :: scheme_name
101 type(
coef_t),
intent(in) :: coef
102 integer,
intent(in) :: msk(:)
103 integer,
intent(in) :: facet(:)
104 integer,
intent(in) :: h_index
105 type(json_file),
intent(inout) :: json
106 real(kind=
rp) :: kappa, b, z0
112 call this%init_from_components(scheme_name, coef, msk, facet, h_index, &
121 type(
coef_t),
intent(in) :: coef
122 type(json_file),
intent(inout) :: json
123 character(len=LOG_SIZE) :: log_buf
125 call this%partial_init_base(coef, json)
131 write(log_buf,
'(A)')
'Model : Rough log law'
133 write(log_buf,
'(A, E15.7)')
'kappa : ', this%kappa
135 write(log_buf,
'(A, E15.7)')
'B : ', this%B
137 write(log_buf,
'(A, E15.7)')
'z0 : ', this%z0
148 integer,
intent(in) :: msk(:)
149 integer,
intent(in) :: facet(:)
151 call this%finalize_base(msk, facet)
153 call this%rho_w%init(this%n_nodes)
163 this%rho%size(), this%rho_w%size())
166 this%rho%size(), this%rho_w%size())
180 facet, h_index, kappa, B, z0)
182 character(len=*),
intent(in) :: scheme_name
183 type(
coef_t),
intent(in) :: coef
184 integer,
intent(in) :: msk(:)
185 integer,
intent(in) :: facet(:)
186 integer,
intent(in) :: h_index
187 real(kind=
rp),
intent(in) :: kappa, b, z0
190 call this%init_base(scheme_name, coef, msk, facet, h_index)
196 call this%rho_w%init(this%n_nodes)
199 if (any(this%h%x(1:this%n_nodes) .le. this%z0))
then
200 call neko_error(
"Roughlog WM: Sampling height h must be greater than roughness z0. " // &
201 "Increase h_index or decrease z0.")
202 else if (this%z0 .eq. 0.0_rp)
then
203 call neko_error(
"Roughlog WM: Roughness z0 must be greater than 0.")
212 call this%rho_w%free()
213 call this%free_base()
222 real(kind=
rp),
intent(in) :: t
223 integer,
intent(in) :: tstep
229 call this%extract_properties()
237 this%ind_s_d, this%ind_t_d, this%ind_e_d, &
238 this%n_x%x_d, this%n_y%x_d, this%n_z%x_d, &
239 this%h%x_d, this%tau_x%x_d, this%tau_y%x_d, &
240 this%tau_z%x_d, this%n_nodes, u%Xh%lx, this%kappa, &
241 this%rho_w%x_d, this%B, this%z0, tstep)
244 this%ind_t, this%ind_e, this%n_x%x, this%n_y%x, this%n_z%x, &
245 this%h%x, this%tau_x%x, this%tau_y%x, this%tau_z%x, &
246 this%n_nodes, u%Xh%lx, u%msh%nelv, this%kappa, &
247 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 int *__restrict__ ind_r_d, const int *__restrict__ ind_s_d, const int *__restrict__ ind_t_d, const int *__restrict__ ind_e_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 int lx, 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, ind_r, ind_s, ind_t, ind_e, n_x, n_y, n_z, h, tau_x, tau_y, tau_z, n_nodes, lx, nelv, 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, ind_r_d, ind_s_d, ind_t_d, ind_e_d, n_x_d, n_y_d, n_z_d, h_d, tau_x_d, tau_y_d, tau_z_d, n_nodes, lx, 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, h_index, kappa, b, z0)
Constructor from components.
subroutine rough_log_law_finalize(this, msk, facet)
Finalize the construction using the mask and facet arrays of the bc.
subroutine rough_log_law_extract_properties(this)
Extract the values of rho at the boundary.
subroutine rough_log_law_init(this, scheme_name, coef, msk, facet, h_index, json)
Constructor from JSON.
subroutine rough_log_law_partial_init(this, coef, json)
Constructor from JSON.
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.
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 ....
Base abstract type for wall-stress models for wall-modelled LES.