Jump to content

[WIP] Nert's Dev Thread - Current: such nuke, wow


Nertea

Recommended Posts

On 1/10/2016 at 11:43 AM, Nertea said:

@Fraz86, maybe let me try another approach to communicate what I mean:

In a hypothetical scenario with an LFO engine and a LH2O with identical Isp, with the same fuel mass, I want the LH2O setup to perform 10% worse with lifting tanks. How do I achieve that?

The impact of dry mass on performance varies substantially depending on the specific characteristics of the craft, so it's difficult to give a generalized answer. That said, I played around with a Delta-V calculator and came up with the following numbers:

A craft with 4t LFO, 0.5t tank dry mass, 1.5t additional mass (engine + payload), and 300 ISP would have 3232m/s Delta-V. A craft with 10% worse performance would have 2909m/s Delta-V, which can be achieved if an extra 0.37t of dry mass is added to the aforementioned craft. In order for 4t LH2O to have a corresponding dry mass of 0.87t (i.e., 0.5t + 0.37t), massPerUnitLH2 needs to be 0.00006.

If you want ZBO tanks to have 20-30% worse performance, their massPerUnitLH2 needs to be at least 0.00012. As a point of reference, at a massPerUnitLH2 of 0.00007085, dry mass is equal to fuel mass.

-----------------------------------------------------------------------

Edit for new scenario:

For a lifter, results are slightly less severe. A craft with 80t LFO, 10t tank dry mass, 10t additional mass (engines + payload), and 285 ISP would have 4498m/s Delta-V. A craft with 10% worse performance would have 4048m/s Delta-V, which can be achieved if an extra 4.6t of dry mass is added to the aforementioned craft. In order for 80t LH2O to have a corresponding dry mass of 14.6t (i.e., 10t + 4.6t), massPerUnitLH2 needs to be 0.00004. ZBO needs at least 0.00008.

-----------------------------------------------------------------------

Edit for general commentary:

The basic issue is that LH2O tanks carry a relatively low mass of LH2 - only 12.4% of the tanks' total fuel mass. The other 87.6% of the fuel mass (oxidizer) has a known dry mass ratio of 8:1. Thus, in order for the small mass of LH2 to have a 10-30% impact on the performance of the craft as a whole, it needs to have an absurdly terrible dry mass ratio. For atomic rockets, 100% of the fuel mass is LH2, so the impact will be much more dramatic than 10-30%. As I see it, there are a few solutions:

  • Proceed with terrible dry mass ratios for LH2 (e.g., 0.00004-0.00006 for lifting tanks and 0.00008-0.00012 for ZBO). Buff atomic rockets accordingly (will require substantial buff).
  • Increase LH2:OX ratio for hydrolox engines and LH2O tanks (e.g., to 15:1). A larger proportion of LH2 would make it possible to hit the desired performance targets with less severe dry mass ratios.
  • Bring the performance targets closer to LFO. Performing 5-10% below LFO rather than 10-30% would require much less severe dry mass ratios.
Edited by Fraz86
Link to comment
Share on other sites

A correction for Hydrogen patch for RLA Stockalike: small nuke was renamed to "RLA_small_ntr" and it uses ModuleEnginesFX now.

Also, IMHO it would be logical to rotate 'Centi' tank models by 90 degrees so their strut structures would face surface attach area.

Link to comment
Share on other sites

2 hours ago, Fraz86 said:

The resulting performance relative to LFO, calculated based on the lifter scenario above, would be -8.3% and -17.2%, respectively.

At this point what incentive is there to use the LH2O engines over vanilla? They're high ISP engines. If they're performing 10-20% worse by delta V then what would be the reason to use these engines over stock?

Link to comment
Share on other sites

Thanks for the analysis. It's really great to have someone looking over this, as I totally don't have time to both develop and look at ramifications. I don't mind changing the mix ratio, that seems like it might solve a problem. As long as it's part of this exhaustive rebalance and redo, it should be okay to mess with things.

Link to comment
Share on other sites

1 hour ago, Captain Sierra said:

At this point what incentive is there to use the LH2O engines over vanilla? They're high ISP engines. If they're performing 10-20% worse by delta V then what would be the reason to use these engines over stock?

Sierra, we're discussing a baseline same ISP comparison. Cryoengine ISP is usually significantly more.

Link to comment
Share on other sites

