5#include <janus/janus.hpp>
14inline constexpr double RHO_0 = 1.225;
17inline constexpr double P_0 = 101325.0;
20inline constexpr double T_0 = 288.15;
27inline constexpr double G_0 = 9.80665;
30inline constexpr double R_AIR = 287.058;
33inline constexpr double GAMMA = 1.4;
75template <
typename Scalar>
78 return RHO_0 * janus::exp(-altitude / scale_height);
95template <
typename Scalar>
98 return P_0 * janus::exp(-altitude / scale_height);
113template <
typename Scalar>
119 return altitude * 0.0 +
T_0;
135template <
typename Scalar>
159template <
typename Scalar>
163 Scalar exp_factor = janus::exp(-altitude / scale_height);
166 .pressure =
P_0 * exp_factor,
167 .density =
RHO_0 * exp_factor,
202template <
typename Scalar>
205 return -scale_height * janus::log(rho /
RHO_0);
219template <
typename Scalar>
222 return -scale_height * janus::log(P /
P_0);
Definition ExponentialAtmosphere.hpp:7
AtmosphericState< Scalar > state(const Scalar &altitude, double scale_height=DEFAULT_SCALE_HEIGHT)
Exponential atmosphere - Complete atmospheric state.
Definition ExponentialAtmosphere.hpp:160
Scalar speed_of_sound(const Scalar &altitude, double scale_height=DEFAULT_SCALE_HEIGHT)
Exponential atmosphere - Speed of Sound.
Definition ExponentialAtmosphere.hpp:136
constexpr double T_0
Sea-level reference temperature [K].
Definition ExponentialAtmosphere.hpp:20
Scalar temperature(const Scalar &altitude, double scale_height=DEFAULT_SCALE_HEIGHT)
Exponential atmosphere - Temperature.
Definition ExponentialAtmosphere.hpp:114
Scalar density(const Scalar &altitude, double scale_height=DEFAULT_SCALE_HEIGHT)
Exponential atmosphere - Density.
Definition ExponentialAtmosphere.hpp:76
constexpr double DEFAULT_SCALE_HEIGHT
Definition ExponentialAtmosphere.hpp:24
Scalar pressure(const Scalar &altitude, double scale_height=DEFAULT_SCALE_HEIGHT)
Exponential atmosphere - Pressure.
Definition ExponentialAtmosphere.hpp:96
Scalar altitude_from_pressure(const Scalar &P, double scale_height=DEFAULT_SCALE_HEIGHT)
Compute altitude from pressure.
Definition ExponentialAtmosphere.hpp:220
constexpr double GAMMA
Ratio of specific heats for air (γ = Cp/Cv).
Definition ExponentialAtmosphere.hpp:33
constexpr double P_0
Sea-level reference pressure [Pa].
Definition ExponentialAtmosphere.hpp:17
constexpr double G_0
Sea-level gravitational acceleration [m/s²].
Definition ExponentialAtmosphere.hpp:27
double compute_scale_height(double temperature=T_0, double gravity=G_0)
Compute scale height from reference conditions.
Definition ExponentialAtmosphere.hpp:186
constexpr double R_AIR
Specific gas constant for air [J/(kg·K)].
Definition ExponentialAtmosphere.hpp:30
Scalar altitude_from_density(const Scalar &rho, double scale_height=DEFAULT_SCALE_HEIGHT)
Compute altitude from density.
Definition ExponentialAtmosphere.hpp:203
constexpr double RHO_0
Sea-level reference density [kg/m³].
Definition ExponentialAtmosphere.hpp:14
Definition GravityTypes.hpp:7
Complete atmospheric state at a given altitude.
Definition ExponentialAtmosphere.hpp:47
Scalar speed_of_sound
Speed of sound [m/s].
Definition ExponentialAtmosphere.hpp:51
Scalar temperature
Temperature [K].
Definition ExponentialAtmosphere.hpp:48
Scalar density
Air density [kg/m³].
Definition ExponentialAtmosphere.hpp:50
Scalar pressure
Pressure [Pa].
Definition ExponentialAtmosphere.hpp:49