Jump to content

[QUESTION] How to make radially attached LFO tanks work?


Starwhip

Recommended Posts

2ewyt6a.png

Trying to get my new plugin working, and the radial tanks are not being nice.

I added this to the plugin's .cfg that goes into the GameData directory:

@RESOURCE_DEFINITION[LiquidFuel]:Final
{
@flowMode = STAGE_PRIORITY_FLOW
}

@RESOURCE_DEFINITION[Oxidizer]:Final
{
@flowMode = STAGE_PRIORITY_FLOW
}

I based it off the logic that RCS tanks in such an orientation will power RCS thrusters.

The part config goes as follows:


PART
{
// --- general parameters ---
name = sphere_tank01
module = Part
author = Squad, Starwhip

// --- asset parameters ---
MODEL
{
model = Squad/Parts/FuelTank/radialRCSTank/model
scale = 1,1,1
}

rescaleFactor = 1

node_attach = 0.0, 0.0, 0.22, 0.0, 0.0, -1.0

// --- editor parameters ---
TechRequired = advFlightControl
entryCost = 6200
cost = 400
category = Propulsion
subcategory = 0
title = SACO Radial LFO Tank
description = Radially attachable LFO tank
manufacturer = Starwhip Aerospace Corporation

// attachment rules: stack, srfAttach, allowStack, allowSrfAttach, allowCollision
attachRules = 0,1,0,0,1

// --- standard part parameters ---
mass = 0.075
dragModelType = default
maximum_drag = 0.2
minimum_drag = 0.2
angularDrag = 2
crashTolerance = 12
maxTemp = 2900


// ----- DO NOT EDIT BELOW THIS POINT ------

RESOURCE
{
name = LiquidFuel
amount = 18
maxAmount = 18
}
RESOURCE
{
name = Oxidizer
amount = 22
maxAmount = 22
}
}

Help?

Link to comment
Share on other sites

SurfaceAttach Joints are not part of the stack, regardless of the configuration they have crossfeed disabled and there's only 1 way to fix that. The intent is that for any radial fuel tanks you would connect them with a fuel duct but NathanKell has found the time to make a plugin that implements a partmodule which enables crossfeed on surface attached joints for the parts with the prescribed cfg modification.

http://forum.kerbalspaceprogram.com/threads/76499-0-24-2-CrossFeedEnabler-v3-0-2-9-12-14

Link to comment
Share on other sites

Starwhip: First, it sounds like you're making a part, not a plugin. A plugin is something compiled to dll.

Second, you will not be able to find a stock solution (short of running fuel lines, 1 per radial part), because that's not how stock works: radially attached parts do not flow in. That is exactly why I had to make the plugin I did.

Link to comment
Share on other sites

Starwhip: First, it sounds like you're making a part, not a plugin. A plugin is something compiled to dll.

Second, you will not be able to find a stock solution (short of running fuel lines, 1 per radial part), because that's not how stock works: radially attached parts do not flow in. That is exactly why I had to make the plugin I did.

Ah. I thought as much, but I wasn't sure.

So, I guess it is a part (although not a model). And your plugin solved the problem.

What do modders use to make .dll files? Does their C# editor do it for them?

Link to comment
Share on other sites

Some thing weird I've noticed: The amount of fuel in the Oscar-B Fuel Tank seems to be off. If the Stratus-V R.M.T (The one I'm using in the custom part config) can hold 40 liters of MonoPropellant, it can then hold 18 liters of LiquidFuel and 22 of Oxidizer.

Logically, the Oscar-B tank should have a total volume that is greater than the S-V R.M.T. However, it has nearly four times less fuel than the Stratus-V capacity.

Are the developers trying to account for the cryogenic storage utilities that the fuel tank would contain? I don't think MonoPropellant would require this apparatus.

"I'm not overcomplicating things, I... well, maybe I am."

Link to comment
Share on other sites

First you need to understand that no resource in KSP has volume. There are no liters, the oscar B holds 18 Units of LF and 22 Units of oxy and that is the end of it.

Second you need to understand how poorly balanced the stock parts are; the oscar B contains around 30% less LFO relative to it's size than most other LFO tanks, it is an outlier in a statistic that is itself unreliable. Then you have to understand that there exists no standard for mod makers to balance their parts against, you're lucky if the part set is self-consistent but frequently they're just quantities lifted from stock parts.

