51 type(
field_t),
pointer :: alphat => null()
53 logical :: nut_dependency = .false.
54 real(kind=
rp) :: pr_turb
69 type(
coef_t),
pointer :: coef => null()
71 integer :: n_stats = 4
76 generic :: init => init_alphat, init_nut
97 type(
coef_t),
target,
optional :: coef
98 character(len=*),
intent(in) :: s_name
99 character(len=*),
intent(in) :: alphat_field
106 this%nut_dependency = .false.
110 call this%alphat_mean%init(this%alphat)
112 call this%alphatdsdx%init(this%s, trim(s_name) //
'alphatdsdx')
113 call this%alphatdsdy%init(this%s, trim(s_name) //
'alphatdsdy')
114 call this%alphatdsdz%init(this%s, trim(s_name) //
'alphatdsdz')
116 allocate(this%stat_fields%items(this%n_stats))
118 call this%stat_fields%assign_to_field(1, this%alphat_mean%mf)
119 call this%stat_fields%assign_to_field(2, this%alphatdsdx%mf)
120 call this%stat_fields%assign_to_field(3, this%alphatdsdy%mf)
121 call this%stat_fields%assign_to_field(4, this%alphatdsdz%mf)
133 type(
coef_t),
target,
optional :: coef
134 character(len=*),
intent(in) :: s_name
135 character(len=*),
intent(in) :: nut_field
136 real(kind=
rp),
intent(in) :: pr_turb
143 this%pr_turb = pr_turb
144 this%nut_dependency = .true.
146 allocate(this%alphat)
147 call this%alphat%init(this%nut%dof, trim(s_name) //
'alphat_temp')
151 call this%alphat_mean%init(this%alphat)
153 call this%alphatdsdx%init(this%s, trim(s_name) //
'alphatdsdx')
154 call this%alphatdsdy%init(this%s, trim(s_name) //
'alphatdsdy')
155 call this%alphatdsdz%init(this%s, trim(s_name) //
'alphatdsdz')
157 allocate(this%stat_fields%items(this%n_stats))
159 call this%stat_fields%assign_to_field(1, this%alphat_mean%mf)
160 call this%stat_fields%assign_to_field(2, this%alphatdsdx%mf)
161 call this%stat_fields%assign_to_field(3, this%alphatdsdy%mf)
162 call this%stat_fields%assign_to_field(4, this%alphatdsdz%mf)
170 real(kind=
rp),
intent(in) :: k
171 integer :: temp_indices(3)
174 temp_indices(1), .false.)
176 temp_indices(2), .false.)
178 temp_indices(3), .false.)
180 if (this%nut_dependency)
then
181 call field_cmult2(this%alphat, this%nut, 1.0_rp / this%pr_turb)
183 call this%alphat_mean%update(k)
185 call grad(this%dsdx_work%x, &
190 call this%alphatdsdx%update_col3(k, this%alphat, this%dsdx_work)
191 call this%alphatdsdy%update_col3(k, this%alphat, this%dsdy_work)
192 call this%alphatdsdz%update_col3(k, this%alphat, this%dsdz_work)
202 call this%alphat_mean%free()
204 call this%alphatdsdx%free()
205 call this%alphatdsdy%free()
206 call this%alphatdsdz%free()
208 if (this%nut_dependency .and.
associated(this%alphat))
then
209 call this%alphat%free()
210 deallocate(this%alphat)
217 call this%stat_fields%free()
225 call this%alphat_mean%reset()
227 call this%alphatdsdx%reset()
228 call this%alphatdsdy%reset()
229 call this%alphatdsdz%reset()
Compute the gradient of a scalar field, multiplied by the mass matrix.
subroutine, public field_cmult2(a, b, c, n)
Multiplication by constant c .
subroutine, public field_cmult(a, c, n)
Multiplication by constant c .
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.
Computes the subgrid-scale contributions for the scalar fluxes. We use the Reynolds decomposition for...
subroutine scalar_sgs_stats_free(this)
Destructor.
subroutine scalar_sgs_stats_init_nut(this, coef, s_name, nut_field, pr_turb)
Constructor. Initialize the fields associated with scalar_sgs_stats. This version uses nut field and ...
subroutine scalar_sgs_stats_reset(this)
Resets all the computed means values and sampling times to zero.
subroutine scalar_sgs_stats_init_alphat(this, coef, s_name, alphat_field)
Constructor. Initialize the fields associated with scalar_sgs_stats. This version uses alphat directl...
subroutine scalar_sgs_stats_update(this, k)
Updates all fields with a new sample.
Defines a registry for storing and requesting temporary objects This can be used when you have a func...
type(scratch_registry_t), target, public neko_scratch_registry
Global scratch registry.
Defines a statistical quantity.
Coefficients defined on a given (mesh, ) tuple. Arrays use indices (i,j,k,e): element e,...
field_list_t, To be able to group fields together
Computes the temporal mean of a field.
Abstract type defining a statistical quantity.