38 use json_module,
only : json_file
63 real(kind=
rp) :: kappa = 0.41_rp
65 real(kind=
rp) :: b = 5.2_rp
81 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 type(json_file),
intent(inout) :: json
105 real(kind=
rp) :: kappa, b
112 call this%init_from_components(scheme_name, coef, msk, facet, sampler, &
121 type(
coef_t),
intent(in) :: coef
122 character(len=*),
intent(in) :: scheme_name
123 type(json_file),
intent(inout) :: json
124 character(len=LOG_SIZE) :: log_buf
126 call this%partial_init_base(coef, scheme_name, json)
131 write(log_buf,
'(A)')
'Model : Spalding'
133 write(log_buf,
'(A, E15.7)')
'kappa : ', this%kappa
135 write(log_buf,
'(A, E15.7)')
'B : ', this%B
146 integer,
intent(in) :: msk(:)
147 integer,
intent(in) :: facet(:)
148 character(len=*),
optional,
intent(in) :: bc_name
149 type(
user_t),
target,
optional,
intent(in) :: user
151 call this%finalize_base(msk, facet, bc_name,
user)
152 call this%nu%init(this%n_nodes)
153 call this%rho_w%init(this%n_nodes)
154 call this%validate_single_sample()
155 call this%u_s%init(this%n_nodes)
156 call this%v_s%init(this%n_nodes)
157 call this%w_s%init(this%n_nodes)
169 facet, sampler, kappa, B)
171 character(len=*),
intent(in) :: scheme_name
172 type(
coef_t),
intent(in) :: coef
173 integer,
intent(in) :: msk(:)
174 integer,
intent(in) :: facet(:)
176 real(kind=
rp),
intent(in) :: kappa
177 real(kind=
rp),
intent(in) :: b
180 call this%init_base(scheme_name, coef, msk, facet, sampler)
185 call this%nu%init(this%n_nodes)
186 call this%rho_w%init(this%n_nodes)
187 call this%validate_single_sample()
188 call this%u_s%init(this%n_nodes)
189 call this%v_s%init(this%n_nodes)
190 call this%w_s%init(this%n_nodes)
204 temp%size(), this%nu%size())
207 this%rho%size(), this%rho_w%size())
212 this%rho%size(), this%rho_w%size())
223 call this%rho_w%free()
227 call this%free_base()
236 real(kind=
rp),
intent(in) :: t
237 integer,
intent(in) :: tstep
242 call this%compute_nu()
248 call this%sampler%sample(u, this%u_s)
249 call this%sampler%sample(v, this%v_s)
250 call this%sampler%sample(w, this%w_s)
255 this%n_x%x_d, this%n_y%x_d, this%n_z%x_d, &
256 this%nu%x_d, this%rho_w%x_d, this%sampler%h%x_d, &
257 this%tau_x%x_d, this%tau_y%x_d, this%tau_z%x_d, &
259 this%kappa, this%B, tstep)
262 this%n_x%x, this%n_y%x, this%n_z%x, &
263 this%nu%x, this%rho_w%x, this%sampler%h%x, &
264 this%tau_x%x, this%tau_y%x, this%tau_z%x, &
266 this%kappa, this%B, tstep)
__global__ void spalding_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__ nu_d, const T *__restrict__ rho_w_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 B, const int tstep)
Retrieves a parameter by name or assigns a provided default value. In the latter case also adds the m...
subroutine, public device_masked_gather_copy_0(a_d, b_d, mask_d, n, n_mask, strm)
Gather a masked vector .
subroutine, public field_invcol3(a, b, c, n)
Invert a 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.
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.
Implements the CPU kernel for the spalding_t type.
subroutine, public spalding_compute_cpu(u, v, w, n_x, n_y, n_z, nu, rho_w, h, tau_x, tau_y, tau_z, n_nodes, kappa, b, tstep)
Compute the wall shear stress on cpu using Spalding's model.
Implements the device kernel for the spalding_t type.
subroutine, public spalding_compute_device(u_d, v_d, w_d, n_x_d, n_y_d, n_z_d, nu_d, rho_w_d, h_d, tau_x_d, tau_y_d, tau_z_d, n_nodes, kappa, b, tstep)
Compute the wall shear stress on device using Spalding's model.
subroutine spalding_init_from_components(this, scheme_name, coef, msk, facet, sampler, kappa, b)
Constructor from components.
subroutine spalding_partial_init(this, coef, scheme_name, json)
Constructor from JSON.
subroutine spalding_init(this, scheme_name, coef, msk, facet, json)
Constructor from JSON.
subroutine spalding_compute_nu(this)
Compute the kinematic viscosity vector.
subroutine spalding_finalize(this, msk, facet, bc_name, user)
Finalize the construction using the mask and facet arrays of the bc.
subroutine spalding_free(this)
Destructor for the spalding_t (base) class.
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 Spalding's law of the wall. Reference: http://dx.doi.org/10.1115/1....
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...