42 use json_module,
only : json_file
57 real(kind=
rp) :: ri_c, ref_temp
60 character(len=:),
allocatable :: scalar_name
65 procedure, pass(this) :: init_from_components => &
78 class(
vreman_t),
intent(inout) :: this
80 type(json_file),
intent(inout) :: json
81 character(len=:),
allocatable :: nut_name
83 real(kind=
rp) :: c, ri_c, ref_temp
84 real(kind=
rp),
allocatable :: g(:)
85 character(len=:),
allocatable :: scalar_name
86 character(len=:),
allocatable :: delta_type
87 logical :: if_ext, if_corr
88 character(len=LOG_SIZE) :: log_buf
98 call json_get(json,
"scalar_field", scalar_name)
102 if (.not.
size(g) == 3)
then
103 call neko_error(
"The gravity vector should have 3 components")
106 if (ri_c .le. 0.0_rp)
then
107 call neko_error(
"The critical Richardson number should be positive.")
110 if (ref_temp .le. 0.0_rp)
then
111 call neko_error(
"The reference temperature should be positive.")
115 g = [0.0_rp, 0.0_rp, 0.0_rp]
122 write(log_buf,
'(A)')
'Model : Vreman'
124 write(log_buf,
'(A, A)')
'Delta evaluation : ', delta_type
126 write(log_buf,
'(A, E15.7)')
'c : ', c
128 write(log_buf,
'(A, L1)')
'extrapolation : ', if_ext
130 write(log_buf,
'(A, L1)')
'buoyancy correction : ', if_corr
135 delta_type, if_ext, if_corr, scalar_name, ri_c, ref_temp, g)
151 delta_type, if_ext, if_corr, scalar_name, ri_c, ref_temp, g)
152 class(
vreman_t),
intent(inout) :: this
154 real(kind=
rp) :: c, ri_c, ref_temp
155 real(kind=
rp) :: g(3)
156 character(len=*),
intent(in) :: scalar_name
157 character(len=*),
intent(in) :: nut_name
158 character(len=*),
intent(in) :: delta_type
159 logical,
intent(in) :: if_ext, if_corr
163 call this%init_base(fluid, nut_name, delta_type, if_ext)
165 this%if_corr = if_corr
167 this%ref_temp = ref_temp
169 this%scalar_name = scalar_name
175 class(
vreman_t),
intent(inout) :: this
177 call this%free_base()
184 class(
vreman_t),
intent(inout) :: this
185 real(kind=
rp),
intent(in) :: t
186 integer,
intent(in) :: tstep
188 type(
field_t),
pointer :: u, v, w, u_e, v_e, w_e
190 if (this%if_ext)
then
192 associate(ulag => this%ulag, vlag => this%vlag, &
193 wlag => this%wlag, ext_bdf => this%ext_bdf)
202 call this%sumab%compute_fluid(u_e, v_e, w_e, u, v, w, &
203 ulag, vlag, wlag, ext_bdf%advection_coeffs, ext_bdf%nadv)
211 this%nut, this%delta, this%c, this%if_corr, &
212 this%scalar_name, this%ri_c, this%ref_temp, this%g)
215 this%nut, this%delta, this%c, this%if_corr, &
216 this%scalar_name, this%ri_c, this%ref_temp, this%g)
Retrieves a parameter by name or assigns a provided default value. In the latter case also adds the m...
Retrieves a parameter by name or throws an error.
Utilities for retrieving parameters from the case files.
type(log_t), public neko_log
Global log stream.
integer, parameter, public log_size
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 vreman_t type.
subroutine, public vreman_compute_cpu(if_ext, t, tstep, coef, nut, delta, c, if_corr, scalar_name, ri_c, ref_temp, g)
Compute eddy viscosity on the CPU.
Implements the device kernel for the vreman_t type.
subroutine, public vreman_compute_device(if_ext, t, tstep, coef, nut, delta, c, if_corr, scalar_name, ri_c, ref_temp, g)
Compute eddy viscosity on the device.
subroutine vreman_free(this)
Destructor for the les_model_t (base) class.
subroutine vreman_init_from_components(this, fluid, c, nut_name, delta_type, if_ext, if_corr, scalar_name, ri_c, ref_temp, g)
Constructor from components.
subroutine vreman_compute(this, t, tstep)
Compute eddy viscosity.
subroutine vreman_init(this, fluid, json)
Constructor.
Base type of all fluid formulations.
Base abstract type for LES models based on the Boussinesq approximation.
Implements the Vreman LES model.