68 temperature_field_name, TKE_field_name, &
69 nut, temperature_alphat, &
70 TKE_alphat, TKE_source, &
72 real(kind=
rp),
intent(in) :: t
73 integer,
intent(in) :: tstep
74 type(
coef_t),
intent(in) :: coef
75 character(len=*),
intent(in) :: temperature_field_name
76 character(len=*),
intent(in) :: tke_field_name
77 type(
field_t),
intent(inout) :: nut, temperature_alphat
78 type(
field_t),
intent(inout) :: tke_alphat, tke_source
79 type(
field_t),
intent(in) :: delta
80 real(kind=
rp),
intent(in) :: c_k, t0, g(3)
81 type(
field_t),
pointer :: tke, temperature
82 type(
field_t),
pointer :: dtdx, dtdy, dtdz
83 type(
field_t),
pointer :: u, v, w
84 real(kind=
rp):: s11, s22, s33, s12, s13, s23
85 type(
field_t),
pointer :: a11, a12, a13, a21, a22, a23, a31, a32, a33
86 real(kind=
rp) :: shear, buoyancy, dissipation
87 integer :: temp_indices(12)
88 real(kind=
rp) :: l, n2
92 temperature =>
neko_registry%get_field_by_name(temperature_field_name)
103 call grad(dtdx%x, dtdy%x, dtdz%x, temperature%x, coef)
108 call col2(dtdx%x, coef%mult, nut%dof%size())
109 call col2(dtdy%x, coef%mult, nut%dof%size())
110 call col2(dtdz%x, coef%mult, nut%dof%size())
123 call grad(a11%x, a12%x, a13%x, u%x, coef)
124 call grad(a21%x, a22%x, a23%x, v%x, coef)
125 call grad(a31%x, a32%x, a33%x, w%x, coef)
137 call col2(a11%x, coef%mult, nut%dof%size())
138 call col2(a12%x, coef%mult, nut%dof%size())
139 call col2(a13%x, coef%mult, nut%dof%size())
140 call col2(a21%x, coef%mult, nut%dof%size())
141 call col2(a22%x, coef%mult, nut%dof%size())
142 call col2(a23%x, coef%mult, nut%dof%size())
143 call col2(a31%x, coef%mult, nut%dof%size())
144 call col2(a32%x, coef%mult, nut%dof%size())
145 call col2(a33%x, coef%mult, nut%dof%size())
148 do concurrent(i = 1:coef%dof%size())
150 if (tke%x(i,1,1,1) .lt.
neko_eps)
then
154 n2 = (dtdx%x(i,1,1,1) * g(1) + &
155 dtdy%x(i,1,1,1) * g(2) + &
156 dtdz%x(i,1,1,1) * g(3)) / t0
157 if (n2 .gt. 0.0_rp)
then
158 l = 0.76_rp * sqrt(tke%x(i,1,1,1) / n2)
159 l = min(l, delta%x(i,1,1,1))
165 nut%x(i,1,1,1) = c_k * l * sqrt(tke%x(i,1,1,1))
168 temperature_alphat%x(i,1,1,1) = (1.0_rp + 2.0_rp * l/delta%x(i,1,1,1)) &
170 tke_alphat%x(i,1,1,1) = 2.0_rp * nut%x(i,1,1,1)
172 s11 = a11%x(i,1,1,1) + a11%x(i,1,1,1)
173 s22 = a22%x(i,1,1,1) + a22%x(i,1,1,1)
174 s33 = a33%x(i,1,1,1) + a33%x(i,1,1,1)
175 s12 = a12%x(i,1,1,1) + a21%x(i,1,1,1)
176 s13 = a13%x(i,1,1,1) + a31%x(i,1,1,1)
177 s23 = a23%x(i,1,1,1) + a32%x(i,1,1,1)
179 shear = nut%x(i,1,1,1) &
180 * (s11*a11%x(i,1,1,1) &
181 + s12*a12%x(i,1,1,1) &
182 + s13*a13%x(i,1,1,1) &
183 + s12*a21%x(i,1,1,1) &
184 + s22*a22%x(i,1,1,1) &
185 + s23*a23%x(i,1,1,1) &
186 + s13*a31%x(i,1,1,1) &
187 + s23*a32%x(i,1,1,1) &
188 + s33*a33%x(i,1,1,1))
191 buoyancy = -(g(1) * dtdx%x(i,1,1,1) + &
192 g(2) * dtdy%x(i,1,1,1) + &
193 g(3) * dtdz%x(i,1,1,1)) / t0 * temperature_alphat%x(i,1,1,1)
195 dissipation = -(0.19_rp + 0.74_rp * l/ delta%x(i,1,1,1)) &
196 * sqrt(tke%x(i,1,1,1)*tke%x(i,1,1,1)*tke%x(i,1,1,1)) &
200 tke_source%x(i,1,1,1) = shear + buoyancy + dissipation