42 use json_module,
only : json_file
61 character(len=:),
allocatable :: temperature_field_name
63 character(len=:),
allocatable :: tke_field_name
65 type(
field_t),
pointer :: temperature_alphat => null()
66 type(
field_t),
pointer :: tke_alphat => null()
68 type(
field_t),
pointer :: tke_source => null()
73 procedure, pass(this) :: init_from_components => &
88 type(json_file),
intent(inout) :: json
89 character(len=:),
allocatable :: temperature_field_name
90 character(len=:),
allocatable :: TKE_field_name
91 character(len=:),
allocatable :: nut_name
92 character(len=:),
allocatable :: temperature_alphat_name, TKE_alphat_name
93 character(len=:),
allocatable :: TKE_source_name
94 character(len=:),
allocatable :: delta_type
95 real(kind=
rp) :: c_k, t0
96 real(kind=
rp),
allocatable :: g(:)
98 character(len=LOG_SIZE) :: log_buf
101 temperature_field_name,
"temperature")
105 temperature_alphat_name,
"temperature_alphat")
114 if (.not.
size(g) == 3)
then
115 call neko_error(
"The gravity vector should have 3 components")
120 call neko_error(
"Extrapolation is not implemented for the " // &
125 write(log_buf,
'(A)')
'Model : deardorff'
127 write(log_buf,
'(A, A)')
'Delta evaluation : ', delta_type
129 write(log_buf,
'(A, E15.7)')
'c_k : ', c_k
131 write(log_buf,
'(A, L1)')
'extrapolation : ', if_ext
136 temperature_field_name, tke_field_name, nut_name, &
137 temperature_alphat_name, tke_alphat_name, tke_source_name, g, &
140 deallocate(temperature_field_name)
141 deallocate(tke_field_name)
143 deallocate(temperature_alphat_name)
144 deallocate(tke_alphat_name)
145 deallocate(tke_source_name)
146 deallocate(delta_type)
166 c_k, T0, temperature_field_name, TKE_field_name, nut_name, &
167 temperature_alphat_name, TKE_alphat_name, TKE_source_name, g, &
171 real(kind=
rp),
intent(in) :: c_k, t0
172 character(len=*),
intent(in) :: temperature_field_name
173 character(len=*),
intent(in) :: TKE_field_name
174 character(len=*),
intent(in) :: nut_name
175 character(len=*),
intent(in) :: temperature_alphat_name, TKE_alphat_name
176 character(len=*),
intent(in) :: TKE_source_name
177 real(kind=
rp),
intent(in) :: g(3)
178 character(len=*),
intent(in) :: delta_type
179 logical,
intent(in) :: if_ext
182 call this%init_base(fluid, nut_name, delta_type, if_ext)
185 trim(temperature_alphat_name), .true.)
186 call neko_registry%add_field(fluid%dm_Xh, trim(tke_alphat_name), .true.)
187 call neko_registry%add_field(fluid%dm_Xh, trim(tke_source_name), .true.)
189 this%temperature_alphat => &
191 this%TKE_alphat =>
neko_registry%get_field(trim(tke_alphat_name))
192 this%TKE_source =>
neko_registry%get_field(trim(tke_source_name))
195 this%temperature_field_name = temperature_field_name
196 this%TKE_field_name = tke_field_name
205 nullify(this%temperature_alphat)
206 nullify(this%TKE_alphat)
207 nullify(this%TKE_source)
209 if (
allocated(this%temperature_field_name))
then
210 deallocate(this%temperature_field_name)
213 if (
allocated(this%TKE_field_name))
then
214 deallocate(this%TKE_field_name)
217 call this%free_base()
225 real(kind=
rp),
intent(in) :: t
226 integer,
intent(in) :: tstep
228 type(
field_t),
pointer :: u, v, w, u_e, v_e, w_e
233 this%temperature_field_name, this%TKE_field_name, &
234 this%nut, this%temperature_alphat, this%TKE_alphat, &
235 this%TKE_source, this%delta, this%c_k, this%T0, this%g)
238 this%temperature_field_name, this%TKE_field_name, &
239 this%nut, this%temperature_alphat, this%TKE_alphat, &
240 this%TKE_source, this%delta, this%c_k, this%T0, 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.
Implements the CPU kernel for the deardorff_t type.
subroutine, public deardorff_compute_cpu(t, tstep, coef, temperature_field_name, tke_field_name, nut, temperature_alphat, tke_alphat, tke_source, delta, c_k, t0, g)
Compute eddy viscosity on the CPU.
Implements the device kernel for the deardorff_t type.
subroutine, public deardorff_compute_device(t, tstep, coef, temperature_field_name, tke_field_name, nut, temperature_alphat, tke_alphat, tke_source, delta, c_k, t0, g)
Compute eddy viscosity on the device.
subroutine deardorff_init(this, fluid, json)
Constructor.
subroutine deardorff_free(this)
Destructor for the deardorff_t class.
subroutine deardorff_compute(this, t, tstep)
Compute eddy viscosity.
subroutine deardorff_init_from_components(this, fluid, c_k, t0, temperature_field_name, tke_field_name, nut_name, temperature_alphat_name, tke_alphat_name, tke_source_name, g, delta_type, if_ext)
Constructor from components.
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 deardorff LES model.
Base type of all fluid formulations.
Base abstract type for LES models based on the Boussinesq approximation.