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

remove reference temperature in virtual DSE #187

Merged
merged 1 commit into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Thermodynamics"
uuid = "b60c26fb-14c3-4610-9d3e-2d17fe7ff00c"
authors = ["Climate Modeling Alliance"]
version = "0.11.4"
version = "0.11.5"

[deps]
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
Expand Down
2 changes: 1 addition & 1 deletion src/relations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2956,7 +2956,7 @@ Virtual dry static energy, given
T_0::FT = TP.T_0(param_set)
cp_d::FT = TP.cp_d(param_set)
T_virt = virtual_temperature(param_set, ts)
return cp_d * (T_virt - T_0) + e_pot
return cp_d * T_virt + e_pot
end

"""
Expand Down
3 changes: 1 addition & 2 deletions test/relations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,6 @@ end

e_tot = total_energy.(param_set, ts, e_kin, e_pot)
_cp_d = FT(TP.cp_d(param_set))
_T_0 = FT(TP.T_0(param_set))
@test all(
specific_enthalpy.(param_set, ts) .≈
e_int .+
Expand All @@ -667,7 +666,7 @@ end
)
@test all(
virtual_dry_static_energy.(param_set, ts, e_pot) .≈
_cp_d .* (virtual_temperature.(param_set, ts) .- _T_0) .+ e_pot,
_cp_d .* virtual_temperature.(param_set, ts) .+ e_pot,
)

# PhaseEquil
Expand Down
Loading