Re: [Flightgear-devel] Fg Fuel System Changes

2012-10-22 Thread Jon S. Berndt
Here’s an overview of the fuel system from the perspective of a user – not a 
developer, but maybe it helps.

 

Do you need the API documentation? Try here for a start: 

 

http://jsbsim.sourceforge.net/JSBSim/classJSBSim_1_1FGTank.html

 

Jon

 

 

 

Here's an overview of the fuel handling in JSBSim now.

 

At load-time the propulsion system (FGPropulsion) reads the configuration file 
and builds a list of engines and a list of tanks.

 

Each engine creates a list of feed tanks using the  tag.  This list is 
only created at load-time, but in the future I'd like to see run-time control 
over this list.  The list is owned by each FGEngine and is called SourceTanks.  
The list is the same size as the number of tanks, and each list item 
corresponds to a tank.  At load-time each list member is set to zero, and when 
a  tag is encountered the list member corresponding to that tank is set 
to non-zero.  The engine will only feed from tanks that have a non-zero value 
in SourceTanks.  The non-zero value happens to be equal to the tank's priority, 
but it's only treated as a non-zero in the ConsumeFuel() algorithm.  It could 
just as well be zeroes and ones.  This is, in effect, a map of all the tanks, 
representing which ones are allowed to feed this engine.  The trick in making 
this run-time modifiable will be to decide on a scheme to allow one property to 
modify this map. 

 

Each tank has a priority value, with 1 being the highest priority.  The 

default value is 1.   The priority is an attribute owned by the tank, and 

it's exposed to the property tree, so the priority can be changed at run-time.  
Since the priority is owned by the tank, this means that all engines will see 
the same priority from a given tank.  Setting the priority to zero is like 
closing a valve "at the tank".  So far this is the only valve you have control 
over in the fuel system.  

 

The SourceTanks list, belonging to each engine, can be thought of as a set of 
valves too.  Each engine is connected to all tanks, but a valve "at the engine" 
is closed for each list member with a value of zero.

 

When refueling is activated (by setting the property "propulsion/refuel" to 1 
or true) fuel is added at the same rate to ALL tanks at a total transfer rate 
of 6000 lbs per minute, hardcoded.  This code presently ignores tank priority.  
It also ignores what fluid is supposed to be in a particular tank, so don't use 
this with a rocket.  The refuel code could use some work.

 

When dumping fuel (by setting the property "propulsion/fuel_dump" to 1 or

true)  fuel is removed from ALL tanks down to any standpipe level previously 
defined at load-time for each tank.  The dump rate is defined at load-time, and 
is the rate for the entire fuel system.  This code ignores tank priority.  

If no standpipe is defined, all fuel will be dumped.  Default dump rate is zero.

 

Total fuel quantity is calculated in FGPropulsion::Run() and written to the 
property "propulsion/total-fuel-lbs".

 

Fuel temperature is calculated in FGTank::Calculate(), but only for tanks that 
had an initial temperature defined at load-time.

 

Fuel quantity is always measured by weight.  There is no method in the code for 
conversion to volume, and there is no tracking of fuel density.  FGPiston does 
provide a gal/hr output, and uses 6.0 lb/gal as the conversion factor.  

FlightGear manipulates the JSBSim tank quantities by converting gallons to 
pounds in JSBSim.cxx, using a conversion factor of 6.6 lb/gal.

 

Dave

 

 

From: Jon S. Berndt [mailto:jonsber...@comcast.net] 
Sent: Monday, October 22, 2012 7:27 PM
To: 'FlightGear developers discussions'
Subject: Re: [Flightgear-devel] Fg Fuel System Changes

 

John,

 

Yes, there were some changes. I’ll try to help out soon, but am limited on time 
at the moment. You might search the JSBSim mailing list for the “tank priority” 
terms. 

 

Briefly, as I recall, there is now a “priority” element, with priority “1” 
being the highest. I forget if “0” means anything. Any tank with the same 
priority provides fuel until all tanks of the same priority are empty. Then, 
the next priority tanks are used (1, then 2, then …).

 

The “new” tank system was introduced by one of our developers who is also an 
airline pilot. Unfortunately, I don’t think that the features is widely used, 
yet – at least in models in the JSBSim repository. I’m using it in one vehicle 
model now, but can’t share that.

 

