- // The pitot tube sees the forward
- // velocity in the body axis.
- double p = _pressure_node->getDoubleValue() * INHGTOPSF;
- double r = _density_node->getDoubleValue();
- double v = _velocity_node->getDoubleValue() * KTTOFPS;
- double q = 0.5 * r * v * v; // dynamic
- _total_pressure_node->setDoubleValue((p + q) * PSFTOINHG);
+ double p = _pressure_node->getDoubleValue();
+ double mach = _mach_node->getDoubleValue();
+ mach = std::max( mach , 0.0 );
+ double p_t = p * pow(1 + 0.2 * mach*mach, 3.5 ); // true total pressure around aircraft
+ _total_pressure_node->setDoubleValue(p_t);
+ double p_t_meas = p_t;
+ if (mach > 1) {
+ p_t_meas = p * pow( 1.2 * mach*mach, 3.5 ) * pow( 2.8/2.4*mach*mach - 0.4 / 2.4 , -2.5 ); // measured total pressure by pitot tube (Rayleigh formula, at Mach>1, normal shockwave in front of pitot tube)
+ }
+ _measured_total_pressure_node->setDoubleValue(p_t_meas);