Jump to content

[1.12.x] Cryogenic Engines: Liquid Hydrogen and Methane Rockets! (Jan 22, 2022)


Nertea

Recommended Posts

On 5/7/2020 at 4:35 PM, jimmymcgoochie said:

Now all I have to do is figure out why the engine bell glows blue in hydrogen mode but not methane mode

On 8/3/2020 at 4:25 AM, hemeac said:

@jimmymcgoochie, I had been thinking of trying something similar, did you have luck in getting everything to work smoothly?  Would you be ok with sharing an example of the patch if you did get it to work?

What you're looking for here is to add this multimode key to the throttle effects node that controls the throttle emissive:

// Patch should look like this
@MODULE[FXModuleThrottleEffects]:HAS[#fxModuleNames[throttleColor]]
{
	%preferMultiMode = True
}

// Effect should look like this
MODULE
{
	name = FXModuleThrottleEffects
	fxModuleNames = throttleColor // not the one using heatColor
	responseSpeed = 1.0
	dependOnEngineState = True
	dependOnThrottle = True
	preferMultiMode = True // this
}

 

Edited by JadeOfMaar
Link to comment
Share on other sites

4 hours ago, Shoujo Q said:

I still haven't quite figured out how to use these to get more deltaV than with normal liquid-fuel engines, but they look very cool at least. Good work!

The difference between sea level engine performance and vac engine performance is more easily notice-able in 2.5x scaled systems and upward, moreso with crafts that are built to operate only in vacuum, with high fuel fractions, and less dead mass (dead mass being plane parts, SSTO gear, ISRU...). Cryo engines as a mod aren't all about the Isp. They're also about the idea of escaping using the abstract, heavy stock resource "LiquidFuel" and using a propellant with the proper density (which is very important to other mods and play styles).

Finally, look out for whether your craft's overall mass drops while you don't gain much in dV. That's still a win scenario, I think. It's hard to feel the Isp gain largely because parts are heavy to counter-balance stock size planets being so small and that usually everything uses the heavy LiquidFuel.

Link to comment
Share on other sites

7 hours ago, Shoujo Q said:

I still haven't quite figured out how to use these to get more deltaV than with normal liquid-fuel engines, but they look very cool at least. Good work!

Here are two simplified ways to look at it.

1) Same delta V as a liquid fuel tank stage 

Remember liquid hydrogen is less dense. So a fuel tank of the same size as an LFO one will give you LESS delta V. To get the same Delta V you need a bigger tank (or more tanks). When you achieve this what you will discover is that the MASS of the propellant will actually be less. And assuming you are comparing similar sized engines  what you get is an LH2 stage that is bigger than the LFO stage, with the same delta V but much lighter. Whats the advantage? Any  stages you have below it will now have more performance since its lifting a lighter load. 

2) Same mass as a liquid fuel stage

For example if you have a 10 tons of liquid fuel in a stage, try to build a liquid hydrogen stage that also has 10 tons of fuel. You will find you need much bigger tanks (or more) than even case 1) above. Now you have a stage that is much bigger than the LFO stage, same mass and significantly more delta V.

As a general rule you get the benefit of LH2 stages when they are boosted by something else. If you have an LH2 core stage, use solid rockets to start with (think shuttle, SLS, Ariane 5). Lh2 upper stages give a lot of performance if they come after an LFO stage (think Saturn V which had a kerolox 1st stage followed by 2 hydrogen ones).

If the rocket is all Hydrogen its difficult to get a performance benefit. The only real world rocket that does this is the Delta IV heavy and thats for industrial reasons than performance per se. it was in theory convenient to lash together 3 of the same cores.

As Jade mentioned these benefits become more apparent when trying to build bigger rockets as the tank masses in KSP are quite heavy compared to the real world.

Edited by Zorg
Link to comment
Share on other sites

