43 use json_module,
only : json_file
62 character(len=:),
allocatable :: temperature_field_name
64 character(len=:),
allocatable :: tke_field_name
66 type(
field_t),
pointer :: temperature_alphat => null()
67 type(
field_t),
pointer :: tke_alphat => null()
69 type(
field_t),
pointer :: tke_source => null()
74 procedure, pass(this) :: init_from_components => &
89 type(json_file),
intent(inout) :: json
90 character(len=:),
allocatable :: temperature_field_name
91 character(len=:),
allocatable :: TKE_field_name
92 character(len=:),
allocatable :: nut_name
93 character(len=:),
allocatable :: temperature_alphat_name, TKE_alphat_name
94 character(len=:),
allocatable :: TKE_source_name
95 character(len=:),
allocatable :: delta_type
96 real(kind=
rp) :: c_k, t0
97 real(kind=
rp),
allocatable :: g(:)
99 character(len=LOG_SIZE) :: log_buf
102 temperature_field_name,
"temperature")
106 temperature_alphat_name,
"temperature_alphat")
115 if (.not.
size(g) == 3)
then
116 call neko_error(
"The gravity vector should have 3 components")
121 call neko_error(
"Extrapolation is not implemented for the " // &
126 write(log_buf,
'(A)')
'Model : deardorff'
128 write(log_buf,
'(A, A)')
'Delta evaluation : ', delta_type
130 write(log_buf,
'(A, E15.7)')
'c_k : ', c_k
132 write(log_buf,
'(A, L1)')
'extrapolation : ', if_ext
137 temperature_field_name, tke_field_name, nut_name, &
138 temperature_alphat_name, tke_alphat_name, tke_source_name, g, &
141 deallocate(temperature_field_name)
142 deallocate(tke_field_name)
144 deallocate(temperature_alphat_name)
145 deallocate(tke_alphat_name)
146 deallocate(tke_source_name)
147 deallocate(delta_type)
167 c_k, T0, temperature_field_name, TKE_field_name, nut_name, &
168 temperature_alphat_name, TKE_alphat_name, TKE_source_name, g, &
172 real(kind=
rp),
intent(in) :: c_k, t0
173 character(len=*),
intent(in) :: temperature_field_name
174 character(len=*),
intent(in) :: TKE_field_name
175 character(len=*),
intent(in) :: nut_name
176 character(len=*),
intent(in) :: temperature_alphat_name, TKE_alphat_name
177 character(len=*),
intent(in) :: TKE_source_name
178 real(kind=
rp),
intent(in) :: g(3)
179 character(len=*),
intent(in) :: delta_type
180 logical,
intent(in) :: if_ext
183 call this%init_base(fluid, nut_name, delta_type, if_ext)
186 trim(temperature_alphat_name), .true.)
187 call neko_registry%add_field(fluid%dm_Xh, trim(tke_alphat_name), .true.)
188 call neko_registry%add_field(fluid%dm_Xh, trim(tke_source_name), .true.)
190 this%temperature_alphat => &
192 this%TKE_alphat =>
neko_registry%get_field(trim(tke_alphat_name))
193 this%TKE_source =>
neko_registry%get_field(trim(tke_source_name))
196 this%temperature_field_name = temperature_field_name
197 this%TKE_field_name = tke_field_name
206 nullify(this%temperature_alphat)
207 nullify(this%TKE_alphat)
208 nullify(this%TKE_source)
210 if (
allocated(this%temperature_field_name))
then
211 deallocate(this%temperature_field_name)
214 if (
allocated(this%TKE_field_name))
then
215 deallocate(this%TKE_field_name)
218 call this%free_base()
226 real(kind=
rp),
intent(in) :: t
227 integer,
intent(in) :: tstep
229 type(
field_t),
pointer :: u, v, w, u_e, v_e, w_e
234 this%temperature_field_name, this%TKE_field_name, &
235 this%nut, this%temperature_alphat, this%TKE_alphat, &
236 this%TKE_source, this%delta, this%c_k, this%T0, this%g)
239 this%temperature_field_name, this%TKE_field_name, &
240 this%nut, this%temperature_alphat, this%TKE_alphat, &
241 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.