38 use json_module,
only : json_file
60 real(kind=
rp) :: kappa = 0.41_rp
62 real(kind=
rp) :: b = 5.2_rp
74 procedure, pass(this) :: init_from_components => &
92 subroutine spalding_init(this, scheme_name, coef, msk, facet, h_index, json)
94 character(len=*),
intent(in) :: scheme_name
95 type(
coef_t),
intent(in) :: coef
96 integer,
intent(in) :: msk(:)
97 integer,
intent(in) :: facet(:)
98 integer,
intent(in) :: h_index
99 type(json_file),
intent(inout) :: json
100 real(kind=
rp) :: kappa, b
105 call this%init_from_components(scheme_name, coef, msk, facet, h_index, &
114 type(
coef_t),
intent(in) :: coef
115 type(json_file),
intent(inout) :: json
116 character(len=LOG_SIZE) :: log_buf
118 call this%partial_init_base(coef, json)
123 write(log_buf,
'(A)')
'Model : Spalding'
125 write(log_buf,
'(A, E15.7)')
'kappa : ', this%kappa
127 write(log_buf,
'(A, E15.7)')
'B : ', this%B
138 integer,
intent(in) :: msk(:)
139 integer,
intent(in) :: facet(:)
141 call this%finalize_base(msk, facet)
142 call this%nu%init(this%n_nodes)
154 facet, h_index, kappa, B)
156 character(len=*),
intent(in) :: scheme_name
157 type(
coef_t),
intent(in) :: coef
158 integer,
intent(in) :: msk(:)
159 integer,
intent(in) :: facet(:)
160 integer,
intent(in) :: h_index
161 real(kind=
rp),
intent(in) :: kappa
162 real(kind=
rp),
intent(in) :: b
165 call this%init_base(scheme_name, coef, msk, facet, h_index)
170 call this%nu%init(this%n_nodes)
184 temp%size(), this%nu%size())
197 call this%free_base()
206 real(kind=
rp),
intent(in) :: t
207 integer,
intent(in) :: tstep
212 real(kind=
rp) :: ui, vi, wi, magu, utau, normu, guess
214 call this%compute_nu()
222 this%ind_s_d, this%ind_t_d, this%ind_e_d, &
223 this%n_x%x_d, this%n_y%x_d, this%n_z%x_d, &
224 this%nu%x_d, this%h%x_d, &
225 this%tau_x%x_d, this%tau_y%x_d, this%tau_z%x_d, &
226 this%n_nodes, u%Xh%lx, &
227 this%kappa, this%B, tstep)
230 this%ind_r, this%ind_s, this%ind_t, this%ind_e, &
231 this%n_x%x, this%n_y%x, this%n_z%x, &
232 this%nu%x, this%h%x, &
233 this%tau_x%x, this%tau_y%x, this%tau_z%x, &
234 this%n_nodes, u%Xh%lx, u%msh%nelv, &
235 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 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__ nu_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 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, ind_r, ind_s, ind_t, ind_e, n_x, n_y, n_z, nu, h, tau_x, tau_y, tau_z, n_nodes, lx, nelv, 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, ind_r_d, ind_s_d, ind_t_d, ind_e_d, n_x_d, n_y_d, n_z_d, nu_d, h_d, tau_x_d, tau_y_d, tau_z_d, n_nodes, lx, 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, h_index, kappa, b)
Constructor from components.
subroutine spalding_partial_init(this, coef, json)
Constructor from JSON.
subroutine spalding_compute_nu(this)
Compute the kinematic viscosity vector.
subroutine spalding_free(this)
Destructor for the spalding_t (base) class.
subroutine spalding_finalize(this, msk, facet)
Finalize the construction using the mask and facet arrays of the bc.
subroutine spalding_init(this, scheme_name, coef, msk, facet, h_index, json)
Constructor from JSON.
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....
Base abstract type for wall-stress models for wall-modelled LES.