42 use json_module,
only : json_file
88 type(
coef_t),
intent(in) :: coef
89 type(json_file),
intent(inout) :: json
90 character(len=:),
allocatable :: nut_name
92 character(len=:),
allocatable :: delta_type
93 character(len=:),
allocatable :: test_filter_type
94 character(len=LOG_SIZE) :: log_buf
101 call this%init_base(
dofmap, coef, nut_name, delta_type)
103 call this%test_filter%init(
dofmap%xh%lx, test_filter_type)
107 write(log_buf,
'(A)')
'Model : Dynamic Smagorinsky'
109 write(log_buf,
'(A, A)')
'Delta evaluation : ', delta_type
111 write(log_buf,
'(A, A)')
'Test filter type : ', test_filter_type
115 call this%c_dyn%init(
dofmap,
"ds_c_dyn")
116 call this%num%init(
dofmap,
"ds_num")
117 call this%den%init(
dofmap,
"ds_den")
120 call this%mij(i)%init(
dofmap)
121 call this%lij(i)%init(
dofmap)
131 call this%c_dyn%free()
133 call this%mij(i)%free()
134 call this%lij(i)%free()
138 call this%test_filter%free()
139 call this%free_base()
148 real(kind=
rp),
intent(in) :: t
149 integer,
intent(in) :: tstep
153 this%delta, this%c_dyn, this%test_filter, &
154 this%mij, this%lij, this%num, this%den)
157 this%delta, this%c_dyn, this%test_filter, &
158 this%mij, this%lij, this%num, this%den)
168 if (filter_1d%nx .le. 2)
then
169 call neko_error(
"Dynamic Smagorinsky model error: test filter is not &
170 &defined for the current polynomial order")
172 if (mod(filter_1d%nx,2) .eq. 0)
then
174 filter_1d%trnsfr(int((filter_1d%nx)/2)) = 0.95_rp
175 filter_1d%trnsfr(int((filter_1d%nx)/2) + 1) = 0.50_rp
176 filter_1d%trnsfr(int((filter_1d%nx)/2) + 2) = 0.05_rp
177 if ((int((filter_1d%nx)/2) + 2) .lt. filter_1d%nx)
then
178 do i = int((filter_1d%nx)/2) + 3, filter_1d%nx
179 filter_1d%trnsfr(i) = 0.0_rp
183 filter_1d%nt = int(filter_1d%nx/2) + 1
186 filter_1d%trnsfr(int((filter_1d%nx-1)/2)) = 0.95_rp
187 filter_1d%trnsfr(int((filter_1d%nx-1)/2) + 1) = 0.50_rp
188 filter_1d%trnsfr(int((filter_1d%nx-1)/2) + 2) = 0.05_rp
189 if ((int((filter_1d%nx-1)/2) + 2) .lt. filter_1d%nx)
then
190 do i = int((filter_1d%nx-1)/2) + 3, filter_1d%nx
191 filter_1d%trnsfr(i) = 0.0_rp
195 filter_1d%nt = int((filter_1d%nx-1)/2) + 1
198 call filter_1d%build_1d()
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.
Defines a mapping of the degrees of freedom.
Implements the CPU kernel for the smagorinsky_t type.
subroutine, public dynamic_smagorinsky_compute_cpu(t, tstep, coef, nut, delta, c_dyn, test_filter, mij, lij, num, den)
Compute eddy viscosity on the CPU.
Implements the device kernel for the smagorinsky_t type.
subroutine, public dynamic_smagorinsky_compute_device(t, tstep, coef, nut, delta, c_dyn, test_filter, mij, lij, num, den)
Compute eddy viscosity on the device.
Implements dynamic_smagorinsky_t.
subroutine set_ds_filt(filter_1d)
Set up the test filter.
subroutine dynamic_smagorinsky_init(this, dofmap, coef, json)
Constructor.
subroutine dynamic_smagorinsky_free(this)
Destructor for the les_model_t (base) class.
subroutine dynamic_smagorinsky_compute(this, t, tstep)
Compute eddy viscosity.
Implements explicit_filter_t.
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.
Coefficients defined on a given (mesh, ) tuple. Arrays use indices (i,j,k,e): element e,...
Implements the dynamic Smagorinsky LES model.
Implements the explicit filter for SEM.
field_list_t, To be able to group fields together
Base abstract type for LES models based on the Boussinesq approximation.