@Nertea I've developed a new-and-improved spreadsheet, now with modifiable LH2:OX ratio and auto-calculation of performance vs LFO (pay no attention to the hilariously inelegant formula I used to derive this value). Keep in mind, I don't have a good way to account for the performance impact of higher drag created by LH2O's larger tank volume, so these numbers will overestimate relative performance in atmosphere. At this point I really would encourage you to play around with the input fields (highlighted in yellow) to get an idea of what feels right to you. I'd be happy to draft a new fuel-switching config once we decide on some values. Let me know if there's anything else I can do to help.

https://www.dropbox.com/s/r3ks6d367umfb9x/Fuel%20swithcing.xlsx?dl=0

Edit: When modifying LH2FudgeFactor or LH2:OX ratio, be sure to adjust mixOXProportion such that it is approximately equal to the predicted value listed to its right.

Edit 2: Additional data at the bottom of the spreadsheet.

afSRZky.jpg

Edited by Fraz86
Link to comment
Share on other sites

I had a thought regarding boiloff in mixed tanks.  For LH2OX tanks, the LH2 will boil off while the Oxidizer will not.  This leaves you with either (1) Extra Oxidizer when your LH2 runs dry, the exact amount depending on your flight time/burn characteristics or (2) A painstaking process of calibrating the amount of fuel, either by adding LH2 tankage or removing Oxidizer from the tanks until you get the right amount.

The solution I'm proposing is to calculate the boiloff rate based on only the cryogenic resources, but then proportionally distribute that boil off to all resources in the tank so that the ratio of remaining resources stays the same.  I think this is the sort of abstraction that makes sense in KSP - it retains the boiloff mechanic while removing the annoying details of exactly how much of each resource you need.

Link to comment
Share on other sites

27 minutes ago, blowfish said:

I had a thought regarding boiloff in mixed tanks.  For LH2OX tanks, the LH2 will boil off while the Oxidizer will not.  This leaves you with either (1) Extra Oxidizer when your LH2 runs dry, the exact amount depending on your flight time/burn characteristics or (2) A painstaking process of calibrating the amount of fuel, either by adding LH2 tankage or removing Oxidizer from the tanks until you get the right amount.

The solution I'm proposing is to calculate the boiloff rate based on only the cryogenic resources, but then proportionally distribute that boil off to all resources in the tank so that the ratio of remaining resources stays the same.  I think this is the sort of abstraction that makes sense in KSP - it retains the boiloff mechanic while removing the annoying details of exactly how much of each resource you need.

If this were implemented most people would just switch all their tanks to H2 only, and then carry the Ox in a separate tank that won't lose any. Ox would have to be given losses in all cases, which would then pose too many problems for regular LFOx setups. 

The extra Ox inefficiencies are minimal anyway. If you really want to make use of it, then it's an extra gameplay element or something. :rolleyes:

Link to comment
Share on other sites

44 minutes ago, Starbuckminsterfullerton said:

If this were implemented most people would just switch all their tanks to H2 only, and then carry the Ox in a separate tank that won't lose any. Ox would have to be given losses in all cases, which would then pose too many problems for regular LFOx setups.

The idea is that you loose the same amount of mass either way.

Link to comment
Share on other sites

23 hours ago, blowfish said:

I had a thought regarding boiloff in mixed tanks.  For LH2OX tanks, the LH2 will boil off while the Oxidizer will not.  This leaves you with either (1) Extra Oxidizer when your LH2 runs dry, the exact amount depending on your flight time/burn characteristics or (2) A painstaking process of calibrating the amount of fuel, either by adding LH2 tankage or removing Oxidizer from the tanks until you get the right amount.

The solution I'm proposing is to calculate the boiloff rate based on only the cryogenic resources, but then proportionally distribute that boil off to all resources in the tank so that the ratio of remaining resources stays the same.  I think this is the sort of abstraction that makes sense in KSP - it retains the boiloff mechanic while removing the annoying details of exactly how much of each resource you need.

That's an interesting idea. It simplifies things for the player, and it might not be exploitable or problematic if calculated correctly. Basically, each "tick," the amount of mass to be lost would be calculated based solely on the remaining LH2 in the tank, and then a combination of LH2 and OX totaling said amount (and with a ratio equal to the tank's contents) would be removed.

