JSBSim Flight Dynamics Model 1.0 (23 February 2013)
An Open Source Flight Dynamics and Control Software Library in C++

FGEngine Class Reference

Base class for all engines. More...

#include <FGEngine.h>

Inheritance diagram for FGEngine:
Collaboration diagram for FGEngine:

List of all members.

Classes

struct  Inputs

Public Types

enum  EngineType {
  etUnknown, etRocket, etPiston, etTurbine,
  etTurboprop, etElectric
}

Public Member Functions

 FGEngine (FGFDMExec *exec, Element *el, int engine_number, struct Inputs &input)
virtual double CalcFuelNeed (void)
 The fuel need is calculated based on power levels and flow rate for that power level.
virtual double CalcOxidizerNeed (void)
virtual void Calculate (void)=0
 Calculates the thrust of the engine, and other engine functions.
virtual const FGColumnVector3GetBodyForces (void)
virtual bool GetCranking (void) const
virtual std::string GetEngineLabels (const std::string &delimiter)=0
virtual std::string GetEngineValues (const std::string &delimiter)=0
virtual double getFuelFlow_gph () const
virtual double getFuelFlow_pph () const
virtual double GetFuelFlowRate (void) const
virtual double GetFuelFlowRateGPH (void) const
virtual double GetFuelUsedLbs (void) const
virtual const FGColumnVector3GetMoments (void)
virtual const string & GetName (void) const
unsigned int GetNumSourceTanks () const
virtual double GetPowerAvailable (void)
virtual bool GetRunning (void) const
unsigned int GetSourceTank (unsigned int i) const
virtual bool GetStarter (void) const
virtual bool GetStarved (void) const
virtual double GetThrottleMax (void) const
virtual double GetThrottleMin (void) const
virtual double GetThrust (void) const
FGThrusterGetThruster (void) const
EngineType GetType (void) const
virtual int InitRunning (void)
bool LoadThruster (Element *el)
void LoadThrusterInputs ()
void ResetToIC (void)
 Resets the Engine parameters to the initial conditions.
virtual void SetFuelFreeze (bool f)
virtual void SetName (const string &name)
virtual void SetPlacement (const FGColumnVector3 &location, const FGColumnVector3 &orientation)
 Sets engine placement information.
virtual void SetRunning (bool bb)
virtual void SetStarter (bool s)
virtual void SetStarved (void)
virtual void SetStarved (bool tt)

Public Attributes

struct Inputsin

Protected Member Functions

void Debug (int from)

Protected Attributes

bool Cranking
const int EngineNumber
double EnginePitch
double EngineYaw
FGFDMExecFDMExec
double FuelExpended
double FuelFlow_gph
double FuelFlow_pph
double FuelFlowRate
bool FuelFreeze
double FuelUsedLbs
double MaxThrottle
double MinThrottle
std::string Name
double PctPower
FGPropertyManagerPropertyManager
 Reduces the fuel in the active tanks by the amount required.
bool Running
double SLFuelFlowMax
std::vector< int > SourceTanks
bool Starter
bool Starved
FGThrusterThruster
EngineType Type
double X
double Y
double Z

Detailed Description

This base class contains methods and members common to all engines, such as logic to drain fuel from the appropriate tank, etc.

Configuration File Format:

        <engine file="{string}">
            <location unit="{IN | M}">
                <x> {number} </x>
                <y> {number} </y>
                <z> {number} </z>
            </location>
            <!-- optional orientation definition -->
            <orient unit="{RAD | DEG}">
                <roll>  {number} </roll>
                <pitch> {number} </pitch>
                <yaw> {number} </yaw>
            </orient>
            <feed> {integer} </feed>
            ... optional more feed tank index numbers ... 
            <thruster file="{string}">
                <location unit="{IN | M}">
                    <x> {number} </x>
                    <y> {number} </y>
                    <z> {number} </z>
                </location>
                <orient unit="{RAD | DEG}">
                    <roll> {number} </roll>
                    <pitch> {number} </pitch>
                    <yaw> {number} </yaw>
                </orient>
            </thruster>
        </engine>
    NOTES:
  Not all thruster types can be matched with a given engine type.  See the class
  documentation for engine and thruster classes.
Author:
Jon S. Berndt
Version:
Id:
FGEngine.h,v 1.36 2012/07/29 12:04:09 bcoconni Exp

Definition at line 123 of file FGEngine.h.


Member Function Documentation

double CalcFuelNeed ( void  ) [virtual]

It is also turned from a rate into an actual amount (pounds) by multiplying it by the delta T and the rate.

Returns:
Total fuel requirement for this engine in pounds.

Reimplemented in FGPiston, FGRocket, FGTurbine, and FGTurboProp.

Definition at line 166 of file FGEngine.cpp.

{
  FuelFlowRate = SLFuelFlowMax*PctPower;
  FuelExpended = FuelFlowRate*in.TotalDeltaT;
  if (!Starved) FuelUsedLbs += FuelExpended;
  return FuelExpended;
}
virtual void Calculate ( void  ) [pure virtual]

Member Data Documentation

This function should be called from within the derived class' Calculate() function before any other calculations are done. This base class method removes fuel from the fuel tanks as appropriate, and sets the starved flag if necessary. * / virtual void ConsumeFuel(void);

Definition at line 232 of file FGEngine.h.

Referenced by FGElectric::FGElectric(), FGPiston::FGPiston(), and FGRocket::FGRocket().


The documentation for this class was generated from the following files: