Add spdFromMach() and spdFromVCAS().
This commit is contained in:
parent
c90d7e96c2
commit
1e5d48d1d9
2 changed files with 22 additions and 0 deletions
|
@ -102,6 +102,25 @@ float Atmosphere::calcMach(float spd, float temp)
|
||||||
return spd / Math::sqrt(GAMMA * R * temp);
|
return spd / Math::sqrt(GAMMA * R * temp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float Atmosphere::spdFromMach(float mach, float temp)
|
||||||
|
{
|
||||||
|
return mach * Math::sqrt(GAMMA * R * temp);
|
||||||
|
}
|
||||||
|
|
||||||
|
float Atmosphere::spdFromVCAS(float vcas, float pressure, float temp)
|
||||||
|
{
|
||||||
|
// FIXME: does not account for supersonic
|
||||||
|
float p0 = getStdPressure(0);
|
||||||
|
float rho0 = getStdDensity(0);
|
||||||
|
|
||||||
|
float tmp = (vcas*vcas)/(7*p0/rho0) + 1;
|
||||||
|
float cp = ((Math::pow(tmp,(7/2.))-1)/(pressure/p0)) + 1;
|
||||||
|
|
||||||
|
float m2 = (Math::pow(cp,(1/3.5))-1)/0.2;
|
||||||
|
float vtas= spdFromMach(Math::sqrt(m2), temp);
|
||||||
|
return vtas;
|
||||||
|
}
|
||||||
|
|
||||||
void Atmosphere::calcStaticAir(float p0, float t0, float d0, float v,
|
void Atmosphere::calcStaticAir(float p0, float t0, float d0, float v,
|
||||||
float* pOut, float* tOut, float* dOut)
|
float* pOut, float* tOut, float* dOut)
|
||||||
{
|
{
|
||||||
|
|
|
@ -14,6 +14,9 @@ public:
|
||||||
static float calcMach(float spd, float temp);
|
static float calcMach(float spd, float temp);
|
||||||
static float calcStdDensity(float pressure, float temp);
|
static float calcStdDensity(float pressure, float temp);
|
||||||
|
|
||||||
|
static float spdFromMach(float mach, float temp);
|
||||||
|
static float spdFromVCAS(float vcas, float pressure, float temp);
|
||||||
|
|
||||||
// Given ambient ("0") pressure/density/temperature values,
|
// Given ambient ("0") pressure/density/temperature values,
|
||||||
// calculate the properties of static air (air accelerated to the
|
// calculate the properties of static air (air accelerated to the
|
||||||
// aircraft's speed) at a given velocity. Includes
|
// aircraft's speed) at a given velocity. Includes
|
||||||
|
|
Loading…
Add table
Reference in a new issue