@@ -237,12 +237,33 @@ function set_velocity_at_top!(Y, turbconv_model)
237
237
return nothing
238
238
end
239
239
240
+ """
241
+ compute_ᶜu(ᶜuₕ, ᶠu₃)
242
+
243
+ Computes the cell-centered velocity, given
244
+
245
+ - `ᶜuₕ` the cell-centered horizontal velocity
246
+ - `ᶠu₃` the cell-face `Covariant3` velocity
247
+ """
248
+ compute_ᶜu (ᶜuₕ, ᶠu₃) = @lazy @. C123 (ᶜuₕ) + ᶜinterp (C123 (ᶠu₃))
249
+
250
+ """
251
+ compute_ᶠu³(ᶠuₕ³, ᶠu₃)
252
+
253
+ Computes the cell-face contravariant velocity, given
254
+
255
+ - `ᶠuₕ³` the cell-face horizontal `Contravariant3` velocity
256
+ - `ᶠu₃` the cell-face `Covariant3` velocity
257
+ """
258
+ compute_ᶠu³ (ᶠuₕ³, ᶠu₃) = ᶠuₕ³ + CT3 (ᶠu₃)
259
+
240
260
# This is used to set the grid-scale velocity quantities ᶜu, ᶠu³, ᶜK based on
241
261
# ᶠu₃, and it is also used to set the SGS quantities based on ᶠu₃⁰ and ᶠu₃ʲ.
242
- compute_ᶜu (ᶜuₕ, ᶠu₃) = @lazy @. C123 (ᶜuₕ) + ᶜinterp (C123 (ᶠu₃))
243
- function compute_ᶠu³ (ᶜuₕ, ᶜρ, ᶠu₃)
244
- ᶠuₕ³ = compute_ᶠuₕ³ (ᶜuₕ, ᶜρ)
245
- return @lazy @. ᶠuₕ³ + CT3 (ᶠu₃)
262
+ function set_velocity_quantities! (ᶜu, ᶠu³, ᶜK, ᶠu₃, ᶜuₕ, ᶜρ)
263
+ ᶜu .= compute_ᶜu (ᶜuₕ, ᶠu₃)
264
+ ᶠu³ .= compute_ᶠu³ .(compute_ᶠuₕ³ (ᶜuₕ, ᶜρ), ᶠu₃)
265
+ ᶜK .= compute_kinetic (ᶜuₕ, ᶠu₃)
266
+ return nothing
246
267
end
247
268
248
269
function set_sgs_ᶠu₃! (w_function, ᶠu₃, Y, turbconv_model)
@@ -390,9 +411,7 @@ NVTX.@annotate function set_precomputed_quantities!(Y, p, t)
390
411
set_velocity_at_surface! (Y, ᶠuₕ³, turbconv_model)
391
412
set_velocity_at_top! (Y, turbconv_model)
392
413
393
- ᶠu³ .= compute_ᶠu³ (ᶜuₕ, ᶜρ, ᶠu₃)
394
- ᶜu .= compute_ᶜu (ᶜuₕ, ᶠu₃)
395
- ᶜK .= compute_kinetic (ᶜuₕ, ᶠu₃)
414
+ set_velocity_quantities! (ᶜu, ᶠu³, ᶜK, Y. f. u₃, Y. c. uₕ, ᶜρ)
396
415
397
416
if n > 0
398
417
# TODO : In the following increments to ᶜK, we actually need to add
0 commit comments