• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

FS2004 [SOLVED] Complex Custom Fuel System

Messages
228
Country
us-kentucky
Hello all,

The fuel system of the 747 classic is quite complicated. I have devised my own fuel flow formula that works exactly according to the charts I have for the Boeing 747 from a JT9D maintenance manual. The hard part is now making the fuel system work from the correct tanks.

I have a good understanding of DD's Fuel Dump gauge, and I have verified a couple of configurations. I successfully have the tip reserve tanks emptying into the mains correctly, as an example. However, I am really wracking my brain for a simpler way to write this, without using dozens of if els statements if possible.

Here's how the system works:

There are 7 tanks on the 747, from left to right looking forward:

Tip Reserve 1
Main 1
Main 2
Center Wing
Main 3
Main 4
Tip Reserve 4

Tip tanks do not directly feed engines. They can only be emptied into their adjacent main tank (1 or 4). Any main tank can be used to feed its respective engine. The center tank can feed all engines provided the crossfeeds are open and their respect pumps are off. If any main tank pump is on, the corresponding engine will feed from that tank no exceptions. If any tank has both pumps active, there is enough fuel pressure to power 3 engines, but not all 4 from a single tanks pumps.

Any ideas? If it has to be long and complex I will do it - but I'd like to save the effort if there's a potentially easier way.

Thanks!
 
Messages
228
Country
us-kentucky
I came up with a system of pseudo fuel selectors for each engine. It's still complex, but far less complex than I was envisioning. It isn't finished and I think I am stuck figuring out how to actually manipulate the fuel.

Each engine has 32 combinations of tanks it can draw from based on pump and valve configuration. I have the system set up such that each one of the conditions has its own numerical value when met, sort of like the default FS fuel selector gauge.

I am now writing the part where fuel is actually consumed by the engines according to the selector positions. I am attempting to write the system such that every combination will simply add the corresponding engine's fuel flow to a fuel flow dummy variable, and then that variable's total is how much fuel that tank consumes.

As an example...

XML:
            (L:ENG 1 Pseudo Fuel Selector, number) 8 ==
            if{
            (L:ENG1 FF, number) 2 / (L:Tank 1 Fuel Flow Dummy, number) + (>L:Tank 1 Fuel Flow Dummy, number)
            (L:ENG1 FF, number) 2 / (L:Tank 4 Fuel Flow Dummy, number) + (>L:Tank 4 Fuel Flow Dummy, number)
            }

In this situation, Engine 1 is drawing fuel from both tank 1 and tank 4, so I want to take Engine 1's fuel flow, divide it by two, and then add that to the total fuel flow dummy variable for each tank it is drawing from. I am finding that this doesn't work, and instead the result I get is that the fuel flow gets added over and over every gauge cycle and sky rockets.

I think I understand why this is happening, and I'm fairly sure the solution is similar to the thread I made about incrementing numbers by values other than 1, but I am wracking my brain again and cannot figure what the solution would be...
 
Last edited:
Messages
913
Country
indonesia
Hello all,

The fuel system of the 747 classic is quite complicated. I have devised my own fuel flow formula that works exactly according to the charts I have for the Boeing 747 from a JT9D maintenance manual. The hard part is now making the fuel system work from the correct tanks.

I have a good understanding of DD's Fuel Dump gauge, and I have verified a couple of configurations. I successfully have the tip reserve tanks emptying into the mains correctly, as an example. However, I am really wracking my brain for a simpler way to write this, without using dozens of if els statements if possible.

Here's how the system works:

There are 7 tanks on the 747, from left to right looking forward:

Tip Reserve 1
Main 1
Main 2
Center Wing
Main 3
Main 4
Tip Reserve 4

Tip tanks do not directly feed engines. They can only be emptied into their adjacent main tank (1 or 4). Any main tank can be used to feed its respective engine. The center tank can feed all engines provided the crossfeeds are open and their respect pumps are off. If any main tank pump is on, the corresponding engine will feed from that tank no exceptions. If any tank has both pumps active, there is enough fuel pressure to power 3 engines, but not all 4 from a single tanks pumps.

Any ideas? If it has to be long and complex I will do it - but I'd like to save the effort if there's a potentially easier way.