It should be noted that this would change the curve of boiloff, because the mass of LH2 would drop off less quickly (because OX is being lost in its place), and thus - due to the nature of exponential decay - the total mass loss rate would remain higher for longer. However, as things are now, a much greater mass of LH2 is required in the first place, and my intuition is that these two factors basically cancel each other out, but I haven't actually done the math yet. The other major consideration would be ISRU - this change might become undesirable if Nertea was planning for LH2 ISRU to be significantly different from OX.

22 hours ago, Psycho_zs said:

IRL reference for LH2OX ratios:

https://forum.nasaspaceflight.com/index.php?topic=9806.0

http://www.astronautix.com/props/loxlh2.htm

6:1 by mass is preferred as the most efficient. I hope, we wouldn't wander too far away.

The current unit ratio of 1:10 gives a mass ratio of 7.1:1. A unit ratio of 1:15 would give a mass ratio of 4.7:1. I'd say anything in that range is reasonably close to reality.

 

@Nertea I like the following:

  • ZBO massPerUnitLH2 = 0.00007085 (equal to LH2 density)
  • Lifting tank massPerUnitLH2 = 0.000035425 (1/2 LH2 density)
  • LH2FudgeFactor = 1.5 (same as before)
  • LH2:OX ratio = 12.5 (up from 10)
  • mixOXProportion = 0.4 (down from 0.45; necessary due to increased LH2:OX ratio)

Performance vs LFO is 90.1% for lifting tanks and 79.9% for ZBO. It should be noted that the ZBO fuel:dry mass ratio of 1:1 is still quite bad, and atomic rockets will need to be buffed. Also, higher LH2:OX ratio means higher tank volumes, so that should be kept in mind when balancing as well.

Here's a cleaned up fuel-switch config that adds unitsLH2PerUnitOX, removes massOffset for ZBO tanks (dry mass ratios will be uniform across tank sizes), removes the cost calculations we weren't using, and re-organizes a few other things:

// Lifting tanks
@PART[*]:HAS[@RESOURCE[LiquidFuel],@RESOURCE[Oxidizer],!MODULE[InterstellarFuelSwitch],!MODULE[ModuleEnginesFX],!MODULE[ModuleEngines],!MODULE[FSfuelSwitch]]:NEEDS[!modularFuelTanks&!RealFuels]
{
	%LH2FudgeFactor = 1.5 // <- EDIT HERE (effectively multiplies LH2 density by this number)
	%unitsLH2PerUnitOX = 12.5 // <- EDIT HERE (LH2:OX unit ratio; should correspond to usage of cryogenic engines)
	%mixOXProportion = 0.4 // <- EDIT HERE (proportion of tank volume containing OX; should approximately = 5.5 / [5.5 + [unitsLH2PerUnitOX / LH2FudgeFactor]])
	%dryMassPerUnitLH2 = 0.000035425 // <- EDIT HERE (dry mass per unit LH2 capacity)
	
	%LF = #$RESOURCE[LiquidFuel]/maxAmount$
	%OX = #$RESOURCE[Oxidizer]/maxAmount$

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

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

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

	// masses
	%massOffset = #$mass$
	%tempVar = #$totalCap$
	@tempVar *= 0.000625 // standard dry mass per units of LF/OX
	@massOffset -= #$tempVar$ // accounts for non-standard tank mass, which should remain constant across fuel configurations, e.g., extra mass for spaceplane tanks
	
	%onlyLH2mass = #$onlyLH2$
	@onlyLH2mass *= #$dryMassPerUnitLH2$
	@onlyLH2mass += #$massOffset$
	
	%mixLH2mass = #$mixOX$
	@mixLH2mass *= 0.000625
	@tempVar = #$mixLH2$
	@tempVar *= #$dryMassPerUnitLH2$
	@mixLH2mass += #$tempVar$
	@mixLH2mass += #$massOffset$
	
	!RESOURCE[LiquidFuel] {}
	!RESOURCE[Oxidizer] {}
	
	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$

		displayCurrentTankCost = true

		hasGUI = true
		showInfo = true

		availableInFlight = false
		availableInEditor = true

		basePartMass = 0
		tankMass = #$../mass$;$../mixLH2mass$;$../mass$;$../mass$;$../onlyLH2mass$
	}
	MODULE
	{
		name =  ModuleCryoTank
		FuelName = LqdHydrogen
		// in % per hr
		BoiloffRate = 0.025
	}
}

