![]() |
JSBSim Flight Dynamics Model
1.0 (02 March 2017)
An Open Source Flight Dynamics and Control Software Library in C++
|
Models a fuel tank. More...
#include <FGTank.h>
Public Types | |
enum | GrainType { gtUNKNOWN, gtCYLINDRICAL, gtENDBURNING, gtFUNCTION } |
enum | TankType { ttUNKNOWN, ttFUEL, ttOXIDIZER } |
![]() | |
enum | { eL = 1, eM, eN } |
Moments L, M, N. | |
enum | { eP = 1, eQ, eR } |
Rates P, Q, R. | |
enum | { eU = 1, eV, eW } |
Velocities U, V, W. | |
enum | { eX = 1, eY, eZ } |
Positions X, Y, Z. | |
enum | { ePhi = 1, eTht, ePsi } |
Euler angles Phi, Theta, Psi. | |
enum | { eDrag = 1, eSide, eLift } |
Stability axis forces, Drag, Side force, Lift. | |
enum | { eRoll = 1, ePitch, eYaw } |
Local frame orientation Roll, Pitch, Yaw. | |
enum | { eNorth = 1, eEast, eDown } |
Local frame position North, East, Down. | |
enum | { eLat = 1, eLong, eRad } |
Locations Radius, Latitude, Longitude. | |
enum | { inNone = 0, inDegrees, inRadians, inMeters, inFeet } |
Conversion specifiers. | |
Public Member Functions | |
FGTank (FGFDMExec *exec, Element *el, int tank_number) | |
Constructor. More... | |
~FGTank () | |
Destructor. | |
double | Calculate (double dt, double TempC) |
Performs local, tanks-specific calculations, such as fuel temperature. More... | |
double | Drain (double used) |
Removes fuel from the tank. More... | |
double | Fill (double amount) |
double | GetCapacity (void) const |
Gets the capacity of the tank. More... | |
double | GetCapacityGallons (void) const |
Gets the capacity of the tank. More... | |
double | GetContents (void) const |
Gets the contents of the tank. More... | |
double | GetContentsGallons (void) const |
Gets the contents of the tank. More... | |
double | GetDensity (void) const |
double | GetExternalFlow (void) const |
const GrainType | GetGrainType (void) const |
double | GetIxx (void) const |
double | GetIyy (void) const |
double | GetIzz (void) const |
double | GetLocationX (void) const |
double | GetLocationY (void) const |
double | GetLocationZ (void) const |
double | GetPctFull (void) const |
Gets the tank fill level. More... | |
int | GetPriority (void) const |
bool | GetSelected (void) const |
If the tank is set to supply fuel, this function returns true. More... | |
double | GetStandpipe (void) const |
double | GetTemperature (void) const |
Gets the temperature of the fuel. More... | |
double | GetTemperature_degC (void) const |
Gets the temperature of the fuel. More... | |
int | GetType (void) const |
Retrieves the type of tank: Fuel or Oxidizer. More... | |
FGColumnVector3 | GetXYZ (void) const |
double | GetXYZ (int idx) const |
double | ProcessFuelName (const std::string &name) |
Returns the density of a named fuel type. More... | |
void | ResetToIC (void) |
Resets the tank parameters to the initial conditions. | |
void | SetContents (double amount) |
void | SetContentsGallons (double gallons) |
void | SetDensity (double d) |
void | SetExternalFlow (double f) |
void | SetLocationX (double x) |
void | SetLocationY (double y) |
void | SetLocationZ (double z) |
void | SetPriority (int p) |
void | SetSelected (bool sel) |
void | SetStandpipe (double amount) |
void | SetTemperature (double temp) |
![]() | |
FGJSBBase () | |
Constructor for FGJSBBase. | |
virtual | ~FGJSBBase () |
Destructor for FGJSBBase. | |
void | disableHighLighting (void) |
Disables highlighting in the console output. | |
std::string | GetVersion (void) |
Returns the version number of JSBSim. More... | |
void | PutMessage (const Message &msg) |
Places a Message structure on the Message queue. More... | |
void | PutMessage (const std::string &text) |
Creates a message with the given text and places it on the queue. More... | |
void | PutMessage (const std::string &text, bool bVal) |
Creates a message with the given text and boolean value and places it on the queue. More... | |
void | PutMessage (const std::string &text, int iVal) |
Creates a message with the given text and integer value and places it on the queue. More... | |
void | PutMessage (const std::string &text, double dVal) |
Creates a message with the given text and double value and places it on the queue. More... | |
int | SomeMessages (void) |
Reads the message on the queue (but does not delete it). More... | |
void | ProcessMessage (void) |
Reads the message on the queue and removes it from the queue. More... | |
Message * | ProcessNextMessage (void) |
Reads the next message on the queue and removes it from the queue. More... | |
Additional Inherited Members | |
![]() | |
static double | CelsiusToFahrenheit (double celsius) |
Converts from degrees Celsius to degrees Fahrenheit. More... | |
static double | CelsiusToKelvin (double celsius) |
Converts from degrees Celsius to degrees Kelvin. More... | |
static double | CelsiusToRankine (double celsius) |
Converts from degrees Celsius to degrees Rankine. More... | |
static double | Constrain (double min, double value, double max) |
Constrain a value between a minimum and a maximum value. | |
static bool | EqualToRoundoff (double a, double b) |
Finite precision comparison. More... | |
static bool | EqualToRoundoff (float a, float b) |
Finite precision comparison. More... | |
static bool | EqualToRoundoff (float a, double b) |
Finite precision comparison. More... | |
static bool | EqualToRoundoff (double a, float b) |
Finite precision comparison. More... | |
static double | FahrenheitToCelsius (double fahrenheit) |
Converts from degrees Fahrenheit to degrees Celsius. More... | |
static double | FeetToMeters (double measure) |
Converts from feet to meters. More... | |
static double | GaussianRandomNumber (void) |
static double | KelvinToCelsius (double kelvin) |
Converts from degrees Kelvin to degrees Celsius. More... | |
static double | KelvinToFahrenheit (double kelvin) |
Converts from degrees Kelvin to degrees Fahrenheit. More... | |
static double | KelvinToRankine (double kelvin) |
Converts from degrees Kelvin to degrees Rankine. More... | |
static double | MachFromVcalibrated (double vcas, double p, double psl, double rhosl) |
Calculate the Mach number from the calibrated airspeed. More... | |
static double | PitotTotalPressure (double mach, double p) |
Compute the total pressure in front of the Pitot tube. More... | |
static double | RankineToCelsius (double rankine) |
Converts from degrees Rankine to degrees Celsius. More... | |
static double | RankineToKelvin (double rankine) |
Converts from degrees Rankine to degrees Kelvin. More... | |
static double | sign (double num) |
static double | VcalibratedFromMach (double mach, double p, double psl, double rhosl) |
Calculate the calibrated airspeed from the Mach number. More... | |
![]() | |
static short | debug_lvl = 1 |
static char | highint [5] = {27, '[', '1', 'm', '\0' } |
highlights text | |
static char | halfint [5] = {27, '[', '2', 'm', '\0' } |
low intensity text | |
static char | normint [6] = {27, '[', '2', '2', 'm', '\0' } |
normal intensity text | |
static char | reset [5] = {27, '[', '0', 'm', '\0' } |
resets text properties | |
static char | underon [5] = {27, '[', '4', 'm', '\0' } |
underlines text | |
static char | underoff [6] = {27, '[', '2', '4', 'm', '\0' } |
underline off | |
static char | fgblue [6] = {27, '[', '3', '4', 'm', '\0' } |
blue text | |
static char | fgcyan [6] = {27, '[', '3', '6', 'm', '\0' } |
cyan text | |
static char | fgred [6] = {27, '[', '3', '1', 'm', '\0' } |
red text | |
static char | fggreen [6] = {27, '[', '3', '2', 'm', '\0' } |
green text | |
static char | fgdef [6] = {27, '[', '3', '9', 'm', '\0' } |
default text | |
![]() | |
void | Debug (int) |
![]() | |
static std::string | CreateIndexedPropertyName (const std::string &Property, int index) |
![]() | |
static const double | degtorad = 0.017453292519943295769236907684886 |
static const double | fpstokts = 1.0/ktstofps |
static const double | fttom = 0.3048 |
static int | gaussian_random_number_phase = 0 |
static const double | hptoftlbssec = 550.0 |
static const double | in3tom3 = 1.638706E-5 |
static const double | inchtoft = 0.08333333 |
static const double | inhgtopa = 3386.38 |
static const std::string | JSBSim_version = "1.0 " __DATE__ " " __TIME__ |
static const double | kgtolb = 2.20462 |
static const double | kgtoslug = 0.06852168 |
static const double | ktstofps = 1.68781 |
static const double | lbtoslug = 1.0/slugtolb |
static Message | localMsg |
static const double | m3toft3 = 1.0/(fttom*fttom*fttom) |
static double | Mair = 28.9645 |
static unsigned int | messageId = 0 |
static std::queue< Message > | Messages |
static const std::string | needed_cfg_version = "2.0" |
static const double | psftoinhg = 0.014138 |
static const double | psftopa = 47.88 |
static const double | radtodeg = 57.295779513082320876798154814105 |
static double | Reng = 1716.56 |
static double | Rstar = 1545.348 |
static const double | SHRatio = 1.40 |
static const double | slugtolb = 32.174049 |
Models a fuel tank.
Fuel temperature is calculated using the following assumptions: Fuel temperature will only be calculated for tanks which have an initial fuel temperature specified in the configuration file. The surface area of the tank is estimated from the capacity in pounds. It is assumed that the tank is a wing tank with dimensions h by 4h by 10h. The volume of the tank is then 40(h)(h)(h). The area of the upper or lower surface is then 40(h)(h). The volume is also equal to the capacity divided by 49.368 lbs/cu-ft, for jet fuel. The surface area of one side can then be derived from the tank's capacity. The heat capacity of jet fuel is assumed to be 900 Joules/lbm/K, and the heat transfer factor of the tank is 1.115 Watts/sq-ft/K.
Fuel dumping is handled by the FGPropulsion class. A standpipe can be defined here for each tank which sets the level of contents (in pounds) which is not dumpable. Default standpipe level is zero, making all contents dumpable.
Fuel transfer is handled by the FGPropulsion class, however the contents of tanks may be manipulated directly using the SetContents() function here, or via the property tree at <tt>propulsion/tank[i]/contents-lbs</tt>, where i is the tank number (Tanks are automatically numbered, starting at zero, in the order in which they are read in the aircraft configuration file). The latter method allows one to use a system of FCS components to control tank contents. There is also a property <tt>propulsion/tank[i]/external-flow-rate-pps</tt>. Setting this property to a positive value causes the tank to fill at the rate specified. Setting a negative number causes the tank to drain. The value is the rate in pounds of fuel per second. The tank will not fill past 100% full and will not drain below 0%. Fuel may be transfered between two tanks by setting the source tank's external flow rate to a negative value and the destination's external flow rate to the same positive value. Care must be taken to stop fuel flow before the source tank becomes empty to prevent phantom fuel being created.
location:
drain_location:
density - 6.6
Constructor.
The constructor reads in the defining parameters from a configuration file.
exec | a pointer to the base FGFDMExec instance. |
el | a pointer to the Tank element. |
tank_number | the tank number (zero based). |
Definition at line 58 of file FGTank.cpp.
double Calculate | ( | double | dt, |
double | TempC | ||
) |
Performs local, tanks-specific calculations, such as fuel temperature.
This function calculates the temperature of the fuel in the tank.
dt | the time step for this model. |
TempC | the Total Air Temperature in degrees Celsius. |
Definition at line 325 of file FGTank.cpp.
double Drain | ( | double | used | ) |
Removes fuel from the tank.
This function removes fuel from a tank. If the tank empties, it is deselected.
used | the amount of fuel used in lbs. |
Definition at line 259 of file FGTank.cpp.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Gets the temperature of the fuel.
The temperature of the fuel is calculated if an initial tempearture is given in the configuration file.
Definition at line 276 of file FGTank.h.
|
inline |
Gets the temperature of the fuel.
The temperature of the fuel is calculated if an initial tempearture is given in the configuration file.
|
inline |
double ProcessFuelName | ( | const std::string & | name | ) |
Returns the density of a named fuel type.
Definition at line 410 of file FGTank.cpp.