Thanks!
I have done fuel system using 9 fuel tanks as fuel feeder and balancing for Tu144D. but it using SimConnect and C++.
 
Last edited:
Messages
22
Country
germany
Code:
(L:TANK X FUEL FLOW DUMMY,number) (L:ENGX FF,number) 2 / + (>L:TANK X FUEL FLOW DUMMY,number)

Hello,
Try this, could work!
 
Messages
228
Country
us-kentucky
Code:
(L:TANK X FUEL FLOW DUMMY,number) (L:ENGX FF,number) 2 / + (>L:TANK X FUEL FLOW DUMMY,number)

Hello,
Try this, could work!

Unfortunately this gives the same result as above. Appreciate the input though!
 
Messages
258
Country
ireland
It seems that you are calculating the new Fuel Flow every cycle. Is the fuel flow supposed to be in pounds per hour? If so then the fuel flow per cycle would have to be calculated, ie the flow per hour divided by 60 for a minute, then divided by 60 for a second and then divided by 18 for a cycle (or divided by 64800). Perhaps?
 
Messages
228
Country
us-kentucky
It seems that you are calculating the new Fuel Flow every cycle. Is the fuel flow supposed to be in pounds per hour? If so then the fuel flow per cycle would have to be calculated, ie the flow per hour divided by 60 for a minute, then divided by 60 for a second and then divided by 18 for a cycle (or divided by 64800). Perhaps?

I am not quite sure how to factor this in to the equation.

To explain very simply, my example above will add Engine 1 fuel flow in pounds per hour to the current Fuel Flow dummy variable, then write that new value to the dummy variable. This dummy variable is what I am using to control the total fuel dump rate of each tank. The problem is that the engine fuel flow gets added once every cycle rather than just once.
 
Messages
258
Country
ireland
I think that I would have to understand the fuel dump system - how often it is to be called, how long does it last, how quickly changeable the fuel dump rate is. Using your code above it is relatively easy to calculate what the current fuel usage from each tank is per cycle - but then can the dump rate be controlled to that same degree? Can the fuel dump be set to a different rate each cycle?
 
Messages
228
Country
us-kentucky
I think that I would have to understand the fuel dump system - how often it is to be called, how long does it last, how quickly changeable the fuel dump rate is. Using your code above it is relatively easy to calculate what the current fuel usage from each tank is per cycle - but then can the dump rate be controlled to that same degree? Can the fuel dump be set to a different rate each cycle?

The dump rate is controlled by Doug Dawson's fuel dumping gauge, wherein you can set any variable or number as the dump rate for any tank when the conditionals are met. For example, the above condition requires that tanks 1 and 4 have pumps on and their crossfeeds open. When that condition is met, I can set the ENG1 fuel flow rate calculated from my own gauges as the dump rate for the tank, and divide that value however I want based on how many tanks are feeding engine one. The rate can be set to any number or dynamic variable.
 
Messages
1,564
Country
thailand
Hello Chris,

A request - would you kindly add the FS2004 prefix to your posts? That context is important.

The problem is that the engine fuel flow gets added once every cycle rather than just once. Is this not a similar issue to your Current Electrical Load question?

(L:Current Electrical Load, amps) 40 + (>L:Current Electrical Load, amps)
Then the gauge adds 40 to the L:var at every update cycle, 40*18 per second = way more than I want very quickly!


If so, then try Roman's solution in that thread.

Bob
 
Messages
22
Country
germany
Right, i think this is what Baiter One means with the 64800! For the one second and interval (3600 x18)

If I understand you correctly, a tank variable counts the fuel consumption, as long as an engine is fed by it!
If there are several tanks, the fuel flow of an engine is divided by the number of tanks that are currently in use!
Maybe something like this?!
(The A: variable is from FSX!)

Code:
<Element>
  <Select>
    <Value>
        (A:ENG1 FUEL FLOW PPH, pounds per hour) 64800 / (>L:ENG1 FF,number)

        (L:ENG 1 Pseudo Fuel Selector, number) 8 == if{
        (L:TANK 1 FUEL FLOW DUMMY,number) (L:ENG1 FF,number) 2 / + (>L:TANK 1 FUEL FLOW DUMMY,number)
        (L:TANK 4 FUEL FLOW DUMMY,number) (L:ENG1 FF,number) 2 / + (>L:TANK 4 FUEL FLOW DUMMY,number) }
    </Value>
  </Select>
