Sync. with JSBSim CVS
This commit is contained in:
parent
836aabae69
commit
7283e506b2
6 changed files with 66 additions and 34 deletions
|
@ -138,6 +138,9 @@ Element::Element(string nm)
|
|||
// Fuel Consumption
|
||||
convert["LBS/HP*HR"]["KG/KW*HR"] = 0.6083;
|
||||
convert["KG/KW*HR"]["LBS/HP*HR"] = 1.0/convert["LBS/HP*HR"]["KG/KW*HR"];
|
||||
// Density
|
||||
convert["KG/L"]["LBS/GAL"] = 8.3454045;
|
||||
convert["LBS/GAL"]["KG/L"] = 1.0/convert["KG/L"]["LBS/GAL"];
|
||||
|
||||
// Length
|
||||
convert["M"]["M"] = 1.00;
|
||||
|
@ -200,6 +203,9 @@ Element::Element(string nm)
|
|||
// Fuel Consumption
|
||||
convert["LBS/HP*HR"]["LBS/HP*HR"] = 1.0;
|
||||
convert["KG/KW*HR"]["KG/KW*HR"] = 1.0;
|
||||
// Density
|
||||
convert["KG/L"]["KG/L"] = 1.0;
|
||||
convert["LBS/GAL"]["LBS/GAL"] = 1.0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -92,6 +92,7 @@ CLASS DOCUMENTATION
|
|||
- convert["KG/MIN"]["LBS/MIN"] = convert["KG"]["LBS"];
|
||||
- convert["LBS/HP*HR"]["KG/KW*HR"] = 0.6083;
|
||||
- convert["KG/KW*HR"]["LBS/HP*HR"] = 1/convert["LBS/HP*HR"]["KG/KW*HR"];
|
||||
- convert["KG/L"]["LBS/GAL"] = 8.3454045;
|
||||
|
||||
- convert["M"]["M"] = 1.00;
|
||||
- convert["FT"]["FT"] = 1.00;
|
||||
|
@ -119,6 +120,8 @@ CLASS DOCUMENTATION
|
|||
- convert["LBS/MIN"]["LBS/MIN"] = 1.0;
|
||||
- convert["LBS/HP*HR"]["LBS/HP*HR"] = 1.0;
|
||||
- convert["KG/KW*HR"]["KG/KW*HR"] = 1.0;
|
||||
- convert["KG/L"]["KG/L"] = 1.0;
|
||||
- convert["LBS/GAL"]["LBS/GAL"] = 1.0;
|
||||
|
||||
Where:
|
||||
- N = newtons
|
||||
|
@ -136,6 +139,8 @@ CLASS DOCUMENTATION
|
|||
- WATTS = watts
|
||||
- HP = horsepower
|
||||
- HR = hour
|
||||
- L = liter
|
||||
- GAL = gallon (U.S. liquid)
|
||||
|
||||
@author Jon S. Berndt
|
||||
@version $Id$
|
||||
|
|
|
@ -65,7 +65,8 @@ CLASS IMPLEMENTATION
|
|||
|
||||
FGLGear::FGLGear(Element* el, FGFDMExec* fdmex, int number) :
|
||||
FGForce(fdmex),
|
||||
GearNumber(number)
|
||||
GearNumber(number),
|
||||
SteerAngle(0.0)
|
||||
{
|
||||
Element *force_table=0;
|
||||
Element *dampCoeff=0;
|
||||
|
@ -397,6 +398,8 @@ FGColumnVector3& FGLGear::GetBodyForces(void)
|
|||
WOW = false;
|
||||
compressLength = 0.0;
|
||||
compressSpeed = 0.0;
|
||||
WheelSlip = 0.0;
|
||||
StrutForce = 0.0;
|
||||
|
||||
// Let wheel spin down slowly
|
||||
vWhlVelVec(eX) -= 13.0*dT;
|
||||
|
|
|
@ -184,42 +184,38 @@ void FGEngine::ConsumeFuel(void)
|
|||
FuelToBurn = CalcFuelNeed();
|
||||
if (FuelToBurn == 0.0) return;
|
||||
|
||||
while (FuelToBurn > 0.0) {
|
||||
|
||||
// Count how many fuel tanks with the current priority level have fuel.
|
||||
// If none, then try next lower priority. Build the feed list.
|
||||
while ((TanksWithFuel == 0) && (CurrentPriority <= Propulsion->GetNumTanks())) {
|
||||
for (i=0; i<Propulsion->GetNumTanks(); i++) {
|
||||
if (SourceTanks[i] != 0) {
|
||||
Tank = Propulsion->GetTank(i);
|
||||
if (Tank->GetType() == FGTank::ttFUEL) {
|
||||
if ((Tank->GetContents() > 0.0) && ((unsigned int)Tank->GetPriority() == CurrentPriority)) {
|
||||
++TanksWithFuel;
|
||||
FeedList.push_back(i);
|
||||
}
|
||||
} else {
|
||||
cerr << "No oxidizer tanks should be used for this engine type." << endl;
|
||||
}
|
||||
// Count how many fuel tanks with the current priority level have fuel.
|
||||
// If none, then try next lower priority. Build the feed list.
|
||||
while ((TanksWithFuel == 0) && (CurrentPriority <= Propulsion->GetNumTanks())) {
|
||||
for (i=0; i<Propulsion->GetNumTanks(); i++) {
|
||||
if (SourceTanks[i] != 0) {
|
||||
Tank = Propulsion->GetTank(i);
|
||||
if (Tank->GetType() == FGTank::ttFUEL) {
|
||||
if ((Tank->GetContents() > 0.0) && ((unsigned int)Tank->GetPriority() == CurrentPriority)) {
|
||||
++TanksWithFuel;
|
||||
FeedList.push_back(i);
|
||||
}
|
||||
} else {
|
||||
cerr << "No oxidizer tanks should be used for this engine type." << endl;
|
||||
}
|
||||
}
|
||||
if (TanksWithFuel == 0) CurrentPriority++;
|
||||
}
|
||||
if (TanksWithFuel == 0) CurrentPriority++;
|
||||
}
|
||||
|
||||
// No fuel found at any priority!
|
||||
if (TanksWithFuel == 0) {
|
||||
Starved = true;
|
||||
return;
|
||||
}
|
||||
// No fuel found at any priority!
|
||||
if (TanksWithFuel == 0) {
|
||||
Starved = true;
|
||||
return;
|
||||
}
|
||||
|
||||
// Remove equal amount of fuel from each feed tank.
|
||||
FuelNeeded = FuelToBurn/TanksWithFuel;
|
||||
for (i=0; i<FeedList.size(); i++) {
|
||||
Tank = Propulsion->GetTank(FeedList[i]);
|
||||
Tank->Drain(FuelNeeded);
|
||||
}
|
||||
|
||||
// Remove equal amount of fuel from each feed tank.
|
||||
FuelNeeded = FuelToBurn/TanksWithFuel;
|
||||
for (i=0; i<FeedList.size(); i++) {
|
||||
Tank = Propulsion->GetTank(FeedList[i]);
|
||||
Tank->Drain(FuelNeeded);
|
||||
FuelToBurn -= FuelNeeded;
|
||||
}
|
||||
|
||||
} // while
|
||||
}
|
||||
|
||||
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
|
|
@ -59,7 +59,8 @@ FGTank::FGTank(FGFDMExec* exec, Element* el, int tank_number)
|
|||
Element* element;
|
||||
Element* element_Grain;
|
||||
Area = 1.0;
|
||||
Temperature = -9999.0;
|
||||
Density = 6.6;
|
||||
InitialTemperature = Temperature = -9999.0;
|
||||
Ixx = Iyy = Izz = 0.0;
|
||||
Radius = Contents = Standpipe = Length = InnerRadius = 0.0;
|
||||
Capacity = 0.00001;
|
||||
|
@ -96,6 +97,8 @@ FGTank::FGTank(FGFDMExec* exec, Element* el, int tank_number)
|
|||
InitialStandpipe = Standpipe = el->FindElementValueAsNumberConvertTo("standpipe", "LBS");
|
||||
if (el->FindElement("priority"))
|
||||
InitialPriority = Priority = el->FindElementValueAsNumber("priority");
|
||||
if (el->FindElement("density"))
|
||||
Density = el->FindElementValueAsNumberConvertTo("density", "LBS/GAL");
|
||||
|
||||
SetPriority( InitialPriority ); // this will also set the Selected flag
|
||||
|
||||
|
@ -206,7 +209,6 @@ double FGTank::Drain(double used)
|
|||
|
||||
Contents = 0.0;
|
||||
PctFull = 0.0;
|
||||
SetPriority(0);
|
||||
}
|
||||
|
||||
if (grainType != gtUNKNOWN) CalculateInertias();
|
||||
|
@ -245,6 +247,14 @@ void FGTank::SetContents(double amount)
|
|||
}
|
||||
}
|
||||
|
||||
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
void FGTank::SetContentsGallons(double gallons)
|
||||
{
|
||||
SetContents(gallons * Density);
|
||||
}
|
||||
|
||||
|
||||
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
double FGTank::Calculate(double dt)
|
||||
|
|
|
@ -128,6 +128,7 @@ CLASS DOCUMENTATION
|
|||
<temperature> {number} </temperature> <!-- must be degrees fahrenheit -->
|
||||
<standpipe unit="{LBS | KG"}> {number} </standpipe>
|
||||
<priority> {integer} </priority>
|
||||
<density unit="{KG/L | LBS/GAL}"> {number} </density>
|
||||
</tank>
|
||||
@endcode
|
||||
|
||||
|
@ -142,6 +143,7 @@ CLASS DOCUMENTATION
|
|||
- \b temperature - Initial temperature, defaults to degrees Fahrenheit.
|
||||
- \b standpipe - Minimum contents to which tank can dump, defaults to pounds.
|
||||
- \b priority - Establishes feed sequence of tank. "1" is the highest priority.
|
||||
- \b density - Density of liquid tank contents.
|
||||
|
||||
location:
|
||||
- \b x - Location of tank on aircraft's x-axis, defaults to inches.
|
||||
|
@ -167,6 +169,7 @@ be printed to the console if the location is not given
|
|||
- \b temperature - -9999.0 (flag which indicates no temperature is set)
|
||||
- \b standpipe - 0.0 (all contents may be dumped)
|
||||
- \b priority - 1 (highest feed sequence priority)
|
||||
- \b density - 6.6
|
||||
|
||||
@author Jon Berndt, Dave Culp
|
||||
@see Akbar, Raza et al. "A Simple Analysis of Fuel Addition to the CWT of
|
||||
|
@ -226,10 +229,18 @@ public:
|
|||
@return the capacity of the tank in pounds. */
|
||||
double GetCapacity(void) {return Capacity;}
|
||||
|
||||
/** Gets the capacity of the tank.
|
||||
@return the capacity of the tank in gallons. */
|
||||
double GetCapacityGallons(void) {return Capacity/Density;}
|
||||
|
||||
/** Gets the contents of the tank.
|
||||
@return the contents of the tank in pounds. */
|
||||
double GetContents(void) const {return Contents;}
|
||||
|
||||
/** Gets the contents of the tank.
|
||||
@return the contents of the tank in gallons. */
|
||||
double GetContentsGallons(void) const {return Contents/Density;}
|
||||
|
||||
/** Gets the temperature of the fuel.
|
||||
The temperature of the fuel is calculated if an initial tempearture is
|
||||
given in the configuration file.
|
||||
|
@ -258,6 +269,7 @@ public:
|
|||
|
||||
double Fill(double amount);
|
||||
void SetContents(double amount);
|
||||
void SetContentsGallons(double gallons);
|
||||
void SetTemperature(double temp) { Temperature = temp; }
|
||||
void SetStandpipe(double amount) { Standpipe = amount; }
|
||||
void SetSelected(bool sel) { sel==true ? SetPriority(1):SetPriority(0); }
|
||||
|
|
Loading…
Add table
Reference in a new issue