Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set thermo state iteration params #785

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions examples/hybrid/thermo_state.jl
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,15 @@ function thermo_state_ρθ!(ts, Yc, thermo_params, ::DryModel)
@. ts = TD.PhaseDry_ρθ(thermo_params, Yc.ρ, Yc.ρθ / Yc.ρ)
end
function thermo_state_ρθ!(ts, Yc, thermo_params, ::EquilMoistModel)
@. ts =
TD.PhaseEquil_ρθq(thermo_params, Yc.ρ, Yc.ρθ / Yc.ρ, Yc.ρq_tot / Yc.ρ)
FT = Spaces.undertype(axes(Yc))
@. ts = TD.PhaseEquil_ρθq(
thermo_params,
Yc.ρ,
Yc.ρθ / Yc.ρ,
Yc.ρq_tot / Yc.ρ,
2,
FT(3),
)
end
function thermo_state_ρθ!(ts, Yc, thermo_params, ::NonEquilMoistModel)
@. ts = TD.PhaseNonEquil_ρθq(
Expand All @@ -121,12 +128,15 @@ function thermo_state_ρe_tot!(ts, Yc, thermo_params, ::DryModel, z, K)
TD.PhaseDry(thermo_params, internal_energy(Yc, K, g, z) / Yc.ρ, Yc.ρ)
end
function thermo_state_ρe_tot!(ts, Yc, thermo_params, ::EquilMoistModel, z, K)
FT = Spaces.undertype(axes(Yc))
g = TD.Parameters.grav(thermo_params)
@. ts = TD.PhaseEquil_ρeq(
thermo_params,
Yc.ρ,
internal_energy(Yc, K, g, z) / Yc.ρ,
Yc.ρq_tot / Yc.ρ,
2,
FT(3),
)
end

Expand All @@ -144,11 +154,14 @@ function thermo_state_ρe_int!(ts, Yc, thermo_params, ::DryModel)
@. ts = TD.PhaseDry(thermo_params, Yc.ρe_int / Yc.ρ, Yc.ρ)
end
function thermo_state_ρe_int!(ts, Yc, thermo_params, ::EquilMoistModel)
FT = Spaces.undertype(axes(Yc))
@. ts = TD.PhaseEquil_ρeq(
thermo_params,
Yc.ρ,
Yc.ρe_int / Yc.ρ,
Yc.ρq_tot / Yc.ρ,
2,
FT(3),
)
end
function thermo_state_ρe_int!(ts, Yc, thermo_params, ::NonEquilMoistModel)
Expand Down