X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FFDM%2FJSBSim%2Fmodels%2FFGGasCell.h;h=ff3613c17bd0c2d9fcbfe416e51090b61b0a5d40;hb=1575fad886a0b18825363d41d53a287e8d36b9c8;hp=0aae911b1076033d7bd620f17c622dd20d3558b1;hpb=6fcd9f967bf659cc0dcf7288fc82a111e3eaee24;p=flightgear.git
diff --git a/src/FDM/JSBSim/models/FGGasCell.h b/src/FDM/JSBSim/models/FGGasCell.h
index 0aae911b1..ff3613c17 100644
--- a/src/FDM/JSBSim/models/FGGasCell.h
+++ b/src/FDM/JSBSim/models/FGGasCell.h
@@ -4,7 +4,7 @@
Author: Anders Gidenstam
Date started: 01/21/2006
- ----- Copyright (C) 2006 - 2008 Anders Gidenstam (anders(at)gidenstam.org) --
+ ----- Copyright (C) 2006 - 2011 Anders Gidenstam (anders(at)gidenstam.org) --
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free Software
@@ -32,8 +32,8 @@ This class simulates a generic gas cell for static buoyancy.
SENTRY
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-#ifndef FGGasCell_H
-#define FGGasCell_H
+#ifndef FGGASCELL_H
+#define FGGASCELL_H
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
INCLUDES
@@ -50,7 +50,7 @@ INCLUDES
DEFINITIONS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-#define ID_GASCELL "$Id$"
+#define ID_GASCELL "$Id: FGGasCell.h,v 1.12 2011/08/06 13:47:59 jberndt Exp $"
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FORWARD DECLARATIONS
@@ -172,11 +172,18 @@ CLASS DECLARATION
class FGGasCell : public FGForce
{
public:
+ struct Inputs {
+ double Pressure;
+ double Temperature;
+ double Density;
+ double gravity;
+ };
+
/** Constructor
@param exec Executive a pointer to the parent executive object
@param el Pointer to configuration file XML node
@param num Gas cell index number. */
- FGGasCell(FGFDMExec* exec, Element* el, int num);
+ FGGasCell(FGFDMExec* exec, Element* el, int num, const struct Inputs& input);
~FGGasCell();
/** Runs the gas cell model; called by BuoyantForces
@@ -189,12 +196,12 @@ public:
/** Get the center of gravity location of the gas cell
(including any ballonets)
- @return CoG location in the structural frame. */
+ @return CoG location in the structural frame in inches. */
const FGColumnVector3& GetXYZ(void) const {return vXYZ;}
/** Get the center of gravity location of the gas cell
(including any ballonets)
- @return CoG location in the structural frame. */
+ @return CoG location in the structural frame in inches. */
double GetXYZ(int idx) const {return vXYZ(idx);}
/** Get the current mass of the gas cell (including any ballonets)
@@ -202,7 +209,7 @@ public:
double GetMass(void) const {return Mass;}
/** Get the moments of inertia of the gas cell (including any ballonets)
- @return moments of inertia matrix relative the gas cell location
+ @return moments of inertia matrix in the body frame
in slug ft2. */
const FGMatrix33& GetInertia(void) const {return gasCellJ;}
@@ -210,7 +217,7 @@ public:
Note that the buoyancy of the gas cell is handled separately by the
FGForce part and not included here.
- @return moment vector in lbs ft. */
+ @return moment vector in the structural frame in lbs in. */
const FGColumnVector3& GetMassMoment(void) const {return gasCellM;}
/** Get the current gas temperature inside the gas cell
@@ -221,6 +228,8 @@ public:
@return gas pressure in lbs / ft2. */
double GetPressure(void) const {return Pressure;}
+ const struct Inputs& in;
+
private:
enum GasType {ttUNKNOWN, ttHYDROGEN, ttHELIUM, ttAIR};
@@ -229,8 +238,8 @@ private:
std::string type;
int CellNum;
// Structural constants
- double MaxVolume; // [ft�]
- double MaxOverpressure; // [lbs/ft�]
+ double MaxVolume; // [ft^2]
+ double MaxOverpressure; // [lbs/ft^2]
FGColumnVector3 vXYZ; // [in]
double Xradius, Yradius, Zradius; // [ft]
double Xwidth, Ywidth, Zwidth; // [ft]
@@ -240,22 +249,19 @@ private:
typedef vector BallonetArray;
BallonetArray Ballonet;
// Variables
- double Pressure; // [lbs/ft�]
+ double Pressure; // [lbs/ft^2]
double Contents; // [mol]
- double Volume; // [ft�]
- double dVolumeIdeal; // [ft�]
+ double Volume; // [ft^2]
+ double dVolumeIdeal; // [ft^2]
double Temperature; // [Rankine]
double Buoyancy; // [lbs] Note: Gross lift.
// Does not include the weight of the gas itself.
double ValveOpen; // 0 <= ValveOpen <= 1 (or higher).
double Mass; // [slug]
- FGMatrix33 gasCellJ; // [slug foot�]
- FGColumnVector3 gasCellM; // [lbs ft]
+ FGMatrix33 gasCellJ; // [slug foot^2]
+ FGColumnVector3 gasCellM; // [lbs in]
- FGAuxiliary* Auxiliary;
- FGAtmosphere* Atmosphere;
FGPropertyManager* PropertyManager;
- FGInertial* Inertial;
FGMassBalance* MassBalance;
void Debug(int from);
@@ -295,7 +301,6 @@ private:
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
/** Models a ballonet inside a gas cell.
- Models a ballonet inside a gas cell.
Not intended to be used outside FGGasCell.
See FGGasCell for the configuration file format.
@author Anders Gidenstam
@@ -303,7 +308,7 @@ private:
class FGBallonet : public FGJSBBase
{
public:
- FGBallonet(FGFDMExec* exec, Element* el, int num, FGGasCell* parent);
+ FGBallonet(FGFDMExec* exec, Element* el, int num, FGGasCell* parent, const struct FGGasCell::Inputs& input);
~FGBallonet();
/** Runs the ballonet model; called by FGGasCell
@@ -312,10 +317,10 @@ public:
/** Get the center of gravity location of the ballonet
- @return CoG location in the structural frame. */
+ @return CoG location in the structural frame in inches. */
const FGColumnVector3& GetXYZ(void) const {return vXYZ;}
/** Get the center of gravity location of the ballonet
- @return CoG location in the structural frame. */
+ @return CoG location in the structural frame in inches. */
double GetXYZ(int idx) const {return vXYZ(idx);}
/** Get the current mass of the ballonets
@@ -323,7 +328,8 @@ public:
double GetMass(void) const {return Contents * M_air;}
/** Get the moments of inertia of the ballonet
- @return moments of inertia matrix in slug ft2. */
+ @return moments of inertia matrix in the body frame in
+ slug ft2. */
const FGMatrix33& GetInertia(void) const {return ballonetJ;}
/** Get the current volume of the ballonet
@@ -333,11 +339,13 @@ public:
@return heat flow in lbs ft / sec. */
double GetHeatFlow(void) const {return dU;} // [lbs ft / sec]
+ const struct FGGasCell::Inputs& in;
+
private:
int CellNum;
// Structural constants
- double MaxVolume; // [ft�]
- double MaxOverpressure; // [lbs/ft�]
+ double MaxVolume; // [ft^2]
+ double MaxOverpressure; // [lbs/ft^2]
FGColumnVector3 vXYZ; // [in]
double Xradius, Yradius, Zradius; // [ft]
double Xwidth, Ywidth, Zwidth; // [ft]
@@ -347,19 +355,17 @@ private:
FGFunction* BlowerInput; // [ft^3 / sec]
FGGasCell* Parent;
// Variables
- double Pressure; // [lbs/ft�]
+ double Pressure; // [lbs/ft^2]
double Contents; // [mol]
- double Volume; // [ft�]
- double dVolumeIdeal; // [ft�]
+ double Volume; // [ft^2]
+ double dVolumeIdeal; // [ft^2]
double dU; // [lbs ft / sec]
double Temperature; // [Rankine]
double ValveOpen; // 0 <= ValveOpen <= 1 (or higher).
- FGMatrix33 ballonetJ; // [slug foot�]
+ FGMatrix33 ballonetJ; // [slug foot^2]
- FGAuxiliary* Auxiliary;
- FGAtmosphere* Atmosphere;
FGPropertyManager* PropertyManager;
- FGInertial* Inertial;
+ FGMassBalance* MassBalance;
void Debug(int from);
/* Constants. */