Not being a particularly sophisticated player, my trial and error approach pretty much seems to boil down (or boil off!) to: LFO to go up, LH2 to go out, LFO or CH4 to get in.  By that I mean nearly all my Launch Vehicles end up using LFO to boost things into space, cryo engines for departure stages, but since LH2 boil off negates their use for anything much beyond that, it's back to LFO or the half-way-house Methalox (if you have it) for mid-course correct and orbital insertion.  Or whacky nuclear, argon, xenon setups depending on what mood I'm in.  The lower mass of the LH2 departure stage generally enables a much greater payload capacity.

Link to comment
Share on other sites

  • 2 weeks later...
On 8/24/2020 at 9:40 AM, Jimbodiah said:

Do any of Nertea's mods have methalox engines by chance?

Ah, found some patches for NFLV, thought they might have been in cryogenicengines instead.

Will be making more sometime too. 

Link to comment
Share on other sites

5 hours ago, Nertea said:

Will be making more sometime too. 

The Methalox update and some of the new designs you’ve got cooked up for NF Spacecraft are my most eagerly awaited mods at the moment. Keep up the great work, Nert.

Link to comment
Share on other sites

22 hours ago, lemon cup said:

The Methalox update and some of the new designs you’ve got cooked up for NF Spacecraft are my most eagerly awaited mods at the moment. Keep up the great work, Nert.

I wasn't aware I had designs cooked up, was I posting while toddler-sleep-deprived again?

Link to comment
Share on other sites

10 minutes ago, Nertea said:

I wasn't aware I had designs cooked up, was I posting while toddler-sleep-deprived again?

I think there was a misunderstanding of this post:

On 8/25/2020 at 10:15 AM, Nertea said:

Will be making more sometime too. 

I assume you mean "more methalox patches", but it could be read as meaning "more methalox engines".

Link to comment
Share on other sites

28 minutes ago, Nertea said:

I wasn't aware I had designs cooked up, was I posting while toddler-sleep-deprived again?

LOL I remember those days with my kids. Just when you have things slightly figured out, they hit some new milestone and then you're trying to keep up again.

Link to comment
Share on other sites

14 minutes ago, CDSlice said:

Maybe they meant the 1.875m station parts you posted ideas for in your dev thread?

Whoops, I’m referring to some of the hinted 5m station parts, which I now see is in the SSPX thread, not NF.

As far as methalox updates, weren’t there plans to formally bring the deprecated engines from NFLV (Eaglet, Kite, etc) into cryoengines? 

Link to comment
Share on other sites

Just now, lemon cup said:

Whoops, I’m referring to some of the hinted 5m station parts, which I now see is in the SSPX thread, not NF.

As far as methalox updates, weren’t there plans to formally bring the deprecated engines from NFLV (Eaglet, Kite, etc) into cryoengines? 

Yes the methalox things are coming, but the 5m parts probably aren't.

Link to comment
Share on other sites

11 hours ago, dlrk said:

@Nertea Is there any plan for a patch for an LH2 RAPIER and LH2 NFA engines (aside from the Cutlass)?

Not particularly unless they are specifically requested and balanced by somebody. I've really moved back from doing atmospherics recently. 

Link to comment
Share on other sites

  • 2 weeks later...
On 8/3/2020 at 7:29 PM, jimmymcgoochie said:

I never managed to get it working to a satisfactory level and only ever tried one engine, so I’m using a fuel switching patch to make the engines use methane not hydrogen- I also made a patch that duplicates the engines, but I don’t like hydrogen as a fuel because the fuel density is so low it robs the advantage of high ISP, whereas methane can compete directly with LF.

@jimmymcgoochie, I've been testing using B9PS for switching between hydrolox and metholox.  I have a working solution with the Skipper after going through a few mods and some helpful suggestions by @JadeOfMaar.  If you have RealPlume, I've added methalox plumes support on this particular engine (but I have only rescaled an existing config).  Guessing PlumeParty (or Waterfall) is the RealPlume alternative if you don't use RealPlume.  You can also presumably allow the engine to switch between hydrolox and methalox by adding a "switchInFlight = True" option after affectFARVoxels = False.  I haven't tried that option as I thought that makes the engine a bit cheaty, but is functionally similar to multimode engines.

Spoiler

