Jump to content

Fuel Flow Rules (0.24.2)


Kasuha

Recommended Posts

Common Error Example

This is example of one kind of common error in fuel distribution design. Although the design is symmetric, the engine only draws fuel from one tank.

The reason is, the bottom fuel tank uses Rule 2 to deliver fuel and because fuel pipes are scanned in order of placement, the scan first visits the right fuel tank. This fuel tank then uses Rule 4 to deliver fuel from the Hub part and the Hub part uses Rule 4 to deliver fuel from the left tank (and command pod but that doesn't have any fuel, and from bottom tank which has already been scanned).

Then the scan backs up to bottom tank and it scans the second fuel pipe - but the left tank has already been scanned (Rule 1), so the scan ends there.

This particular design starts working correctly if both fuel pipes are removed.

iJML26O.jpg

Edited by Kasuha
Link to comment
Share on other sites

Common Error Example

This is example of another common error. Again it is symmetric design which leads to asymmetric fuel drain. The reason is the same as in previous example - two paths leading to single fuel tank cause scan of the second path to be ended earlier.

The spacer was left between fuel tank and the bicoupler so the direction on fuel pipes can be seen easily.

Engine draws fuel from bottom fuel tank which uses Rule 4 to draw fuel from the bicoupler. The bicoupler draws fuel using Rule 2 but again attached fuel pipes are scanned sequentially, this time the left pipe is scanned first.

Left fuel pipe draws fuel from left tank which uses Rule 4 to draw it from top bicoupler and that in turn uses Rule 4 to draw fuel from top fuel tank. Note that (bi)couplers don't forward fuel scan to their multiside.

Right fuel pipe follows similar route through right fuel tank but that cannot apply Rule 4 as the top bicoupler has already been scanned, so it provides its own fuel through Rule 5.

If the top fuel tank is removed, this design works correctly thanks to the fact that couplers don't forward fuel scan to their multiside.

YUVaBdJ.jpg

Edited by Kasuha
Link to comment
Share on other sites

Common Error Example

In this example, the error does not lead to uneven fuel flow. Instead, it is in unexpected draw of fuel from central tank only, eventually starving the central engine of fuel.

The error lies in two misunderstandings:

First, that even though Rule 6 prevents fuel tanks from drawing fuel from parts to which they are radially attached does not mean that the same rule cannot be used by another part axially attached to the fuel tank.

Second, that unlike inline decouplers, radial decouplers are fuel crossfeed capable.

In this example, the side engines draw fuel through the fuel tank, which uses Rule 4 to draw fuel from the Girder segment to which they are axially attached. This girder then uses Rule 7 to draw fuel from the girder above, the radial decoupler and ultimately the central tank.

sifyin6.jpg

Edited by Kasuha
Link to comment
Share on other sites

Experiment: Axial mount point scan order

So far I only tested scanning order for two parts - FL-400 fuel tank and HubMax 6-point connector. It can be expected that other 2-point and 6-point parts behave the same way but I don't consider it guaranteed.

To test the 2-point fuel tank, I used the setup displayed in the album below.

Fuel scan entered the tank in the middle of the column through the pipe from the right. Then it continued to the fuel tank either above or below it, depending on which attach point was scanned first. Then through pipe to the tank on the left and through another pipe to the other tank. So the tank from which the fuel is drawn is sitting on the second scanned mount point. You can see that both orientations of the tank were tested with the same result - the top mount point is scanned first.

Jx8jgoE.jpg

Order appears to comply with the order in which attach points are defined in its part.cfg file:

node_stack_top = 0.0, 7.72552, 0.0, 0.0, 1.0, 0.0
node_stack_bottom = 0.0, -7.3, 0.0, 0.0, 1.0, 0.0

Javascript is disabled. View full album

To test the HubMax connector I used similar setup, more complicated just because there were more ports. Also there is no way to draw fuel directly from the body of the connector so it was necessary to perform two runs with fuel being drawn primarily using two different mount points.

To reduce number of reconfigurations I uses docking ports' ability to disable fuel crossfeed. The final approach was the same, i.e. excluding the tank from which the fuel was drawn primarily, the tank that did not draw fuel was the tank whose connection was scanned first. Then I disabled crossfeed towards that tank and ran the setup again.

Connection scan order is shown in standard unrotated VAB deployment orientation.

SAuza2f.jpg

Again, order appears to comply with the order in which attach points are defined in its part.cfg file:

node_stack_right = 0.9121535, 0, 0, -1, 0, 0, 1
node_stack_left = -0.9121535, 0, 0, 1, 0, 0, 1

node_stack_back = 0, 0, 0.9121535, 0, 0,-1, 1
node_stack_front = 0, 0,-0.9121535, 0, 0, 1, 1

node_stack_top = 0, 0.9121535, 0, 0,-1, 0, 1
node_stack_bottom = 0,-0.9121535, 0, 0, 1, 0, 1

Javascript is disabled. View full album
Edited by Kasuha
Link to comment
Share on other sites

  • 1 month later...

Thanks for the excellent info in this thread and for the experimental evidence to support it. Great job...

I am currently trying to fix some issues in the vessel simulation code used by KER. I have a station that causes the existing KER code to get stuck in an infinite recursion and this completely disables KER's simulation code until you restart KSP. There are also potential threading issues as KER now runs the simulation in a background thread and the part tree could be modified by the core engine while the simulation is running. I am also pretty sure that it isn't exactly following all of these rules, or, if it is, it's doing so in a way that is not very obvious in the code.

So far I have modified the code to run the preparation phase that creates the simulation data structures in the main thread and expanded the simulation data structures to contain everything needed to run the simulation without having to access the real parts from the background thread. I have also written a handy function that dumps out the entire simulation part tree in a tree view listing all the important info about the parts. I am now trying to tidy up the simulation code to make it easier to understand and fix the recursion issues.

Would you be willing to share the craft files of your various test craft so that I can ensure the simulation is as accurate as possible?

Many thanks,

Pad.

Link to comment
Share on other sites

Very nice work. Thankfully, I've always been able to get the fuel distribution as I intended it to be; your work explains why the fuel flows the way it does. Its been my experience that experimenting with the order of fuel line placement can vary the delta V (I use KER for immediate results while assembling a craft). Thanks again!

Link to comment
Share on other sites

Good stuff. Maybe you could add a section for how fuel line loops keep fuel proportions equal in unconnected tanks. Very useful for powerful first stages.

The problem is, they don't. If an engine enters a fuel line loop at certain place, it ends up drawing fuel from the first tank preceding the one at which it entered the loop. Fuel proportions are equalized only if engines start their search at different places of the loop (evenly) and draw the fuel also evenly.

The only advantage of fuel loop is that regardless where an engine is mounted in that loop, it has access to all fuel in the loop.

8dfPWHy.jpg

Link to comment
Share on other sites

This is what I meant.

OPBQLWy.jpg

Actually I made a little mistake. The fuel isn't actually drained proportionally, but this kind of arrangement allows for unconnected tanks to supply fuel to all engines equally regardless of tank size. You need fuel lines in both directions.

Edited by Cpt. Kipard
Link to comment
Share on other sites

The fuel isn't actually drained proportionally, but this kind of arrangement allows for unconnected tanks to supply fuel to all engines equally regardless of tank size. You need fuel lines in both directions.

That is true. Fuel loops are useful when they're designed carefully. But sometimes they may cause nasty problems, especially for someone who doesn't entirely understand how fuel drawing works.

Link to comment
Share on other sites

  • 3 weeks later...

Hello Kasuha

I would tell you that I translated your exceptional post in the wiki of the french community in taking care by naming the author and keeping many links to the original article.

Thank you all for the quality of your work.

Link to comment
Share on other sites

  • 4 weeks later...

Experiment: Monopropellant flow, all decoupler types

Command pod is the root part of this ship. All types of decouplers are used. The experiment reveals that with exception of launch clamps, each decoupler on the way from root part to the monopropellant tank adds onle level of priority. It is also apparent that each priority level is completely depleted of monopropellant before next level is used.

It is also apparent that the distance from root plays role, not distance from the end. One of branches starts being depleted only at the second step.

Craft file of a slightly improved test craft

Javascript is disabled. View full album

24-Aug-2014: verified for 0.24.2

Edited by Kasuha
Link to comment
Share on other sites

Experiment: Xenon flow, all decoupler types

Command pod is the root part of this ship. All types of decouplers are used. The experiment reveals that with exception of launch clamps, each decoupler on the way from root part to the xwnon tank adds onle level of priority.

It is also apparent that the distance from root plays role, not distance from the end. One of branches starts being depleted only at the second step.

Craft file of a slightly improved test craft

Javascript is disabled. View full album

24-Aug-2014: verified for 0.24.2

Edited by Kasuha
Link to comment
Share on other sites

Experiment: placement of engines plays no role in monopropellant drawing

In both cases below, the command pod is the root part. RCS thrusters are placed above the decoupler in one case, below the decoupler in the other case. In both cases the more separated monopropellant tank is used first.

Craft file 1 (engines at top)

Craft file 2 (engines at bottom)

Javascript is disabled. View full album
Javascript is disabled. View full album

24-Aug-2014: verified for 0.24.2

Edited by Kasuha
Link to comment
Share on other sites

Experiment: decoupler orientation (up/down) and placement relative to root part is irrelevant

The command pod is the root part in the example below. Monopropellant is drawn from tanks without regard to how the decoupler is oriented or where it is connected to the root part.

Craft file

Javascript is disabled. View full album

24-Aug-2014: verified for 0.24.2

Edited by Kasuha
Link to comment
Share on other sites

Experiment: struts and fuel pipes do not affect monopropellant flow

Command pod is the root part. One strut and one fuel pipe is drawn in each direction between the two stacks of monopropellant tanks with no effect on how monopropellant is drawn.

Craft file of an equivalent/improved test craft

Javascript is disabled. View full album

24-Aug-2014: verified for 0.24.2

Edited by Kasuha
Link to comment
Share on other sites

Experiment: Staging setup does not affect monopropellant draw

Command pod is the root part. All decouplers are assigned to different stages, yet they are all drawn at the same time because there is just one decoupler between them and the root part in all cases.

Craft file of an equivalent/improved test craft

Javascript is disabled. View full album

24-Aug-2014: verified for 0.24.2

Edited by Kasuha
Link to comment
Share on other sites

Experiment: docking ports and fuel crossfeed have no effect on monopropellant drawing

This ship uses mix of parts with and without fuel crossfeed (I-beams have no fuel crossfeed, girder segments have fuel crossfeed capability). Also docking ports of each type are used, both in attached and docked state. Monopropellant is still drawn evenly from all containers because in absence of decouplers they are all on the same priority level.

Craft file

Javascript is disabled. View full album

24-Aug-2014: verified for 0.24.2

Edited by Kasuha
Link to comment
Share on other sites

Experiment: Staging setup does not affect monopropellant draw

Command pod is the root part. All decouplers are assigned to different stages, yet they are all drawn at the same time because there is just one decoupler between them and the root part in all cases.

http://imgur.com/a/AsfJm

I'm not saying that this is wrong as your experiment certainly does appear to be valid but when I was fixing this in KER I asked about what the rules were and was given a quote from Harvester which explicitly says that tanks on higher stage numbers are used first. This is much easier (quicker) to calculate and also, the name of the flow type is STAGE_PRIORITY_FLOW which I would expect to mean that it has something to do with staging rather than a count of decouplers between each tank and the root.

Any chance you have kept your craft file for this one as I am going to try to get an official answer from Harvester to explain this discrepancy...?

Link to comment
Share on other sites

I'm not saying that this is wrong as your experiment certainly does appear to be valid but when I was fixing this in KER I asked about what the rules were and was given a quote from Harvester which explicitly says that tanks on higher stage numbers are used first. This is much easier (quicker) to calculate and also, the name of the flow type is STAGE_PRIORITY_FLOW which I would expect to mean that it has something to do with staging rather than a count of decouplers between each tank and the root.

Any chance you have kept your craft file for this one as I am going to try to get an official answer from Harvester to explain this discrepancy...?

Sorry about late response, I don't come to this part of forums often and therefore I don't notice there's a new post. It's probably better to send me a PM if you have any questions.

Here is a craft file with slightly improved test craft for test that staging setup really doesn't play role. I know about that quote, that's why I made a test specifically for that.

I saved craft files for all things I re-tested for 0.23.5 so far so I don't have to remake them with next release. The set is not complete but if you're interested, the package is here.

Edited by Kasuha
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...