// ZBO tanks
@PART[*]:HAS[@RESOURCE[LqdHydrogen],!MODULE[InterstellarFuelSwitch],!MODULE[ModuleEnginesFX],!MODULE[ModuleEngines],!MODULE[FSfuelSwitch]]:NEEDS[!modularFuelTanks&!RealFuels]
{
	%LH2FudgeFactor = 1.5 // <- EDIT HERE (effectively multiplies LH2 density by this number; should be identical to LH2FudgeFactor for lifting tanks above)
	%unitsLH2PerUnitOX = 12.5 // <- EDIT HERE (LH2:OX unit ratio; should be identical to unitsLH2PerUnitOX for lifting tanks above)
	%mixOXProportion = 0.4 // <- EDIT HERE (proportion of tank volume containing OX; should be identical to mixOXProportion for lifting tanks above)
	%dryMassPerUnitLH2 = 0.00007085 // <- EDIT HERE (dry mass per unit LH2 capacity)
	
	%LH2 = #$RESOURCE[LqdHydrogen]/maxAmount$
	
	%OX = #$LH2$
	@OX /= #$LH2FudgeFactor$
	@OX /= 5.5

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

	// masses
	%onlyLH2mass = #$LH2$
	@onlyLH2mass *= #$dryMassPerUnitLH2$
	
	%onlyOXmass = #$OX$
	@onlyOXmass *= 0.000625

	%mixLH2mass = #$mixOX$
	@mixLH2mass *= 0.000625
	%tempVar = #$mixLH2$
	@tempVar *= #$dryMassPerUnitLH2$
	@mixLH2mass += #$tempVar$
	
	!RESOURCE[LqdHydrogen] {}
	
	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$
	}
	MODULE
	{
		name =  ModuleCryoTank
		FuelName = LqdHydrogen
		BoiloffRate = 0.025
		CoolingCost = 0.25
	}
}

 

Edited by Fraz86
Link to comment
Share on other sites

3 hours ago, Fraz86 said:

It should be noted that this would change the curve of boiloff, because the mass of LH2 would drop off less quickly (because OX is being lost in its place), and thus - due to the nature of exponential decay - the total mass loss rate would remain higher for longer.

Hmm, I hadn't considered that.  It might be a problem.

EDIT: I thought I had a solution but it turns out to not work.

Link to comment
Share on other sites

50 minutes ago, blowfish said:

You can actually modify the loss rates so that you loose mass at the same rate as with pure LH2, but maintain the correct ratio of resources.  The calculation looks a little odd but it works.

You'll have to elaborate. I understand that we could make LH2 and OX together lose the same amount of mass that is currently lost from LH2 alone, at a given point in time. But the loss rate needs to be calculated based on the amount of LH2 remaining in the tank. When all of the mass being lost is LH2 (as it is currently), the amount of remaining LH2 drops more rapidly, and thus the rate of loss also decreases more rapidly. However, in your model, most of the mass being lost would be OX. The total mass being lost at a given point in time would be the same, but only a small fraction of that mass would be LH2. Thus, the amount of remaining LH2 would drop more slowly, and the rate of loss would therefore remain higher for longer (because it's based on remaining LH2), resulting in a greater total loss over time for a given starting LH2O mass.

EDIT: Whoops, didn't see your edit.

Edited by Fraz86
Link to comment
Share on other sites

7 hours ago, blowfish said:

Hmm, I hadn't considered that.  It might be a problem.

EDIT: I thought I had a solution but it turns out to not work.

blowfish, I guess the simplest solution to your idea of distributed boil-off would be to change boiloff ratio for LH2 and LOX so it's the same. Then you could keep the remaining O:F ratio in check.

Personally I'm all for different boiloff ratio for LOX and LH2 as it adds interesting thing stuff to mission planning. Also in real world you can't burn all cryo fuel since some stuff is left in tank as residual substance so etc.

If the boiloff plugin is incorporated into fuel / texture switch this would be great:) (sorry not much time for testing)

Link to comment
Share on other sites

@Fraz86 I'll be testing those changes, they look promising but I'll have to see how it plays out with NTRs and ZBO tanks.

@blowfish, not sure I like that. As a player I would be confused if suddenly a fuel that I 'understood' was evaporating (particularly if it is only when it is in a tank with LH2), vs a new fuel type that can be considered an unknown quantity. That being said the boiloff plugin is pretty configurable and could probably do separate boiloff rates easily. 

I also finished up the modeling, unwrapping and blocking out of the texture for the 1.25m trimodal NTR. I'm pretty pleased with it as the plumbing is totally rad. That just leaves 2 planned engine models (and texture work on the 2 trimodals) before I complete the model-related goals.

