]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/JSBSim.cxx
Updates from JSBSim, including new turbine engine model from David Culp
[flightgear.git] / src / FDM / JSBSim / JSBSim.cxx
index 15e5b18b5b0a571d62c75f3f288a8d7f23e1b71d..aaa08ef87bfb2e461a8e7d4bd45afa0c8272b432 100644 (file)
 // $Id$
 
 
+#ifdef HAVE_CONFIG_H
+#  include <config.h>
+#endif
+
 #include <simgear/compiler.h>
 
 #ifdef SG_MATH_EXCEPTION_CLASH
@@ -174,6 +178,7 @@ FGJSBsim::FGJSBsim( double dt )
     temperature = fgGetNode("/environment/temperature-degc",true);
     pressure = fgGetNode("/environment/pressure-inhg",true);
     density = fgGetNode("/environment/density-slugft3",true);
+    turbulence = fgGetNode("environment/turbulence-norm",true);
     
     wind_from_north= fgGetNode("/environment/wind-from-north-fps",true);
     wind_from_east = fgGetNode("/environment/wind-from-east-fps" ,true);
@@ -207,6 +212,9 @@ void FGJSBsim::init() {
                   9.0/5.0*(temperature->getDoubleValue()+273.15) );
       Atmosphere->SetExPressure(pressure->getDoubleValue()*70.726566);
       Atmosphere->SetExDensity(density->getDoubleValue());
+      Atmosphere->SetTurbGain(turbulence->getDoubleValue() *
+                              turbulence->getDoubleValue() *
+                              100.0);
     } else {
       Atmosphere->UseInternal();
     }
@@ -394,6 +402,9 @@ bool FGJSBsim::copy_to_JSBsim() {
                   9.0/5.0*(temperature->getDoubleValue()+273.15) );
     Atmosphere->SetExPressure(pressure->getDoubleValue()*70.726566);
     Atmosphere->SetExDensity(density->getDoubleValue());
+    Atmosphere->SetTurbGain(turbulence->getDoubleValue() *
+                            turbulence->getDoubleValue() *
+                            100.0);
 
     Atmosphere->SetWindNED( wind_from_north->getDoubleValue(),
                             wind_from_east->getDoubleValue(),
@@ -792,3 +803,4 @@ void FGJSBsim::update_ic(void) {
      fgic->SetClimbRateFpsIC( get_Climb_Rate() );
    }  
 }
+