// Skipper - Sticks to the basics of the CryoEngines Patch
@PART[engineLargeSkipper_v2]:NEEDS[CryoEngines]:AFTER[ReStock]
{
	@title = RE-I5 "Skipper" Cryogenic Rocket Engine
	//@description = #$description$ \n\n<color=#ff0000>This part has upgrades!</color> 
	@entryCost = 50000
	@cost = 10000
	
	@mass = 3.85
	
	
	@MODULE[ModuleEnginesFX]
    {
		@maxThrust = 850

		@PROPELLANT[LiquidFuel]
		{
			@name = LqdHydrogen
			@ratio = 1.5
		}
		@PROPELLANT[Oxidizer]
		{
			@ratio = 0.1
		}
		!atmosphereCurve {}
		atmosphereCurve
		{
			key = 0 430
			key = 1 372
			key = 4 285
			key = 12 0.001
		}
	}
	
	MODULE
	{
		name = ModuleB9PartSwitch
		moduleID = engineSwitch
		switcherDescription = Engine Switch
		affectDragCubes = False
		affectFARVoxels = False
		
		SUBTYPE
	    {
			name = REI5
			title = RE-I5 "Skipper" Cryogenic Rocket Engine
			descriptionSummary = Original Model.
			descriptionDetail = <b>Thrust:</b> 735.3 kN ASL / 850.0 kN Vac.\n<b>Isp:</b> 372.0 s ASL / 430.0 s Vac.
			addedCost = 0
			defaultSubtypePriority = 1
			primaryColor = #3cff00
			secondaryColor = #99ccff
	    }
		
		SUBTYPE:NEEDS[CryoTanksMethalox]
	    {
			name = REI5M
			title = RE-I5M "Jumper" Cryogenic Rocket Engine
			descriptionSummary = Methalox Variant
			descriptionDetail = <b>Thrust:</b> 753.3 kN ASL / 850.0 kN Vac.\n<b>Isp:</b> 305.0 s ASL / 352.6 s Vac.
			addedCost = 0
			addedMass = 0
			defaultSubtypePriority = 0
			primaryColor = #3cff00
			secondaryColor = #00bf8f

			MODULE
			{
			    IDENTIFIER
			    {
					name = ModuleEnginesFX
			    }

			    DATA:NEEDS[!RealPlume]
			    {
					maxThrust = 850.0
					atmosphereCurve
					{
						key = 0 352.6
						key = 1 305.04
						key = 4 233.70
						key = 12 0.001
					}
					PROPELLANT
					{
						name = LqdMethane
						ratio = 3
						DrawGauge = True
					}
					PROPELLANT
					{
						name = Oxidizer
						ratio = 1
					}
				}

				DATA:NEEDS[RealPlume]
			    {
					powerEffectName = Methalox_LowerShock
					maxThrust = 850.0
					atmosphereCurve
					{
						key = 0 352.6
						key = 1 305.04
						key = 4 233.70
						key = 12 0.001
					}
					PROPELLANT
					{
						name = LqdMethane
						ratio = 3
						DrawGauge = True
					}
					PROPELLANT
					{
						name = Oxidizer
						ratio = 1
					}
				}			    
			}
	    }
		
	}

    !EFFECTS {}
    EFFECTS
    {
		fx-skipper-running
		{
			AUDIO
			{
				channel = Ship
				clip = sound_rocket_hard
				volume = 0.0 0.0
				volume = 1.0 1.0
				pitch = 0.0 0.2
				pitch = 1.0 1.0
				loop = true
			}
			PREFAB_PARTICLE
			{
				prefabName = fx_smokeTrail_veryLarge
				transformName = smokePoint
				emission = 0.0 0.0
				emission = 0.05 0.0
				emission = 0.075 0.25
				emission = 1.0 1.25
				speed = 0.0 0.25
				speed = 1.0 1.0
				localOffset = 0, 0, 1
			}
			MODEL_MULTI_PARTICLE
			{
				name = core
				modelName = CryoEngines/FX/fx-skipper-core-1
				transformName = fxTransformPlume
				emission = 0.0 0.0
				emission = 0.05 0.0
				emission = 0.075 0.25
				emission = 1.0 1.25
				speed = 0.0 0.5
				speed = 1.0 1.2
				localOffset = 0, 0, 0.5
			}
			  
			MODEL_MULTI_PARTICLE
			{
				name = plume
				modelName = CryoEngines/FX/fx-skipper-plume-1
				transformName = fxTransformPlume
				emission = 0.0 0.0
				emission = 0.05 0.0
				emission = 0.075 0.25
				emission = 1.0 1.25
				speed = 0.0 0.5
				speed = 1.0 1.2
				localOffset = 0, 0, 0.5
			}
		}
		engage
		{
			AUDIO
			{
				channel = Ship
				clip = sound_vent_soft
				volume = 1.0
				pitch = 2.0
				loop = false
			}
		}
		flameout
		{
			PREFAB_PARTICLE
			{
				prefabName = fx_exhaustSparks_flameout_2
				transformName = thrustTransform
				oneShot = true
			}
			AUDIO
			{
				channel = Ship
				clip = sound_explosion_low
				volume = 1.0
				pitch = 2.0
				loop = false
			}
		}
    }
}

