Jump to content

A discussion on fuel types.


ialdabaoth

Recommended Posts

So, I'm a big fan of realism. Now that I've purchased KSP, I've been looking at modding my game to be as realistic as possible; one of those changes has been adding new fuel types.

KSP's "LiquidFuel" rocket fuel resource is a Kerosene derivative (it says so right on the spaceplane fuselage). This is appropriate for many of the propulsion systems in the game, but not all.

According to Wikipedia's article on RP-1 kerosene rocket fuel:

kerosene engines generate an Isp in the range of 270 to 360 seconds, while hydrogen engines achieve 370–465 seconds.

Also, according to Wikipedia's article on nuclear rockets:

Using hydrogen propellant, a solid-core design typically delivers specific impulses (Isp) on the order of 850 to 1000 seconds, about twice that of liquid hydrogen-oxygen designs such as the Space Shuttle Main Engine.

and

Dramatically greater improvements are theoretically possible by mixing the nuclear fuel into the working fluid, and allowing the reaction to take place in the liquid mixture itself. This is the basis of the so-called liquid-core engine, which can operate at higher temperatures beyond the melting point of the nuclear fuel. In this case the maximum temperature is whatever the container wall (typically a neutron reflector of some sort) can withstand, while actively cooled by the hydrogen. It is expected that the liquid-core design can deliver performance on the order of 1300 to 1500 seconds (12.8–14.8 kN·s/kg).

So, we have the following breakdown for rocket engines, based on their Isp:

Rocket Type by Isp

Vacuum Isp between 200 and 375: Kerosene + Liquid Oxygen

Vacuum Isp between 375 and 500: Liquid Hydrogen + Liquid Oxygen

Vacuum Isp between 500 and 1500: Liquid Hydrogen + Uranium

Vacuum Isp over 1500: Probably an Ion engine, not going to go into those in this post.

Fuel Densities

Liquid Hydrogen: 0.071 kg per liter (liquid)

Liquid Oxygen: 1.141 kg per liter (liquid)

Kerosene: 0.833-ish kg per liter (liquid)

Uranium: 19.1 kg per liter (solid)

Right now, LiquidFuel and Oxidizer both have a defined density of 0.005; I have no idea what those units are measured in. According to Wikipedia, the proper mixture of RP-1 Kerosene to Liquid Oxygen is roughly 2 parts RP-1 to 5 parts LOX; reading Wikpedia's article on rocket propellant seems to indicate that these are mass ratios, not volume ratios, while it appears that KSP uses volume ratios in its ModuleEngines code. (EDIT: Confirmed through testing.)

For reference, here is the PROPELLANT section of the LV-T30's ModuleEngines block:


PROPELLANT
{
name = LiquidFuel
ratio = 0.9
DrawGauge = True
}
PROPELLANT
{
name = Oxidizer
ratio = 1.1
}

So, right now it looks like the standard engines burn 1.1 liter of Oxidizer (weighing 1.25 kilograms) per 0.9 liters of Kerosene (weighing 0.75 kilograms). This is a fuel mixture of 1.67:1, instead of the "real world" value of approximately 2.5:1. Instead of 1.1:0.9, the volume ratios should be approximately 1.3 : 0.7, or slightly higher.

Thus, the actual ModuleEngines block should look like this:


PROPELLANT
{
name = LiquidFuel
ratio = 0.7
DrawGauge = True
}
PROPELLANT
{
name = LiquidOxygen
ratio = 1.3
}

One advantage of this system for modders, is that it clearly links the resource values in the part.cfg files to real-world volumetric data. A one-meter diameter tank (0.5 meter radius) that is one-meter tall can store a maximum of 3.14 * 0.5 * 0.5 * 1 * 1000 = 785 liters of fluid. Of this, 275 liters will be Kerosene, and 510 liters will be Oxidizer.