Link to comment
Share on other sites

First you need to understand that no resource in KSP has volume. There are no liters, the oscar B holds 18 Units of LF and 22 Units of oxy and that is the end of it.

Second you need to understand how poorly balanced the stock parts are; the oscar B contains around 30% less LFO relative to it's size than most other LFO tanks, it is an outlier in a statistic that is itself unreliable. Then you have to understand that there exists no standard for mod makers to balance their parts against, you're lucky if the part set is self-consistent but frequently they're just quantities lifted from stock parts.

Right, there's an idea for an addon. A "Fuel Rebalance", based on the actual volumes of the parts. I've already calculated the volumes of a few parts, and if I use the liter as a unit of measurement I can go ahead and put the "correct" amount of fuel in each part.

Link to comment
Share on other sites

*whistles*

So, I wrote a program to find the liters of LF and OX that would be given for a specified height and diameter.

Here's the program:

#VOLUME FINDER
import math

#1 mL = 1 cm^3
#1 L = 1000 cm^3
#1 m^3 = 100cm * 100cm *100cm = 1,000,000 cm^3
#1 L = 0.001 m^3

while True:
radius = float(input("Diameter (m): "))/2 #in METERS
height = input("Height (m): ") #in METERS
volumeM = float(height) * (2*math.pi*(radius**2))
volumeL = volumeM / 0.001

volumeBase = volumeL / 2
OXIDIZER = volumeBase * 1.1
LIQUIDFUEL = volumeBase * 0.9
print("Oxidizer: "+str(OXIDIZER))
print("Liquid Fuel: "+str(LIQUIDFUEL))

And here's the result:

Diameter (m): 1.25
Height (m): 1
Oxidizer: 1349.9030933393644
Liquid Fuel: 1104.4661672776617

This is assuming 1 "unit" = 1 liter. A wee bit different than the FL-T200 we have now.

So, I believe I will use the quote-unquote "standard" unit of fuel measure in KSP: The Orange Tank Equivalent. If all fuel levels are based off of this part, then there will be some consistency.

And unless anyone else wants it, the .cfg which will modify the levels is going to be private.

Link to comment
Share on other sites

NEW CODE


#VOLUME FINDER
import math

#1 mL = 1 cm^3
#1 L = 1000 cm^3
#1 m^3 = 100cm * 100cm *100cm = 1,000,000 cm^3
#1 L = 0.001 m^3

#1 OTE = 2 Rockomax X200-32's = 4 X200-16's = 8 X200-8's (2.5 m by 1 m)
#Thus, OTE = 2.5 m by 8 m
#One OTE = ~78500 L
#One OTE = 2,880 LF + 3520 OX = 6400 LFO Units

OTE = (78539.81633974484 / 6400) #Exact volume of tank / LFO units

while True:
radius = float(input("Diameter (m): "))/2 #in METERS
height = input("Height (m): ") #in METERS
volumeM = float(height) * (2*math.pi*(radius**2))
volumeL = volumeM / 0.001

volumeBase = volumeL / (2*OTE)
OXIDIZER = volumeBase * 1.1
LIQUIDFUEL = volumeBase * 0.9
print("Volume (m^3): "+str(volumeM))
print("Volume (L): "+str(volumeL))
print("Oxidizer: "+str(OXIDIZER))
print("Liquid Fuel: "+str(LIQUIDFUEL))

So, I checked out the FL-T200 tank with the code above.

Result:


Diameter (m): 1.25
Height (m): 1
Volume (m^3): 2.454369260617026
Volume (L): 2454.369260617026
Oxidizer: 110.00000000000001
Liquid Fuel: 90.0

Diameter and Height are inputs, the others are outputs.

Then the Oscar-B:


Diameter (m): 0.625
Height (m): 0.5
Volume (m^3): 0.30679615757712825
Volume (L): 306.79615757712827
Oxidizer: 13.750000000000002
Liquid Fuel: 11.25

It needs some rebalancing.

Link to comment
Share on other sites

Not sure if I'm missing something, but that doesn't appear to be the correct formula for the volume of a cylinder.

This is the formula for a cylinder:

V = pi*r^2*h

I also find it a bit cheap to assume that 100% of the volume is equal the space for fuel, because that's unrealistic.

