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

Simplify SystemBody::GetAtmPressure #5662

Merged
merged 1 commit into from
Nov 13, 2023
Merged
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
5 changes: 3 additions & 2 deletions src/galaxy/SystemBody.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,12 @@ double SystemBody::GetAtmPressure(double altitude) const
{
const double gasMolarMass = GetMolarMass(GetSuperType());
const double surfaceGravity_g = CalcSurfaceGravity();
const double lapseRate_L = surfaceGravity_g / GetSpecificHeat(GetSuperType()); // deg/m
const double specificHeat = GetSpecificHeat(GetSuperType());
const double lapseRate_L = surfaceGravity_g / specificHeat; // deg/m
const double surfaceTemperature_T0 = GetAverageTemp(); //K

return m_atmosPressure * pow((1 - lapseRate_L * altitude / surfaceTemperature_T0),
(surfaceGravity_g * gasMolarMass / (GAS_CONSTANT_R * lapseRate_L))); // in ATM since p0 was in ATM
(specificHeat * gasMolarMass / GAS_CONSTANT_R)); // in ATM since p0 was in ATM
}

double SystemBody::GetAtmDensity(double altitude, double pressure) const
Expand Down
Loading