I hope this helps. You might try cross-posting to the JSBSim developer list, 
too. Let me know if you need more help.

 

Jon

--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/list

Re: [Flightgear-devel] Fg Fuel System Changes

2012-10-22 Thread Jon S. Berndt
John,

 

Yes, there were some changes. I’ll try to help out soon, but am limited on time 
at the moment. You might search the JSBSim mailing list for the “tank priority” 
terms. 

 

Briefly, as I recall, there is now a “priority” element, with priority “1” 
being the highest. I forget if “0” means anything. Any tank with the same 
priority provides fuel until all tanks of the same priority are empty. Then, 
the next priority tanks are used (1, then 2, then …).

 

The “new” tank system was introduced by one of our developers who is also an 
airline pilot. Unfortunately, I don’t think that the features is widely used, 
yet – at least in models in the JSBSim repository. I’m using it in one vehicle 
model now, but can’t share that.

 

I hope this helps. You might try cross-posting to the JSBSim developer list, 
too. Let me know if you need more help.

 

Jon

 

 

From: castle...@comcast.net [mailto:castle...@comcast.net] 
Sent: Monday, October 22, 2012 10:41 AM
To: FlightGear developers discussions
Subject: [Flightgear-devel] Fg Fuel System Changes

 

HI,

Had been running with fg-2.4 for some time and finally getting around to 
upgrading to 2.8.  Seems there where some changes to the fuel and tanking 
system in JSBSiim starting with 2.6.  It "breaks" the mods made to the code to 
support the 737/747 full scale cockpits tanking models in 2.4 and prior.

In large aircraft such as the 7x7 types the fuel is NOT drawn equally from all 
tanks.  Rather, in terms of graph theory, you should think of the tanking 
system as a fully connected graph for the tanks, engines, and crossfeed valves. 
Such that any feed tank can feed any engine or all engines can draw from one 
feed tank.  The case where all tanks feed to a manifold that supplies all 
engines is just one special case.

At any rate, is there a writeup on the changes? Or might the author find some 
time to describe what was changed?

Having trouble understanding how to the "FuelExpended" variable to a specific 
tank and how to pass the tank contents onto the flightgear side.
Here is how it works in my 2.4:

this was the mod to the FGEngine::ConsumeFuel(void) in 2.4

   if ( Active_Tank >= 0 ) {
 Tank = Propulsion->GetTank(Active_Tank);
if (Tank->GetType() == FGTank::ttFUEL) {
   //Fshortage += Tank->Drain(CalcFuelNeed()/TanksWithFuel);  // SEE NOTE 
ABOVE
Fshortage += Tank->Drain(CalcFuelNeed() );
}
  } else Starved = true;

where "Active_Tank" was a value passed from the cockpit fuel control panel (via 
network controls) to fg and the fg/jsbsim interface in jsbsim.cpp.

and this was the code to transfer fuel in the 737 model to the center feed tank

  // Remove equal amount of fuel from each feed tank.  
//  FuelNeeded = FuelToBurn/TanksWithFuel;
//  for (i=0; iGetTank(FeedList[i]);
//Tank->Drain(FuelNeeded); 
//  }

Tank_0 = Propulsion->GetTank(0);
double center_fuel = Tank_0->GetContents();
if ( center_fuel < 6000.0 ) transfer = true;
else if ( center_fuel > 9000.0 ) transfer = false;
if ( transfer ) {
Tank_1 = Propulsion->GetTank(1);
if ( Tank_1->GetContents() > 100.0 ) {
Tank_0->Fill( 0.040 );
Tank_1->Drain( 0.040 );
}
Tank_2 = Propulsion->GetTank(2);
if ( Tank_2->GetContents() > 100.0 ) {
Tank_0->Fill( 0.0401 );
Tank_2->Drain( 0.0401 );
}
}

So setting Active_Tank=0 has both engines drawing from the center tank and when 
it drops below 6000# the fuel transfer system fills until it reaches 9000# or 
the pilot can select, via the fuel control panel, to feed each engine directly 
or crossfeed as desired.  Setting Active_Tank=-1 starves the engine.