</Element>
 
Messages
22
Country
germany
Or without counting....

Code:
<Element>
  <Select>
    <Value>
        (A:ENG1 FUEL FLOW PPH, pounds per hour) 64800 / (>L:ENG1 FF,number)

        (L:ENG 1 Pseudo Fuel Selector, number) 8 == if{
        (L:ENG1 FF,number) 2 / (>L:TANK 1 FUEL FLOW DUMMY,number)
        (L:ENG1 FF,number) 2 / (>L:TANK 4 FUEL FLOW DUMMY,number) }
    </Value>
  </Select>
</Element>
 
Messages
258
Country
ireland
Chris,

I believe that the code used for this is probably going to be quite basic, but repetitive.

I must admit, if I was you, I would concentrate on making sure that the whole idea will work first.

if you have already done the bit below then there is great hope for it working overall.

I would take one engine, using one main fuel tank, then in the one fuel usage gauge, calculate the amount of fuel used in one cycle from that tank for that engine, and in that same cycle, use Doug's gauge to empty that tank by that same amount.

All of this can be done on the ground, without engines at all, just feed in the any rate you wish and see if the tank empties of that amount immediately and continuously.

Because of the small amounts involved per cycle I don't believe that you could use the fuel gauges to spot the usage, you would have to display the numbers somewhere.

If the above test works out, I would then expand it out to all four engines, using their own main tanks with different rates of usage, and see do the tanks empty correctly.

Only if all this works is it worth getting involved in crossfeeds and filling tanks from other tanks.

Walter
 
Messages
1,564
Country
thailand
Right, i think this is what Baiter One means with the 64800! For the one second and interval (3600 x18)

Well, it is the same general type of problem, but Roman's and Walter's solutions are different.
 
Messages
228
Country
us-kentucky
Hello Chris,

A request - would you kindly add the FS2004 prefix to your posts? That context is important.

The problem is that the engine fuel flow gets added once every cycle rather than just once. Is this not a similar issue to your Current Electrical Load question?

(L:Current Electrical Load, amps) 40 + (>L:Current Electrical Load, amps)
Then the gauge adds 40 to the L:var at every update cycle, 40*18 per second = way more than I want very quickly!


If so, then try Roman's solution in that thread.

Bob

Will do - Sorry!

Also, I have been thinking about this idea but I cannot figure out how to implement it. I have an idea that I am going to test today, so stay tuned...

Right, i think this is what Baiter One means with the 64800! For the one second and interval (3600 x18)

Unfortunately both of these result in the same issue as before but at a much slower rate. The fuel flow rate goes up every cycle regardless of actually engine fuel flow.

Chris,

I believe that the code used for this is probably going to be quite basic, but repetitive.

I must admit, if I was you, I would concentrate on making sure that the whole idea will work first.

if you have already done the bit below then there is great hope for it working overall.

I would take one engine, using one main fuel tank, then in the one fuel usage gauge, calculate the amount of fuel used in one cycle from that tank for that engine, and in that same cycle, use Doug's gauge to empty that tank by that same amount.

All of this can be done on the ground, without engines at all, just feed in the any rate you wish and see if the tank empties of that amount immediately and continuously.

Because of the small amounts involved per cycle I don't believe that you could use the fuel gauges to spot the usage, you would have to display the numbers somewhere.

If the above test works out, I would then expand it out to all four engines, using their own main tanks with different rates of usage, and see do the tanks empty correctly.

Only if all this works is it worth getting involved in crossfeeds and filling tanks from other tanks.

Walter

I will come back to this one after I've had a chance to test another idea I've had. This does sound promising though!

Thank you all for the input so far!
 

Roy Holmes

