38 use json_module,
only : json_file
55 type(
coef_t),
pointer :: coef => null()
78 real(kind=
rp),
intent(in) :: t
79 integer,
intent(in) :: tstep
91 type(
coef_t),
intent(in) :: coef
93 type(json_file),
intent(inout) :: json
112 type(
dofmap_t),
intent(in) :: dofmap
113 type(
coef_t),
target,
intent(in) :: coef
114 character(len=*),
intent(in) :: nut_name
126 call this%compute_delta()
145 integer :: e, i, j, k
146 integer :: im, ip, jm, jp, km, kp
147 real(kind=
rp) :: di, dj, dk, ndim_inv
150 do e=1, this%coef%msh%nelv
151 do k=1, this%coef%Xh%lz
153 kp = min(this%coef%Xh%lz, k+1)
155 do j=1, this%coef%Xh%ly
157 jp = min(this%coef%Xh%ly, j+1)
159 do i=1, this%coef%Xh%lx
161 ip = min(this%coef%Xh%lx, i+1)
163 di = (this%coef%dof%x(ip,j,k,e) - this%coef%dof%x(im,j,k,e))**2 &
164 + (this%coef%dof%y(ip,j,k,e) - this%coef%dof%y(im,j,k,e))**2 &
165 + (this%coef%dof%z(ip,j,k,e) - this%coef%dof%z(im,j,k,e))**2
167 dj = (this%coef%dof%x(i,jp,k,e) - this%coef%dof%x(i,jm,k,e))**2 &
168 + (this%coef%dof%y(i,jp,k,e) - this%coef%dof%y(i,jm,k,e))**2 &
169 + (this%coef%dof%z(i,jp,k,e) - this%coef%dof%z(i,jm,k,e))**2
171 dk = (this%coef%dof%x(i,j,kp,e) - this%coef%dof%x(i,j,km,e))**2 &
172 + (this%coef%dof%y(i,j,kp,e) - this%coef%dof%y(i,j,km,e))**2 &
173 + (this%coef%dof%z(i,j,kp,e) - this%coef%dof%z(i,j,km,e))**2
175 di = sqrt(di) / (ip - im)
176 dj = sqrt(dj) / (jp - jm)
177 dk = sqrt(dk) / (kp - km)
178 this%delta%x(i,j,k,e) = (di * dj * dk)**(1.0_rp / 3.0_rp)
185 call this%coef%gs_h%op(this%delta,
gs_op_add)
188 call device_memcpy(this%delta%x, this%delta%x_d, this%delta%dof%size(),&
Copy data between host and device (or device and device)
Device abstraction, common interface for various accelerators.
integer, parameter, public host_to_device
Defines a mapping of the degrees of freedom.
Defines a registry for storing solution fields.
type(field_registry_t), target, public neko_field_registry
Global field registry.
Defines Gather-scatter operations.
integer, parameter, public gs_op_add
subroutine les_model_init_base(this, dofmap, coef, nut_name)
Constructor for the les_model_t (base) class.
subroutine les_model_compute_delta(this)
Compute the LES lengthscale. For each GLL point, we take the distance between its neighbours in all 3...
subroutine les_model_free_base(this)
Destructor for the les_model_t (base) class.
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,...
field_ptr_t, To easily obtain a pointer to a field
Base abstract type for LES models based on the Boussinesq approximation.