// Skipper Methalox
@PART[engineLargeSkipper_v2]:NEEDS[SmokeScreen,RealPlume,ReStock,CryoTanksMethalox,CryoEngines] //
{
    PLUME
    {
		name = Methalox_LowerShock
        transformName = thrustTransform
        localRotation = 0,0,0
        localPosition = 0,0,0.2
        fixedScale = 0.8
        energy = 1
        speed = 1
        emissionMult = 0.5
        alphaMult = 1

        flarePosition = 0,0,-0.2
        flareScale = 0.3

        plumePosition = 0,0,0.5
        plumeScale = 1.75

        fumePosition = 0,0,0.4
        fumeScale = 2

        blazePosition = 0,0,0
        blazeScale = 2.0
    }
}

 

 

Link to comment
Share on other sites

  • 2 weeks later...

I am having trouble configuring CryoTanks to use ChrisAdderley's patch on Githhub (https://github.com/ChrisAdderley/CryoTanks) under "Heating Effects"; I want the boiloff rate to be dependent on solar and body radiation. 

 

Do I have to apply this patch to every fuel tank I want to make use of the radiation-dependent boiloff or is there a way for this to apply whenever I use a tank with LH2 inside?

Apologies if this is a pain; I have only recently started dabbling in config files.

Link to comment
Share on other sites

3 hours ago, EimajOzear said:

I am having trouble configuring CryoTanks to use ChrisAdderley's patch on Githhub (https://github.com/ChrisAdderley/CryoTanks) under "Heating Effects"; I want the boiloff rate to be dependent on solar and body radiation. 

 

Do I have to apply this patch to every fuel tank I want to make use of the radiation-dependent boiloff or is there a way for this to apply whenever I use a tank with LH2 inside?

Apologies if this is a pain; I have only recently started dabbling in config files.

Try this patch. Copy and paste the following code into a text document, rename it to have the .cfg extension, and place it somewhere in your gamedata folder.

@PART[*]:HAS[@MODULE[ModuleCryoTank]]:FINAL
{
   @MODULE[ModuleCryoTank]
   {
      @Albedo = 0.5
      @LongwaveFluxAffectsBoiloff = True
      @LongwaveFluxBaseline = 0.5
      @ShortwaveFluxAffectsBoiloff = True
      @ShortwaveFluxBaseline = 0.5

      @MaximumBoiloffScale = 5
      @MinimumBoiloffScale = 0.001
   }
}

I haven't tested it, so there may be some minor syntax errors, but I believe the base concept is solid.

To explain what it is doing: 

@PART[*] will look to modify every part who's name matches * (* is a wildcard character, so every name matches it).

:HAS[@MODULE[ModuleCryoTank]] will refine that search to just parts with a module named ModuleCryoTank.