Resource contributor
Messages
1,803
Country
us-virginia
I think you could do this just using the standard fuel delivery system and naming the tanks appropriately.
For instance you say "Tip tanks do not directly feed engines. They can only be emptied into their adjacent main tank (1 or 4)." That means the contents of the tip tanks go down and the main tank contents stay full until the tips are empty. So feed the tips first to the engines, the result is the same.
"The center tank can feed all engines provided the crossfeeds are open" so set the fuel selector to Center when you want it to feed.
Without any code the tanks feed as follows
External call your tips External 1 and 2
Aux, call the center tank this.
Mains use Mains for the engines with number of fuel selectors =4 in the aircraft.cfg

I believe all that would achieve what you want and you would not have any fuss with fuel burn rates.
Roy
 
Messages
228
Country
us-kentucky
I think you could do this just using the standard fuel delivery system and naming the tanks appropriately.
For instance you say "Tip tanks do not directly feed engines. They can only be emptied into their adjacent main tank (1 or 4)." That means the contents of the tip tanks go down and the main tank contents stay full until the tips are empty. So feed the tips first to the engines, the result is the same.
"The center tank can feed all engines provided the crossfeeds are open" so set the fuel selector to Center when you want it to feed.
Without any code the tanks feed as follows
External call your tips External 1 and 2
Aux, call the center tank this.
Mains use Mains for the engines with number of fuel selectors =4 in the aircraft.cfg

I believe all that would achieve what you want and you would not have any fuss with fuel burn rates.
Roy

This is a great idea if I wasn't using my own custom fuel burn system. My fuel flow scalar in FS is set to 0.

Also, the tips cannot feed the engines. They are gravity fed into the main tanks and cannot supply enough fuel pressure on their own to feed the engines, plus they have no direct link to the engines, so I would still need to have tanks 1 and 4 at least pumping in order for that to work with my current setup.

Here is a link to B747-400 fuel schema

https://www.avsoft.com/product/boeing-b747-400-system-diagrams/

And here a general google search B747-400 fuel system.

https://www.google.at/search?q=b747...g&ei=CKg6X8vIM8ftkgWxwIfwDw&bih=1157&biw=2261

It's up to you... what you want.

Thanks for the links! Some good visuals, though I have most of this information in the form of TWA and Pan Am manuals. I understand how the system works, the problem was mostly one of writing programming logic...

Speaking of, I think I have it done, except for a minor bug that I cannot seem to figure out.

I came up with a system similar to what Roman helped me work out in this post:

It works exactly as needed in every condition except for two...

In the condition where all tanks (all 4 mains and center) are feeding all engines, or the condition where just the 4 mains are feeding, the fuel flow rates are doubled on three of the engines and I cannot figure out why. Tank 4 fuel rate is correct in both situations, but the other 3 tanks are consuming double the required fuel.

Here is all the relevant code. Many of these are just snippets so keep that in mind when looking over the syntax:

XML:
<!-- This section sets up the total fuel flow rate for the conditions below -->
(L:ENG1 FF, number) (L:ENG2 FF, number) + (L:ENG3 FF, number) + (L:ENG4 FF, number) + (>L:Total Fuel Flow, number)

<!-- This section sets up the total fuel flow rate for the conditions below, divided by the number of tanks in use, and stores them -->
        (L:Total Fuel Flow, number) 5 / s20
        (L:Total Fuel Flow, number) 4 / s21