Link to comment
Share on other sites

8 hours ago, Fraz86 said:

You'll have to elaborate. I understand that we could make LH2 and OX together lose the same amount of mass that is currently lost from LH2 alone, at a given point in time. But the loss rate needs to be calculated based on the amount of LH2 remaining in the tank. When all of the mass being lost is LH2 (as it is currently), the amount of remaining LH2 drops more rapidly, and thus the rate of loss also decreases more rapidly. However, in your model, most of the mass being lost would be OX. The total mass being lost at a given point in time would be the same, but only a small fraction of that mass would be LH2. Thus, the amount of remaining LH2 would drop more slowly, and the rate of loss would therefore remain higher for longer (because it's based on remaining LH2), resulting in a greater total loss over time for a given starting LH2O mass.

EDIT: Whoops, didn't see your edit.

Yeah.  It ends up being possible if you know initial conditions or how much time has elapsed, but that information is lost once you start boiling off.  Theoretically, the boiloff module could keep track of this, but that sounds risky and counterintuitive to how boiloff should work.

Link to comment
Share on other sites

46 minutes ago, Nertea said:

@blowfish, not sure I like that. As a player I would be confused if suddenly a fuel that I 'understood' was evaporating (particularly if it is only when it is in a tank with LH2), vs a new fuel type that can be considered an unknown quantity. That being said the boiloff plugin is pretty configurable and could probably do separate boiloff rates easily. 

Fair enough, it was just an idea and it seems to be having more problems than I originally thought.  As long as boiloff is small over the course of a few hours it probably doesn't matter that much.

Link to comment
Share on other sites

All of my stuff is permissively licensed, and typically modular enough that anyone can use it. For this plugin it's very simple and easy:

MODULE
{
	name = SimpleBoiloff
	FuelName = LqdHydrogen
	// in % per hr
	BoiloffRate = 0.06
	// in Ec per 1000 units per second
	CoolingCost = 0.10
}

You put the name of the fuel to be boiled in FuelName. Multiple fuels are not supported at the moment, but several SimpleBoiloff modules can exist on a part with no problems. BoiloffRate is specified in % per hour, so with a rate of 0.06, 0.06% of a fuel tank will boil off every hour. If a fuel has no CoolingCost specified, it will always boil off, but if CoolingCost is specified, it will use EC to insulate itself and avoid boiloff. EC cost is specified per 1000 units, so if a CoolingCost of 0.5 is specified and a tank has 10 000 units of fuel, it will cost 5 EC/s to insulate.

Edited by Nertea
Link to comment
Share on other sites

Thanks, Nertea! Maybe get everyone on the same boat like with the resources themselves.

BTW, how does this work in the background, ie when ships are on long trips and not in focus? Is that handled by the plug-in?

Edited by Jimbodiah
Link to comment
Share on other sites

18 minutes ago, Jimbodiah said:

Thanks, Nertea! Maybe get everyone on the same boat like with the resources themselves.

BTW, how does this work in the background, ie when ships are on long trips and not in focus? Is that handled by the plug-in?

He mentioned earlier that it basically cheats. It determines how much fuel should have been lost while the vessel was unfocused and subtracts that quantity all at once on load.

Link to comment
Share on other sites

@Nertea Given that we're conducting an exhaustive overhaul, I would again like to advocate for conforming CryoTank volumes to match the volumes of their corresponding stock tanks. This would hold several significant advantages:

  • Side-by-side comparison of ZBO vs lifting tank characteristics would be much easier and more transparent for players.
  • Volume relationships between tanks would be more intuitive and amenable to mental math (2x length = 2x volume, 2x diameter = 4x volume).
  • CryoTank volumes would be more in-line with players' expectations based on their experiences with stock tanks.
  • Values for fuel units and masses would be more rounded (terminating decimals with only a few significant digits) across all fuel configurations, making these numbers more stock-alike and more readable (especially if we also round off dryMassPerUnitLH2, e.g., to 0.000035 and 0.00007).
  • With volume-matched stock tanks as a point of reference, it will be easier to set appropriate costs for CryoTanks (costs are otherwise difficult to set in a consistent fashion, as the costs of stock tanks don't obey any specific formula).
  • The current volumes of CryoTanks are already pretty close to their stock counterparts, so this change would not represent a huge deviation from your model-based volumes.
Edited by Fraz86
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...