// 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;
// 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;
}
}
- 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;
- 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
- WATTS = watts
- HP = horsepower
- HR = hour
+ - L = liter
+ - GAL = gallon (U.S. liquid)
@author Jon S. Berndt
@version $Id$
FGLGear::FGLGear(Element* el, FGFDMExec* fdmex, int number) :
FGForce(fdmex),
- GearNumber(number)
+ GearNumber(number),
+ SteerAngle(0.0)
{
Element *force_table=0;
Element *dampCoeff=0;
WOW = false;
compressLength = 0.0;
compressSpeed = 0.0;
+ WheelSlip = 0.0;
+ StrutForce = 0.0;
// Let wheel spin down slowly
vWhlVelVec(eX) -= 13.0*dT;
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
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
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;
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
Contents = 0.0;
PctFull = 0.0;
- SetPriority(0);
}
if (grainType != gtUNKNOWN) CalculateInertias();
}
}
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+void FGTank::SetContentsGallons(double gallons)
+{
+ SetContents(gallons * Density);
+}
+
+
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
double FGTank::Calculate(double dt)
<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
- \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.
- \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
@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.
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); }