<!-- All 4 mains and center feeding engine 1 -->      
(L:ENG 1 Pseudo Fuel Selector, number) 1 ==
        if{
        l20 (>L:Tank 1 Fuel Flow ENG1, number)
        l20 4 / (>L:Center Fuel Flow ENG1, number)
        }
        els{
<!-- All 4 mains feeding engine 1 -->
(L:ENG 1 Pseudo Fuel Selector, number) 2 ==
        if{ l21 (>L:Tank 1 Fuel Flow ENG1, number) }
        els{

<!-- All 4 mains and center feeding engine 2-->      
(L:ENG 2 Pseudo Fuel Selector, number) 1 ==
        if{
        l20 (>L:Tank 2 Fuel Flow ENG2, number)
        l20 4 / (>L:Center Fuel Flow ENG2, number)
        }
        els{
<!-- All 4 mains feeding engine 2-->
(L:ENG 2 Pseudo Fuel Selector, number) 2 ==
        if{ l21 (>L:Tank 2 Fuel Flow ENG2, number) }
        els{

<!-- All 4 mains and center feeding engine 3-->      
(L:ENG 3 Pseudo Fuel Selector, number) 1 ==
        if{
        l20 (>L:Tank 3 Fuel Flow ENG3, number)
        l20 4 / (>L:Center Fuel Flow ENG3, number)
        }
        els{
<!-- All 4 mains feeding engine 3-->
(L:ENG 3 Pseudo Fuel Selector, number) 2 ==
        if{ l21 (>L:Tank 3 Fuel Flow ENG3, number) }
        els{


<!-- All 4 mains and center feeding -->      
(L:ENG 4 Pseudo Fuel Selector, number) 1 ==
        if{
        l20 (>L:Tank 4 Fuel Flow ENG4, number)
        l20 4 / (>L:Center Fuel Flow ENG4, number)
        }
        els{
<!-- All 4 mains feeding -->
(L:ENG 4 Pseudo Fuel Selector, number) 2 ==
        if{ l21 (>L:Tank 4 Fuel Flow ENG4, number) }
        els{

    <!--Center Draw Rate-->
    <Element>
        <Select>
            <Value>
            (L:Center Fuel Flow ENG1, number) (L:Center Fuel Flow ENG2, number) + (L:Center Fuel Flow ENG3, number) + (L:Center Fuel Flow ENG4, number) + (>L:Center Fuel Flow Dummy, number)
            (L:Center Fuel Flow Dummy, number) (>L:RATE_TANK_CENTER,number)
            </Value>
        </Select>
    </Element>
    <!--Main 1 Draw Rate-->
    <Element>
        <Select>
            <Value>
            (L:Tank 1 Fuel Flow ENG1, number) (L:Tank 1 Fuel Flow ENG2, number) + (L:Tank 1 Fuel Flow ENG3, number) + (L:Tank 1 Fuel Flow ENG4, number) + (L:Fuel Transfer Res 1, number) + (>L:Main Tank 1 Fuel Flow, number)
            (L:Main Tank 1 Fuel Flow, number) (>L:RATE_TANK_MAIN_LEFT,number)
            </Value>
        </Select>
    </Element>
    <!--Main 2 Draw Rate-->
    <Element>
        <Select>
            <Value>
            (L:Tank 2 Fuel Flow ENG1, number) (L:Tank 2 Fuel Flow ENG2, number) + (L:Tank 2 Fuel Flow ENG3, number) + (L:Tank 2 Fuel Flow ENG4, number) + (>L:Main Tank 2 Fuel Flow, number)
            (L:Main Tank 2 Fuel Flow, number) (>L:RATE_TANK_AUX_LEFT,number)
            </Value>
        </Select>
    </Element>
    <!--Main 3 Draw Rate-->
    <Element>
        <Select>
            <Value>
            (L:Tank 3 Fuel Flow ENG1, number) (L:Tank 3 Fuel Flow ENG2, number) + (L:Tank 3 Fuel Flow ENG3, number) + (L:Tank 3 Fuel Flow ENG4, number) + (>L:Main Tank 3 Fuel Flow, number)
            (L:Main Tank 3 Fuel Flow, number) (>L:RATE_TANK_AUX_RIGHT,number)
            </Value>
        </Select>
    </Element>
    <!--Main 4 Draw Rate-->
    <Element>
        <Select>
            <Value>
            (L:Tank 4 Fuel Flow ENG1, number) (L:Tank 4 Fuel Flow ENG2, number) + (L:Tank 4 Fuel Flow ENG3, number) + (L:Tank 4 Fuel Flow ENG4, number) + (L:Fuel Transfer Res 4, number) + (>L:Main Tank 4 Fuel Flow, number)
            (L:Main Tank 4 Fuel Flow, number) (>L:RATE_TANK_MAIN_RIGHT,number)
            </Value>
        </Select>
    </Element>
 
Last edited:
Messages
495
Country
austria
So you do not simulate valves, check valves, pumps, override pumps. And no supply of the pumps and values with electrical power.

And you have a lot of open "els{"

Have you a description of fuel management?
 
Top