Now, Liquid Hydrogen chemical rockets use a different mass ratio, of 6:1. However, since LH2 is insanely light compared to LOX, the volume ratios aren't quite as extreme. For every 540 liters of LH2, you should burn roughly 1,460 liters of LOX; thus, 1 meter diameter x 1 meter length cryogenic LOX/LH2 tank should contain 210 liters of LH2, and about 570 liters of LOX. (This adds up to 780 rather than 785 because the cryogenic system will take up some of the volume).

Switching Resources.cfg to use Liters

KSP uses Tons instead of Kilograms. Luckily, tons per cubic meter is identical to kilograms per liter, since there's 1000 kg in a ton, and 1000 liters in a cubic meter.

If we do this, resources.cfg should have the following Density values:


RESOURCE_DEFINITION
{
name = LiquidFuel
density = 0.833
flowMode = STACK_PRIORITY_SEARCH
transfer = PUMP
}

RESOURCE_DEFINITION
{
name = LiquidHydrogen
density = 0.071
flowMode = STACK_PRIORITY_SEARCH
transfer = PUMP
}

RESOURCE_DEFINITION
{
name = LiquidOxygen
density = 1.141
flowMode = STACK_PRIORITY_SEARCH
transfer = PUMP
}

RESOURCE_DEFINITION
{
name = NuclearFuel
density = 19.1
flowMode = NO_FLOW
transfer = NONE
}

Revisiting Engines

So now that we have a handle on engine densities, we can define the PROPELLANT section of each engine precisely, based on that engine's Isp:

If the Isp is less than 375:


PROPELLANT
{
name = LiquidFuel
ratio = 0.7
DrawGauge = True
}
PROPELLANT
{
name = LiquidOxygen
ratio = 1.3
}

If the Isp is between 375 and 500:


PROPELLANT
{
name = LiquidHydrogen
ratio = 0.54
DrawGauge = True
}
PROPELLANT
{
name = LiquidOxygen
ratio = 1.46
}

If the Isp is between 500 and 1500:


PROPELLANT
{
name = LiquidHydrogen
ratio = 2.0
DrawGauge = True
}
PROPELLANT
{
name = NuclearFuel
ratio = 0.000000001
}

Anything higher is probably an Ion engine, and is thus beyond the scope of this post.

Fuel Tanks

So, now that we've re-defined all the engines, we need to re-define all the fuel tanks to fuel them. For any given fuel tank, figure out the total volume of the tank like so:


V = Diameter * Diameter * Length

You'll use this number when making the part.cfg file, like so:

LiquidHydrogen - If it's big, fuzzy, and orange, then it's carrying Liquid Hydrogen and Liquid Oxygen.


RESOURCE
{
name = LiquidHydrogen
amount = [U][I]210 * V[/I][/U]
maxAmount = [I][U]210 * V[/U][/I]
}

RESOURCE
{
name = LiquidOxygen
amount = [U][I]570 * V[/I][/U]
maxAmount = [U][I]570 * V[/I][/U]
}

LiquidFuel - if it's painted black and white, then it's probably carrying Kerosene and Liquid Oxygen.


RESOURCE
{
name = LiquidFuel
amount = [U][I]275 * V[/I][/U]
maxAmount = [I][U]275 * V[/U][/I]
}

RESOURCE
{
name = LiquidOxygen
amount = [U][I]510 * V[/I][/U]
maxAmount = [U][I]510 * V[/I][/U]
}

LiquidHydrogen for NTRs - Special fuel tanks will carry pure LH2, for nuclear rockets. NuclearFuel will NOT be in the fuel tank! It will be directly in the rocket itself, just like an SRB. So the fuel tank will just have:


RESOURCE
{
name = LiquidHydrogen
amount = [U][I]780 * V[/I][/U]
maxAmount = [U][I]780 * V[/I][/U]
}

And then the NTR itself will have something like:


RESOURCE
{
name = NuclearFuel
amount = [I][U].01[/U][/I]
maxAmount = [I][U].01[/U][/I]
}