:FINAL tells module manager to apply this patch last, so no other patches overwrite it. (Technically any :FINAL patches lower in the file structure will load after and potentially overwrite this one, but FINAL patches generally aren't distributed but written by users, so unless you have a different patch elsewhere, that shouldn't be an issue.)

@MODULE[ModuleCryoTank] will modify the existing ModuleCryoTank module in each of the selected parts (every part with ModuleCryoTank). If no ModuleCryoTank is found, it would create a module of that name, but since we used the HAS to select only parts that already had a ModuleCryoTank, that shouldn't happen.

@Albedo = 0.5 This line will attempt to modify a key named Albedo within ModuleCryoTank to be equal to 0.5. If no such key exists, it will create one. The following lines preform the same function on the other keys that define boiloff from flux.

Note that the way this patch is structured will overwrite any existing flux boiloff keys in cryo tanks, and give every tank the exact same characteristics. I don't know if any of the tanks already define keys like albedo, a more elegant patch would check to see if any of these keys exist before modifying them, and apply different values that are more appropriate for different types of tanks. However this quick and dirty approach should provide basic functionality and give you a better idea of how patching parts works.

Edited by TBenz
Link to comment
Share on other sites

21 minutes ago, TBenz said:

Try this patch. Copy and paste the following code into a text document, rename it to have the .cfg extension, and place it somewhere in your gamedata folder.


@PART[*]:HAS[@MODULE[ModuleCryoTank]]:FINAL
{
   @MODULE[ModuleCryoTank]
   {
      @Albedo = 0.5
      @LongwaveFluxAffectsBoiloff = True
      @LongwaveFluxBaseline = 0.5
      @ShortwaveFluxAffectsBoiloff = True
      @ShortwaveFluxBaseline = 0.5

      @MaximumBoiloffScale = 5
      @MinimumBoiloffScale = 0.001
   }
}

I haven't tested it, so there may be some minor syntax errors, but I believe the base concept is solid.

To explain what it is doing: 

@PART[*] will look to modify every part who's name matches * (* is a wildcard character, so every name matches it).

:HAS[@MODULE[ModuleCryoTank]] will refine that search to just parts with a module named ModuleCryoTank.

:FINAL tells module manager to apply this patch last, so no other patches overwrite it. (Technically any :FINAL patches lower in the file structure will load after and potentially overwrite this one, but FINAL patches generally aren't distributed but written by users, so unless you have a different patch elsewhere, that shouldn't be an issue.)

@MODULE[ModuleCryoTank] will modify the existing ModuleCryoTank module in each of the selected parts (every part with ModuleCryoTank). If no ModuleCryoTank is found, it would create a module of that name, but since we used the HAS to select only parts that already had a ModuleCryoTank, that shouldn't happen.

@Albedo = 0.5 This line will attempt to modify a key named Albedo within ModuleCryoTank to be equal to 0.5. If no such key exists, it will create one. The following lines preform the same function on the other keys that define boiloff from flux.

Note that the way this patch is structured will overwrite any existing flux boiloff keys in cryo tanks, and give every tank the exact same characteristics. I don't know if any of the tanks already define keys like albedo, a more elegant patch would check to see if any of these keys exist before modifying them, and apply different values that are more appropriate for different types of tanks. However this quick and dirty approach should provide basic functionality and give you a better idea of how patching parts works.

Yikes, just to maybe add to this, you need to replace those @s for the values with %s. @ means 'modify', % is 'modify or create'.

Link to comment
Share on other sites

Thanks @Nertea, it works when I replaced the @ with %. Would applying the below config (in the spoiler) allow this new "dynamic" boiloff rate to produce hydrogen gas from the liquid hydrogen?

Spoiler

BOILOFFCONFIG
{
  FuelName = LqdHydrogen
  // in % per hr
  BoiloffRate = 0.05
  OUTPUT_RESOURCE
  {
    ResourceName = Hydrogen
    Ratio = 0.5
    FlowMode = ALL_VESSEL
  }
}

If so, would it be as simple as the previous patch by placing an additional CFG file in my GameData folder?
Thanks again

Link to comment
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...