Skip to content

Commit

Permalink
add shear production
Browse files Browse the repository at this point in the history
  • Loading branch information
szy21 committed Sep 7, 2023
1 parent 7b777bc commit 388219e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/cache/diagnostic_edmf_precomputed_quantities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -654,9 +654,13 @@ function set_diagnostic_edmf_precomputed_quantities!(Y, p, t)
# TODO: This is not correct with topography or with grid stretching
ᶠu⁰ = p.ᶠtemp_C123
@. ᶠu⁰ = C123(ᶠinterp(Y.c.uₕ)) + C123(ᶠu³⁰)
ct3_unit = p.ᶜtemp_CT3
@. ct3_unit = CT3(Geometry.WVector(FT(1)), ᶜlg)
@. ᶜshear² = norm_sqr(adjoint(CA.ᶜgradᵥ(ᶠu⁰)) * ct3_unit)
∇ᵥuvw = p.ᶜtemp_UVWxUVW
∇ᵥuvw = Geometry.project.(Ref(Geometry.UVWAxis()), ᶜgradᵥ.(UVW.(ᶠu⁰)))
@. ᶜshear² = norm_sqr((∇ᵥuvw + adjoint(∇ᵥuvw)) / 2)

# ct3_unit = p.ᶜtemp_CT3
# @. ct3_unit = CT3(Geometry.WVector(FT(1)), ᶜlg)
# @. ᶜshear² = norm_sqr(adjoint(CA.ᶜgradᵥ(ᶠu⁰)) * ct3_unit)
ᶜprandtl_nvec = p.ᶜtemp_scalar
@. ᶜprandtl_nvec = turbulent_prandtl_number(
params,
Expand Down
1 change: 1 addition & 0 deletions src/cache/temporary_quantities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ function temporary_quantities(atmos, center_space, face_space)
ᶠtemp_CT12ʲs = Fields.Field(NTuple{n, CT12{FT}}, face_space), # ᶠω¹²ʲs
ᶜtemp_C123 = Fields.Field(C123{FT}, center_space), # χ₁₂₃
ᶠtemp_C123 = Fields.Field(C123{FT}, face_space), # χ₁₂₃
ᶜtemp_UVWxUVW = Fields.Field(typeof(UVW(FT(0), FT(0), FT(0)) * UVW(FT(0), FT(0), FT(0))'), center_space), # ∇ᵥuvw
# TODO: Remove this hack
sfc_temp_C3 = Fields.Field(C3{FT}, Spaces.level(face_space, half)), # ρ_flux_χ
)
Expand Down
1 change: 1 addition & 0 deletions src/utils/abbreviations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const CT2 = Geometry.Contravariant2Vector
const CT12 = Geometry.Contravariant12Vector
const CT3 = Geometry.Contravariant3Vector
const CT123 = Geometry.Contravariant123Vector
const UVW = Geometry.UVWVector

const divₕ = Operators.Divergence()
const wdivₕ = Operators.WeakDivergence()
Expand Down

0 comments on commit 388219e

Please sign in to comment.