The 747 is much more complex and, in the interest of brevity, is not discussed.

The entire function "ConsumeFuel" is removed and having some difficulty 
undestanding how "FuelExpended" is interfaced to draw down the tanks.

Any help would be apprecuated.

John

  _  

 

--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] YASim and documentation

2012-10-22 Thread Andy Ross
On 10/05/2012 05:53 AM, Vivian Meazza wrote:
> Andy is still around, but inactive. It might be possible to run stuff by him
> once in a while.

He even reads the mailing list (but not the forums) on occasion. :)

Indeed, I'm busy with other things these days, but am still broadly
happy to answer questions if posed (as long as I remember enough to
come up with a meaningful answer).  Just cc: me if you do, because my
latencies here are measured in weeks.

> But I would in general worry about mucking about with such a
> critical part of FG, unless I was very sure about what I was doing.

Bugs can always be fixed.  What YASim needs is a maintainer, not
really expertise per se.  The latter comes from the former.

Andy

--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


[Flightgear-devel] Fg Fuel System Changes

2012-10-22 Thread castle . 64

HI, 

Had been running with fg-2.4 for some time and finally getting around to 
upgrading to 2.8. Seems there where some changes to the fuel and tanking system 
in JSBSiim starting with 2.6. It "breaks" the mods made to the code to support 
the 737/747 full scale cockpits tanking models in 2.4 and prior. 

In large aircraft such as the 7x7 types the fuel is NOT drawn equally from all 
tanks. Rather, in terms of graph theory, you should think of the tanking system 
as a fully connected graph for the tanks, engines, and crossfeed valves. Such 
that any feed tank can feed any engine or all engines can draw from one feed 
tank. The case where all tanks feed to a manifold that supplies all engines is 
just one special case. 

At any rate, is there a writeup on the changes? Or might the author find some 
time to describe what was changed? 

Having trouble understanding how to the "FuelExpended" variable to a specific 
tank and how to pass the tank contents onto the flightgear side. 
Here is how it works in my 2.4: 

this was the mod to the FGEngine::ConsumeFuel(void) in 2.4 

if ( Active_Tank >= 0 ) { 
Tank = Propulsion->GetTank(Active_Tank); 
if (Tank->GetType() == FGTank::ttFUEL) { 
//Fshortage += Tank->Drain(CalcFuelNeed()/TanksWithFuel); // SEE NOTE ABOVE 
Fshortage += Tank->Drain(CalcFuelNeed() ); 
} 
} else Starved = true; 

where "Active_Tank" was a value passed from the cockpit fuel control panel (via 
network controls) to fg and the fg/jsbsim interface in jsbsim.cpp. 

and this was the code to transfer fuel in the 737 model to the center feed tank 

// Remove equal amount of fuel from each feed tank. 
// FuelNeeded = FuelToBurn/TanksWithFuel; 
// for (i=0; iGetTank(FeedList[i]); 
// Tank->Drain(FuelNeeded); 
// } 

Tank_0 = Propulsion->GetTank(0); 
double center_fuel = Tank_0->GetContents(); 
if ( center_fuel < 6000.0 ) transfer = true; 
else if ( center_fuel > 9000.0 ) transfer = false; 
if ( transfer ) { 
Tank_1 = Propulsion->GetTank(1); 
if ( Tank_1->GetContents() > 100.0 ) { 
Tank_0->Fill( 0.040 ); 
Tank_1->Drain( 0.040 ); 
} 
Tank_2 = Propulsion->GetTank(2); 
if ( Tank_2->GetContents() > 100.0 ) { 
Tank_0->Fill( 0.0401 ); 
Tank_2->Drain( 0.0401 ); 
} 
} 

So setting Active_Tank=0 has both engines drawing from the center tank and when 
it drops below 6000# the fuel transfer system fills until it reaches 9000# or 
the pilot can select, via the fuel control panel, to feed each engine directly 
or crossfeed as desired. Setting Active_Tank=-1 starves the engine. 

The 747 is much more complex and, in the interest of brevity, is not discussed. 

The entire function "ConsumeFuel" is removed and having some difficulty 
undestanding how "FuelExpended" is interfaced to draw down the tanks. 

Any help would be apprecuated. 

John 

- Original Message -

--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel