]> git.mxchange.org Git - flightgear.git/commitdiff
- Added a redundant (left/right) vacuum pump.
authorcurt <curt>
Tue, 27 May 2003 19:25:27 +0000 (19:25 +0000)
committercurt <curt>
Tue, 27 May 2003 19:25:27 +0000 (19:25 +0000)
- Modified the rpm vs. suction formula to hit much more realistic numbers.
  We should be seeing just over 4 inhg at idle and approaching 5 inhg at
  full throttle.

src/Systems/system_mgr.cxx
src/Systems/vacuum.cxx
src/Systems/vacuum.hxx

index cb7406f98a4e952a36746d92d681cd12d4f98e13..bdf525f1411081ff4e03a27901f4fc30618ba726 100644 (file)
 
 FGSystemMgr::FGSystemMgr ()
 {
-    set_subsystem("electrical", new FGElectricalSystem);
-    set_subsystem("pitot", new PitotSystem);
-    set_subsystem("static", new StaticSystem);
-    set_subsystem("vacuum", new VacuumSystem);
+    set_subsystem( "electrical", new FGElectricalSystem );
+    set_subsystem( "pitot", new PitotSystem );
+    set_subsystem( "static", new StaticSystem );
+    set_subsystem( "vacuum-l", new VacuumSystem(0) );
+    set_subsystem( "vacuum-r", new VacuumSystem(1) );
 }
 
 FGSystemMgr::~FGSystemMgr ()
index 19bde57773912bd073779970f47bd67dc4650bc6..5b07b77f564e7fd737674e9f1c9abfe749f8c49a 100644 (file)
@@ -7,8 +7,9 @@
 #include <Main/fg_props.hxx>
 
 
-VacuumSystem::VacuumSystem ()
+VacuumSystem::VacuumSystem( int i )
 {
+    num = i;
 }
 
 VacuumSystem::~VacuumSystem ()
@@ -16,14 +17,15 @@ VacuumSystem::~VacuumSystem ()
 }
 
 void
-VacuumSystem::init ()
+VacuumSystem::init()
 {
-                                // TODO: allow index of pump and engine
-                                // to be configured.
-    _serviceable_node = fgGetNode("/systems/vacuum[0]/serviceable", true);
+                                // TODO: allow index of engine to be
+                                // configured.
+    SGPropertyNode *node = fgGetNode("/systems/vacuum", num, true );
+    _serviceable_node = node->getChild("serviceable", 0, true);
     _rpm_node = fgGetNode("/engines/engine[0]/rpm", true);
     _pressure_node = fgGetNode("/environment/pressure-inhg", true);
-    _suction_node = fgGetNode("/systems/vacuum[0]/suction-inhg", true);
+    _suction_node = node->getChild("suction-inhg", 0, true);
 }
 
 void
@@ -48,9 +50,12 @@ VacuumSystem::update (double dt)
     } else {
         double rpm = _rpm_node->getDoubleValue();
         double pressure = _pressure_node->getDoubleValue();
-        suction = pressure * rpm / (rpm + 10000.0);
-        if (suction > 5.0)
-            suction = 5.0;
+        // suction = pressure * rpm / (rpm + 5000.0);
+        // This magic formula yields about 4.1 inhg at 700 rpm and
+        // about 6.0 inhg at 2200 rpm (numbers by observation)
+        suction = 5.39 - 1.0 / ( rpm * 0.00111 );
+        if ( suction < 0.0 ) suction = 0.0;
+        if ( suction > 5.0 ) suction = 5.0;
     }
     _suction_node->setDoubleValue(suction);
 }
index 2572c73f993c4add41d647361c52564b91873600..3087c46339236301ce3265264468605188847711 100644 (file)
  *
  * Output properties:
  *
- * /systems/vacuum[0]/suction-inhg
+ * /systems/vacuum[n]/suction-inhg
  */
 class VacuumSystem : public FGSubsystem
 {
 
 public:
 
-    VacuumSystem ();
+    VacuumSystem( int i );
     virtual ~VacuumSystem ();
 
     virtual void init ();
@@ -46,6 +46,7 @@ public:
 
 private:
 
+    int num;
     SGPropertyNode_ptr _serviceable_node;
     SGPropertyNode_ptr _rpm_node;
     SGPropertyNode_ptr _pressure_node;