Skip to content

Change how tank masses are calculated#356

Open
Broheme wants to merge 8 commits intoKSP-RO:masterfrom
Broheme:master
Open

Change how tank masses are calculated#356
Broheme wants to merge 8 commits intoKSP-RO:masterfrom
Broheme:master

Conversation

@Broheme
Copy link

@Broheme Broheme commented Mar 14, 2026

Current method causes mass to increase with the cube (volume) of the tank, resulting in very high and unrealistic dry masses for tanks.

Proposed method calculates the wall volume of a hypothetical spherical tank, then multiplies the density of aluminum to calculate a more accurate mass profile.

@Broheme
Copy link
Author

Broheme commented Mar 14, 2026

Ignore all the readme commits, im new to this

@WithCrow
Copy link

This underestimates the dry mass - I point to a NASA sizing paper for more information.

If you turn this into the volume of a sphere based on the radius of the tank r and a cylinder of height h, where h is the total height of the tank - 2 * r and then multiply that by the density, you'll be a lot closer to how mass works IRL.

double radius = Math.Pow(OldVolume * 0.001 * 0.75f / Math.PI, 1f / 3);
// calculates volume of sphere slightly smaller 4mm in radius than the previous volume
//then converts from m^3 to L
double dV = 1.33 * Math.PI * Math.Pow((radius - 0.004), 3f) * 1000;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you converting to litres? Density is in kg/m³, not kg/L.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Liters because the value from oldVolume is the tank volume in liters, converting to m^3 allows me to find the radius, then I create a smaller volume using a slightly smaller radius, which gets converted back to L so that the difference can be found between the two volumes

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree the units I used aren't standard, this is just how I elected to do it on my first pass

additional mass savings as they progress, as if they are using better alloys
*/
double density_2195A = 0.00271;
//whyyyyyy does ksp use base units of tons bro (its not that bad)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This refers back to my above comment - aluminium density in tons/m³ is 2.685 tons/m³, which would be a lot nicer to read than converting from m³ to L and then using this small number.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ill take this into consideration when I work on it some more, this is effectively just tons/L, which is super unconventional but let's me multiply it directly with the new wall volume calculated before

@Broheme
Copy link
Author

Broheme commented Mar 14, 2026

I compared a tank with similar dimensions to the SLWT of the space shuttle and the Centaur III upper stage. Results were as follows:
Current Method:
SLWT dry mass: 26,536 kg
KSP procedural tank dry mass (8.6m D, 47m L): 409,521 kg
error: +1443.2%

Centaur III approx tank mass: 2247(Total Mass)-190 (RL-10C) = 2057 kg
KSP procedural tank dry mass (3.05m D, 11m L): 12055 kg
error: +486.0%

New Method:
SLWT dry mass: 26,536 kg
KSP procedural tank dry mass (8.6m D, 47m L): 27,395 kg
error: +3.37%

Centaur III approx tank mass: 2247(Total Mass)-190 (RL-10C) = 2057 kg
KSP procedural tank dry mass (3.05m D, 11m L): 1652kg
error: -17.1%
Note: Centaur 3 has a lot more mass due to guidance systems, hydrazine tanks, and RCS, increasing its overall dry weight, which I did not account for.

Considering this information, I believe the method I present is accurate enough and models real-life fuel tanks quite well in terms of mass. On the other hand, the current method seems catastrophic in the way it calculates dry mass. You may disagree with my method, but the numbers speak for themselves.

EDIT: SOURCES:
Atlas V Launch Services User’s Guide
FACT SHEET SPACE SHUTTLE EXTERNAL TANK

@periodically-makes-puns

Attempted to reproduce your findings using the numbers given. These screenshots should be accurate for the current RP-1 version (v4.2.0.0).

Centaur III stage (Modern Balloon Tank, filled with the RL10A-4-2N propellant mix.) The tank dry mass ends up at 1.12t without MLI, 1.29t with 100 MLI.
image

I couldn't exactly reproduce the shape of the SLWT, so I just made sure the bottom diameter and length matched, and tweaked the top diameter until the total wet mass roughly matched the wet mass of the SLWT in the source given. This is definitely not perfectly accurate. Dry mass reads 44.1t without MLI, 45.5t with 100 MLI.
(Conventional Al-Li Stringer Tank, filled with the RS-25C propellant mix.)
image

@Broheme
Copy link
Author

Broheme commented Mar 15, 2026

Thank you @periodically-makes-puns for the extra info!
I should have mentioned much, much earlier that I'm testing Realfuels and procedural parts in a stock-ish KSP game file, using Realfuels-stock configs. I imagine the other mods that come into RP-1 modify the end tank mass, making them much more realistic. I'll do some testing when I'm back home with just RealFuels, to make sure the other mods aren't the issue. I can also post the screenshots for the tank masses.
But it appears that the problem is with RF breaking stock tank masses.
It'd suck if the new way to calculate tank masses totally broke tanks for RO/RP1, so I'll also run a quick test on a new RO game file to make sure that doesn't happen when I get a chance.

@Broheme
Copy link
Author

Broheme commented Mar 15, 2026

Two discoveries:

  1. RealFuels-Stock Configs are to blame for the absolutely insane mass discrepancies, my bad g
  2. With no configs, the new method of calculating dry mass is still somewhat more accurate; the old method tends to undershoot (possibly as a way to compensate for larger tanks?)

New method (No Configs):

Centaur 3 mockup tank:
Centaur_3_newmethod

SLWT:

SLWT_newmethod

Old method (No Configs):

Centaur 3:
Centaur_3_oldmethod

SLWT:
SLWT_oldmethod

Conclusion:

The old method actually seems to under-report slightly for the Centaur 3, then proceeds to over-report for the SLWT. The new method isn't completely accurate, but it eliminates the issue of massive discrepancies in large tanks compared to IRL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants