Jump to content

[1.11.x] Cryogenic Engines: Liquid Hydrogen and Methane Rockets! (Mar 9, 2021)


Recommended Posts

Hello,

As Nertea made a patch for NearFuture Propulsion to generate LH2 with the ISRU, I thought of making a variant that generates LH2+Ox in the correct ratios for the Cryo engines, which I'm putting here in case anyone finds it useful. This adds a new mode to the ISRU, and like the stock modes, total mass is conserved through the conversion. To make use of it, save the following in a .cfg file anywhere in your GameData folder


@PART[ISRU]
{
MODULE
{
name = ModuleResourceConverter
ConverterName = LH2+Ox
StartActionName = Start ISRU [LH2+Ox]
StopActionName = Stop ISRU [LH2+Ox]
AutoShutdown = false
GeneratesHeat = false
UseSpecialistBonus = true
SpecialistEfficiencyFactor = 0.2
SpecialistBonusBase = 0.05
Specialty = Engineer
EfficiencyBonus = 1



INPUT_RESOURCE
{
ResourceName = Ore
Ratio = 0.5
FlowMode = STAGE_PRIORITY_FLOW
}
INPUT_RESOURCE
{
ResourceName = ElectricCharge
Ratio = 50
}
OUTPUT_RESOURCE
{
ResourceName = LqdHydrogen
Ratio = 8.7589
DumpExcess = false
FlowMode = STAGE_PRIORITY_FLOW
}
OUTPUT_RESOURCE
{
ResourceName = Oxidizer
Ratio = 0.87589
DumpExcess = false
FlowMode = STAGE_PRIORITY_FLOW
}

}
}

Short answer: The numbers given by Chewie are correct, to the precision he gave them at.

OK, so I played around tonight and here's what I figured out:

Ore weighs 10 kg per display unit. Liquid Fuel and Oxidizer both weight 5 kg per display unit. LqdHydrogen weighs 0.07085 kg per display unit.

So 1000 Ore = 10 tonnes, 1000 Liquid Fuel or Oxidizer = 5 tonnes, and 1000 LqdHydrogen = 70.85 kg

OK, given that, the exact numbers in this patch would be 5/5.7085 (which is approx 0.8758868) and 10* that (8.758868). That conserves mass between Ore and the LH/O 10:1 mix.

In order to conserve mass when converting directly to LqdHydrogen alone, the number should be 5/0.07085 = 70.57163

The following patch adds both modes to the ISRU and conserves mass between Ore and LH/O or LH.


@PART[ISRU]
{
MODULE
{
name = ModuleResourceConverter
ConverterName = LH2+Ox
StartActionName = Start ISRU [LH2+Ox]
StopActionName = Stop ISRU [LH2+Ox]
AutoShutdown = false
GeneratesHeat = false
UseSpecialistBonus = true
SpecialistEfficiencyFactor = 0.2
SpecialistBonusBase = 0.05
Specialty = Engineer
EfficiencyBonus = 1





INPUT_RESOURCE
{
ResourceName = Ore
Ratio = 0.5
FlowMode = STAGE_PRIORITY_FLOW
}
INPUT_RESOURCE
{
ResourceName = ElectricCharge
Ratio = 50
}
OUTPUT_RESOURCE
{
ResourceName = LqdHydrogen
Ratio = 8.758868
DumpExcess = false
FlowMode = STAGE_PRIORITY_FLOW
}
OUTPUT_RESOURCE
{
ResourceName = Oxidizer
Ratio = 0.8758868
DumpExcess = false
FlowMode = STAGE_PRIORITY_FLOW
}
}


MODULE
{
name = ModuleResourceConverter
ConverterName = LH2
StartActionName = Start ISRU [LH2]
StopActionName = Stop ISRU [LH2]
AutoShutdown = false
GeneratesHeat = false
UseSpecialistBonus = true
SpecialistEfficiencyFactor = 0.2
SpecialistBonusBase = 0.05
Specialty = Engineer
EfficiencyBonus = 1



INPUT_RESOURCE
{
ResourceName = Ore
Ratio = 0.5
FlowMode = STAGE_PRIORITY_FLOW
}
INPUT_RESOURCE
{
ResourceName = ElectricCharge
Ratio = 50
}
OUTPUT_RESOURCE
{
ResourceName = LqdHydrogen
Ratio = 70.57163
DumpExcess = false
FlowMode = STAGE_PRIORITY_FLOW
}

}
}