You could simply do something like d(2)=d-(y*z%) or directly d(2)=d*z% or even d(2)=d-y, then the same for h(2).

But that's just my opinion, simply ignore this above if you want.

Link to comment
Share on other sites

It's definitely not the right formula for calculating tank volume, alas. Tanks are pressure vessels, and KSP "tanks" of liquid fuel and oxidizer are in fact outer structure, and inside are two (usually) capsule tanks.. Note that how much of the cylinder is in fact used for tankage depends on cylinder length vs. diameter, it's not constant. Short, squat tanks like the FL 100 might be made up of a dozen very small capsule tanks, since were it to have only two, only about 50% of the volume would be utilized!

Link to comment
Share on other sites

Some thing weird I've noticed: The amount of fuel in the Oscar-B Fuel Tank seems to be off. If the Stratus-V R.M.T (The one I'm using in the custom part config) can hold 40 liters of MonoPropellant, it can then hold 18 liters of LiquidFuel and 22 of Oxidizer.

Logically, the Oscar-B tank should have a total volume that is greater than the S-V R.M.T. However, it has nearly four times less fuel than the Stratus-V capacity.

Are the developers trying to account for the cryogenic storage utilities that the fuel tank would contain? I don't think MonoPropellant would require this apparatus.

"I'm not overcomplicating things, I... well, maybe I am."

Already though of that.

Not sure if I'm missing something, but that doesn't appear to be the correct formula for the volume of a cylinder.

This is the formula for a cylinder:

V = pi*r^2*h

I also find it a bit cheap to assume that 100% of the volume is equal the space for fuel, because that's unrealistic.

You could simply do something like d(2)=d-(y*z%) or directly d(2)=d*z% or even d(2)=d-y, then the same for h(2).

But that's just my opinion, simply ignore this above if you want.

Whoops! I'll fix it now.


#VOLUME FINDER
import math

#1 mL = 1 cm^3
#1 L = 1000 cm^3
#1 m^3 = 100cm * 100cm *100cm = 1,000,000 cm^3
#1 L = 0.001 m^3

#1 OTE = 2 Rockomax X200-32's = 4 X200-16's = 8 X200-8's (2.5 m by 1 m)
#Thus, OTE = 2.5 m by 8 m
#One OTE = ~78500 L
#One OTE = 2,880 LF + 3520 OX = 6400 LFO Units

OTE = (39269.90816987242 / 6400) #Exact volume of tank / LFO units

while True:
radius = float(input("Diameter (m): "))/2 #in METERS
height = input("Height (m): ") #in METERS
volumeM = float(height) * (math.pi*(radius**2))
volumeL = volumeM / 0.001

volumeBase = volumeL / (2*OTE)
OXIDIZER = volumeBase * 1.1
LIQUIDFUEL = volumeBase * 0.9
print("Volume (m^3): "+str(volumeM))
print("Volume (L): "+str(volumeL))
print("Oxidizer: "+str(OXIDIZER))
print("Liquid Fuel: "+str(LIQUIDFUEL))

It didn't matter either way, because although the volume was 2 times larger, so was the volume of the OT that I used for conversion (78000 instead of 39000 or whatever.)

Edited by Starwhip
Link to comment
Share on other sites

There have been several projects in the past that attempted to do this, there's quite a wealth of considerations to draw from but it seems that nobody is really interested in following through

RealFuels (See Nathan's Signature) rebalances the quantities of all tanks with the assumption that a unit is a liter, also replaces the stock resources with what they're caricatures of

StupidChris's Stock Rebalance project attempts to bring the stats of lots of parts into some kind of logic, not hugely concerned with what a unit is as much as making things make sense where in the stock they're all over the place (see charts)

http://forum.kerbalspaceprogram.com/threads/75272

My Derived Voumetrics project, which is basically entirely abandoned, laid out a process for going straight to the part mesh and getting more accurate measurements of what the mesh is, and construct rational pressure vessel geometry to the goal of defining the volume of the quantity of resource in the part

http://forum.kerbalspaceprogram.com/threads/64566

And there was a long discussion about the geometry and math of pressure vessels in the early pages of Talisar's Spherical Tanks thread, mostly driven by Taniwha

http://forum.kerbalspaceprogram.com/threads/30673

I'm not saying any of these are perfect, but there are things to be learned if you think you're up to it

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