Where the ".01" will change depending on how much Uranium you want in the reactor.

... whew, that was a post.

Edited by ialdabaoth
Link to comment
Share on other sites

Wow, that IS a post. And a half. Outstanding job on dat mathematical equations. I think that you're onto something there. I really do. It would be one of those mods that you have by itself. Like nova-punch but with realistic values, keep it up!

Link to comment
Share on other sites

  • 3 weeks later...

Yes yes it always irks me that the nuclear engines consumes standard rocket fuel. But don't forget all the other pros and cons of fuel besides ISP such as density and boil-off. H2 can provide great ISP but at the sacrifice of having to use huge fuel tanks to carry around a fuel that has the same density as cotton candy! Also fuels like LH2 have a high boil-off rate, so a mod that wants realism would need to have cryogenic fuels like LO2 and LH2 slowly depleting from the fuel tanks even the engine is off and perhaps even a cyrogenic module that needs plenty of power to reliquify these kinds of fuels to prevent boil-off.

Link to comment
Share on other sites

A complete and conclusive report ialdabaoth ! Good stuff.

I'm probably going to have to make some sort of jury-rigged system in order to allow my Orion Drive to handle propellant and fuel in the form of nuclear charges. If it can be done at all within the bounds of the current program.

Link to comment
Share on other sites

What we need is a Standard Resources Mod that all mod makers can build from. So nyrath's mod, kethane, etc. can all draw from the same resources cfg file, rather than having independant ones for each mod.

Link to comment
Share on other sites

For the sake of sanity, I recommend writing a plugin or method for changing the fuel type between different fuel tanks. This would already be a benefit to the game as is, with just what I have (Liquid, Ox, Xenon, Kethane) but with even more fuel types it would become exponentially more useful to have.

So for example: you have a basic fuel tanks. It holds X fuel units. These units are translated into their specific fuel equivalents, 1 "FU" (Fuel Unit) is exactly 1 LiquidFuel, but it would be something more like 10 Xenon, 50 Kethane, etc.

Then allow us to pick which fuel to load into the tank on a per-tank basis while in the hangars. Suddenly our parts lists become half the size they were. Well, more like they'd shed a few pounds, but still a major improvement. You only need one fuel tank of any particular model (barring size differences) rather than one copy for each type of fuel.

Link to comment
Share on other sites

For the sake of sanity, I recommend writing a plugin or method for changing the fuel type between different fuel tanks. This would already be a benefit to the game as is, with just what I have (Liquid, Ox, Xenon, Kethane) but with even more fuel types it would become exponentially more useful to have.

So for example: you have a basic fuel tanks. It holds X fuel units. These units are translated into their specific fuel equivalents, 1 "FU" (Fuel Unit) is exactly 1 LiquidFuel, but it would be something more like 10 Xenon, 50 Kethane, etc.

Then allow us to pick which fuel to load into the tank on a per-tank basis while in the hangars. Suddenly our parts lists become half the size they were. Well, more like they'd shed a few pounds, but still a major improvement. You only need one fuel tank of any particular model (barring size differences) rather than one copy for each type of fuel.

Funny you should ask! That's exactly what I've been working on for the past week; if you click on the link, it'll take you to the forum thread where I'm asking for beta testers.

Link to comment
Share on other sites

So I think I'm misunderstanding how propellant ratios and densities work, because the behavior I'm seeing vs the behavior I expect is completely opposite. I'm using the modular fuel tanks mod to set different volumes for fuel, and things just aren't adding up. I'm also using a modified engine for testing purposes, granting it high thrust and isp.

Let me lay out the first test case to serve as a baseline.


Resources -
LiquidH2 density = 0.0001 // LH2 is super-light
Oxidizer density = 0.01 // Make this 100x heavier for the sake of testing
Engine Propellants -
LiquidH2 ratio = 0.5 // 50% LH2
Oxidizer ratio = 0.5 // 50% H2O2
Fuel Tank -
Volume = 2000
Dry Mass = 0.625
LH2 Mass @ 1000 = 1
H2O2 Mass @ 1000 = 10
Total Mass = 11.625
Fuel after achieving orbit -
LH2 = 500
H202 = 500