Note also that the patch distributed in the NF Propulsion package has a "@" in front of the word MODULE, and this deletes the stock LF/O conversion option! Also, the value in that patch (100, rather than 70.57162) adds total mass to the ship.

For roleplaying purposes, if you want to model some wastage of Ore mass in the conversion process, then you just reduce these "Ratio" numbers in the output field. (Obviously if the same mass of Ore can be turned into kerosene, oxidizer, and/or hydrogen without any losses, then the ISRU is doing some kind of nuclear transformation on the atoms in the Ore. Nifty!)

If you want to assume that the Ore can not be transmuted, then you have to consider that kerosene is about 86% carbon and 14% hydrogen by mass. So if 1 kg of ore can turn into 1 kg of kerosene, then it should only be able to turn into 0.14 kg of hydrogen. In that case, rather than using 70.57162 as the output ratio, you could use approximately 10 when making LH2 (and 1.2 instead of 8.758868) when making LH/O mix. Of course you would be losing a lot of mass when you process the ore, but that would be carbon you dump overboard. (This still ignores that the Ore can be fully converted to Oxidizer or Monoprop.)

Edited by mikegarrison
Link to post
Share on other sites

It just occurred to me that LE-7A a.k.a KS-01 'Odin' Cryogenic Rocket Engine actually has worse performance than its predecessor, LE-7: it had Isp(vac) of 446 (438 for LE-7A) and Isp(SL) of 349 (338 for LE-7A). And LE-7 was ~86kg lighter btw. Looked different, too.

No wonder, though: Mitsubishi intentionally went "much cheaper" way with LE-7A.

Link to post
Share on other sites
Well, for me there's nothing to dislike about this one:

http://images.gizmag.com/gallery_lrg/firefly-alpha-4.png

http://www.gizmag.com/firefly-alpha-aerospike-launch-vehicle/32892/pictures#5

It is even steerable! See:

http://images.gizmag.com/gallery_lrg/firefly-alpha-3.png

I wish I knew how to export from Blender to Unity and what is unwrapping... Someone has to make a short video course about modelling for KSP.

- - - Updated - - -

This one bites me hard. It necessitates manual interaction, but holestly I prefer semi-automatic launchers made with SmartParts (no kOS for me yet). I have not find a solution to this problem yet, but I have an idea - place another fuel sensor, which will activate timer through AG which will in turn activate thy engine.

Yeah. I have already modelled the Firefly Alpha:

Javascript is disabled. View full album
Link to post
Share on other sites

Something happened to my recent probe in the Kerbin SOI. It's TWR for it's cryogenic engines went from 3.1 to 83.4. Same thing happened on it's other cryo stage, it's normal oxi-liquid fuel stage stayed the same though.

It really messed with mechjebs maneuver nodes that I had already planned, new nodes however worked correctly.

Link to post
Share on other sites

Hm, strange, LE-7A (Odin?) smoke is offset from exhaust to the side it seems:

screenshot28_500.jpgi.gif

Edited to add: this particular engine has really distinguishable sound IRL, akin to kettle:

- - - Updated - - -

Yeah. I have already modelled the Firefly Alpha:

http://imgur.com/a/0RGsd

Oh, cool!

I guess they have that grill under aerospike's plug nozzle because they blow turbine exhaust onto that?.. Or is it closed-cycle?...

Edited by cipherpunks
Link to post
Share on other sites

Updated for 1.04

  • Updated bundled MM, ISFuelSwitch plugins
  • Fixed Odin offset smoke
  • Updated a few thermal values for 1.04
  • Rewrite of tank fuel switching patch for better balance, courtesy of several forumgoers
  • ISRU can now produce LH2 and LH2+Ox mixes (should adapt to LH2 process in NFP just fine)