What I expect, all else being equal, is that by lowering the density of Oxidizer, I'll achieve orbit with more fuel onboard, because it will weigh less at launch. These tests all use MechJeb2 launch autopilot for repeatability, limited to escape velocity, with corrective steering enabled.

Test Case #1: Lighter H2O2


Resources -
LiquidH2 density = 0.0001 // LH2 is super-light
Oxidizer density = 0.0001 // 100x LESS dense than before
Engine Propellants -
LiquidH2 ratio = 0.5 // 50% LH2
Oxidizer ratio = 0.5 // 50% H2O2
Fuel Tank -
Volume = 2000
Dry Mass = 0.625
LH2 Mass @ 1000 = 1
H2O2 Mass @ 1000 = 1
Total Mass = 2.625
Fuel after achieving orbit -
NaN : Does not achieve orbit. Fuel depleted before 3400 meters.

Test Case #2: Heavier H2O2


Resources -
LiquidH2 density = 0.0001 // LH2 is super-light
Oxidizer density = 0.1 // 10x MORE dense than before (100x simply will not get off the launchpad)
Engine Propellants -
LiquidH2 ratio = 0.5 // 50% LH2
Oxidizer ratio = 0.5 // 50% H2O2
Fuel Tank -
Volume = 2000
Dry Mass = 0.625
LH2 Mass @ 1000 = 1
H2O2 Mass @ 1000 = 100
Total Mass = 101.625
Fuel after achieving orbit -
NaN : Does not achieve orbit. Weight causes instability at 25000 meters; catastrophic failure with 80%+ fuel remaining.

Now, this suggests to me that the engines use the resource density as some sort of energy coefficient. If test case #2 wasn't unstable in flight, I believe it could have gotten up enough dV to leave the Kerbal System altogether. It's almost as though the game sees not mass per volume in the density parameter, but energy per volume. I did not record the fuel usage rate, but I do recall seeing single / double digits in baseline, triple digits in lighter, and single digits in heavy.

Can someone else please test this so I don't go on thinking I'm crazy. Or am I just doing this all wrong?

Link to comment
Share on other sites

What I expect, all else being equal, is that by lowering the density of Oxidizer, I'll achieve orbit with more fuel onboard, because it will weigh less at launch.

ISP is a mass consumption rate, not a volume consumption rate.

Keeping the same engine and payload but reducing the density of fuel should result in less DeltaV because your ship has a lower percentage of it's mass being fuel.

Link to comment
Share on other sites

Yes, that's true, and I now understand that this is obviously how KSP operates and interprets density. So now I need to go post in the modular fuel tanks thread to point out that this system, as the original poster imagined, does not work. Because resource density is not d = m/v, rather d = e/v.

Link to comment
Share on other sites

Yes, that's true, and I now understand that this is obviously how KSP operates and interprets density. So now I need to go post in the modular fuel tanks thread to point out that this system, as the original poster imagined, does not work. Because resource density is not d = m/v, rather d = e/v.

It is indeed d = m/v. It's the rocket equation: delta_v = 9.81*Isp*ln(mass_initial/mass_final) just do the clacs with a denser fuel and a less dense fuel. The energy density of the fuel has nothing to do with it. (Though in reality I am pretty sure Isp is related to energy density (it's not the only factor))

Also my gut says something is weird with the final volume ratios you get for LH2 and LOX. The hydrogen is way less dense and should take up more space in the tanks. I know this is the case for the space shuttle with the main tank holding 19,540 ft^3 of LOX and 52,880 ft^3 of LH2 (or there abouts). That is opposite of what you had. I am guessing maybe you got the two confused somewhere along the way in your discussion?

As a whole I love the post it's always good to see some solid math!!!

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...