Link to post
Share on other sites

(Unofficial) request for feedback regarding the balance of fuel tank configurations

I wrote the new components of the fuel-switching patch. It is designed to mathematically derive fuel tank properties from a set of basic constants, facilitating consistency and balance. However, some of the constants that I selected are largely educated guesses regarding what will produce good in-game balance. If there is a consensus that something needs adjustment, I can make recommendations to Nertea regarding tweaking the constants. In particular, I'm interested in the dry mass of LH2-containing parts, which has decreased significantly from prior versions.

Edited by Fraz86
Link to post
Share on other sites

These engines look gorgeous! Sadly, there is a problem that renders these engines as obstacles for me. It's because of Interstellar fuel switch, it gives resource switching to all tanks, including modded ones. This makes multi-fuel tanks like your service tanks from Near Future Spacecraft not having the other resource, it only holds liquid fuel or liquid hydrogen and oxidizer.

Link to post
Share on other sites
These engines look gorgeous! Sadly, there is a problem that renders these engines as obstacles for me. It's because of Interstellar fuel switch, it gives resource switching to all tanks, including modded ones. This makes multi-fuel tanks like your service tanks from Near Future Spacecraft not having the other resource, it only holds liquid fuel or liquid hydrogen and oxidizer.

Are you using the latest release? The current fuel switching functionality leaves other resources (e.g., monoprop in Nertea's service tanks) untouched.

Link to post
Share on other sites

Nertea,

Though not an urgent issue, I suggest editing the part configs of the cryogenic LH2 tanks to adjust their masses and capacities, such that they are consistent with those set by the fuel switching patch. Currently, anyone who chooses not to use the fuel switching patch will have fuel tanks with very different properties.

Another potential issue to address while editing part configs, is that the fuel switching patch preserves absolute offset in dry mass relative to the "standard" dry:wet ratio (extra dry mass for small tanks, less dry mass for large tanks), while decreasing dry mass across the board, which has the result of exaggerating differences in dry:wet ratios between LH2 tanks. For example, the 10m tank currently has a dry:wet ratio around 1:7.7, which is probably too good for any LH2 tank. If you'd like, I can look through the part configs and make some specific recommendations.

Edited by Fraz86
Link to post
Share on other sites

You're referring to the tanks from NFP that are adjusted to be switchable, right? Yeah those certainly need some capacity tweaks. If you let me know what values are consistent with the switched tanks, I can test it for the NFP update. Otherwise, I'll get to it, but not really sure when (limited time with KSP computer at the moment).

Link to post
Share on other sites
You're referring to the tanks from NFP that are adjusted to be switchable, right? Yeah those certainly need some capacity tweaks. If you let me know what values are consistent with the switched tanks, I can test it for the NFP update. Otherwise, I'll get to it, but not really sure when (limited time with KSP computer at the moment).

Yes, exactly. The following table summarizes my recommendations (values to be defined in part configs are highlighted in red):

uRuwmlm.png

EDIT:

This will require an update to the fuel switch patch as well. Here is my recommendation for the new patch to accompany the above changes (removes cryoFudgeFactor and updates dry mass offset calculation):

// LF/O tanks
@PART[*]:HAS[@RESOURCE[LiquidFuel],@RESOURCE[Oxidizer],!MODULE[InterstellarFuelSwitch],!MODULE[ModuleEnginesFX],!MODULE[ModuleEngines],!MODULE[FSfuelSwitch]]:NEEDS[!modularFuelTanks]:NEEDS[!RealFuels]
{
%LF = #$RESOURCE[LiquidFuel]/maxAmount$
%OX = #$RESOURCE[Oxidizer]/maxAmount$

%totalCap = #$RESOURCE[LiquidFuel]/maxAmount$
@totalCap += #$RESOURCE[Oxidizer]/maxAmount$

%LH2FudgeFactor = 1.5 // <- EDIT HERE (effectively multiplies LH2 density by this number)
%mixOXProportion = 0.45 // <- EDIT HERE (proportion of tank volume containing OX; this value should be set approximately = 5.5 / [5.5 + [10 / LH2FudgeFactor]])
%massPerUnitLH2 = 0.000035 // <- EDIT HERE (dry mass per unit LH2 capacity)

%onlyLH2 = #$totalCap$
@onlyLH2 *= 5.5
@onlyLH2 *= #$LH2FudgeFactor$

%mixOX = #$totalCap$
@mixOX *= #$mixOXProportion$
%mixLH2 = #$mixOX$
@mixLH2 *= 10

%tempVar = 0
%dryCost = 0

@dryCost = #$cost$

%LFCost = 0
%OXCost = 0
%LH2Cost = 0
%mixLH2Cost = 0
%mixLFCost = 0

// compute cost of stock tank fuel
@tempVar = #$RESOURCE[LiquidFuel]/maxAmount$
@tempVar *= 0.8
@mixLFCost += #$tempVar$

@tempVar = #$RESOURCE[Oxidizer]/maxAmount$
@tempVar *= 0.18
@mixLFCost += #$tempVar$

@dryCost -= #$mixLFCost$
@cost -= #$mixLFCost$

// Cost LF only
@tempVar = #$totalCap$
@tempVar *= 0.8
@LFCost += #$tempVar$

// Cost OX only
@tempVar = #$totalCap$
@tempVar *= 0.18
@OXCost += #$tempVar$

// Cost LH2 only
@tempVar = #$onlyLH2$
@tempVar *= 0.03675
@LH2Cost += #$tempVar$

// Cost mix
@tempVar = #$mixLH2$
@tempVar *= 0.03675
@mixLH2Cost += #$tempVar$

@tempVar = #$mixOX$
@tempVar *= 0.18
@mixLH2Cost += #$tempVar$

// masses
%massOffset = #$mass$
@tempVar = #$totalCap$
@tempVar *= 0.000625 // standard dry mass per units of LF/OX
@massOffset -= #$tempVar$ // this value accounts for any non-standard fuel tank mass, which should remain constant across fuel configurations, e.g., extra mass for spaceplane tanks

%mixLH2mass = #$mixOX$
@mixLH2mass *= 0.000625

@tempVar = #$mixLH2$
@tempVar *= #$massPerUnitLH2$
@mixLH2mass += #$tempVar$
@mixLH2mass += #$massOffset$

%onlyLH2mass = #$onlyLH2$
@onlyLH2mass *= #$massPerUnitLH2$
@onlyLH2mass += #$massOffset$

@tempVar = 0

MODULE
{
name = InterstellarFuelSwitch

volumeMultiplier = 1
massMultiplier = 1

resourceGui = LF/OX;LH2/OX;LF;OX;LH2
resourceNames = LiquidFuel,Oxidizer;LqdHydrogen,Oxidizer;LiquidFuel;Oxidizer;LqdHydrogen

resourceAmounts = #$../LF$,$../OX$;$../mixLH2$,$../mixOX$;$../totalCap$;$../totalCap$;$../onlyLH2$

//tankCost = #$../mixLFCost$;$../mixLH2Cost$;$../LFCost$;$../OXCost$;$../LH2Cost$
displayCurrentTankCost = true

hasGUI = true
showInfo = true

availableInFlight = false
availableInEditor = true

basePartMass = 0
tankMass = #$../mass$;$../mixLH2mass$;$../mass$;$../mass$;$../onlyLH2mass$
}

!RESOURCE[LiquidFuel] {}
!RESOURCE[Oxidizer] {}
}

// Pure LH2 tanks
@PART[*]:HAS[@RESOURCE[LqdHydrogen],!MODULE[InterstellarFuelSwitch],!MODULE[ModuleEnginesFX],!MODULE[ModuleEngines],!MODULE[FSfuelSwitch]]:NEEDS[!modularFuelTanks]:NEEDS[!RealFuels]
{
%LH2 = #$RESOURCE[LqdHydrogen]/maxAmount$

%LH2FudgeFactor = 1.5 // (this should match LH2FudgeFactor for stock tanks above)
%mixOXProportion = 0.45 // (this should match mixOXProportion for stock tanks above)

%massPerUnitLH2 = 0.000025 // <- EDIT HERE (dry mass per unit LH2 capacity; this should be < massPerUnitLH2 for stock tanks)
%massPerUnitOX = 0.0005 // <- EDIT HERE (dry mass per unit OX capacity; this should be < the standard stock value of 0.000625)

%OX = #$LH2$
@OX /= #$LH2FudgeFactor$
@OX /= 5.5

%mixOX = #$OX$
@mixOX *= #$mixOXProportion$
%mixLH2 = #$mixOX$
@mixLH2 *= 10

// masses
%onlyLH2mass = #$LH2$
@onlyLH2mass *= #$massPerUnitLH2$

%massOffset = #$mass$
@massOffset -= #$onlyLH2mass$ // this value accounts for any non-standard fuel tank mass, which should remain constant across fuel configurations, e.g., lower dry mass ratios for larger tanks

@onlyLH2mass += #$massOffset$

%mixLH2mass = #$mixOX$
@mixLH2mass *= #$massPerUnitOX$

%tempVar = #$mixLH2$
@tempVar *= #$massPerUnitLH2$
@mixLH2mass += #$tempVar$
@mixLH2mass += #$massOffset$

%onlyOXmass = #$OX$
@onlyOXmass *= #$massPerUnitOX$
@onlyOXmass += #$massOffset$

@tempVar = 0

MODULE
{
name = InterstellarFuelSwitch

volumeMultiplier = 1
massMultiplier = 1

resourceGui = LH2;LH2/OX;OX
resourceNames = LqdHydrogen;LqdHydrogen,Oxidizer;Oxidizer

resourceAmounts = #$../LH2$;$../mixLH2$,$../mixOX$;$../OX$

displayCurrentTankCost = true

hasGUI = true
showInfo = true

availableInFlight = false
availableInEditor = true

basePartMass = 0
tankMass = #$../onlyLH2mass$;$../mixLH2mass$;$../onlyOXmass$
}

!RESOURCE[LqdHydrogen] {}
}

Edited by Fraz86
Link to post
Share on other sites
Are you going to do a version that works with RealFuels?

From the FAQ on the first page:

Q: RealFuels support?

A: I will be making a special RO version of this pack in the future. It will have correct sizing, thrusts, transform locations and such. The ETA on this is unknown.

Link to post
Share on other sites
Thanks Fraz, I'll have a look at it this Wednesday.

I'm happy to help! The table in my prior post preserves your model-based volumetric measurements for determining relative capacities.

As an alternative, please consider the following values, which conform your tanks to the logic of stock fuel tanks. Basically, if a tank is twice as long, it holds twice the volume (e.g., FL-T800 = 2x FL-T400 = 4x FL-T200 = 8x FL-T100). If a tank has twice the diameter, it holds 4x the volume (e.g., X200-32 = 4x FL-T800). Personally, I like the simplicity of these relationships. The values I selected provide perfect correspondence with the volumes of stock tanks (e.g., Centi-3 = FL-T800, HI-M-21 = Jumbo-64, Mondo-60 = S3-14400), which guarantees good balance when using the fuel-switching patch. This version has the added benefit of producing nice round capacity numbers in all configurations (LH2 only, LH2/OX, and OX only).

kDqZNuk.png

EDIT:

Updated the table with rounded off dry masses.

Edited by Fraz86
Link to post
Share on other sites
What causes the exhaust particles to be widely spaced like this? Is there something I can edit to make it not look so weird?

Those are shock cells. The shock wave essentially bounces off the impedance mismatch between the exhaust stream and the free stream. It's a real physical phenomenon in atmosphere. I assume it's real in vacuum also, but I don't know for sure.

http://i.imgur.com/cYMvEx3.jpg

573209.fig.002.jpg

ps. The illustration has a typo. There is no such thing as a "sock cell", unless that's a prison where the socks you lose in the wash go to hang out.

Edited by mikegarrison
Link to post
Share on other sites

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