KSP-RO / RealismOverhaul

Multipatch to KSP to give things realistic stats and sizes
374 stars 279 forks source link

Feature Request: Support for Universal Storage #9

Closed pjf closed 10 years ago

pjf commented 10 years ago

Universal Storage is a set of gorgeous parts, including a fuel cell, which I very much want to use with RO.

Changes required:

I know that Paul has been using this table (which he prepared, because he's awesome) to figure out various conversions, so I suspect that for storage a lot of the values will be close to what we need. I also know the fuel cell is based upon the Apollo era ones and has a "real" output of about 528W (let's say about 0.5EC/sec).

For converting LOX into O2, I suggest we add that functionality to the cores (scaffolding) itself. This means any existing designs are still suitable for O2 life support, without adding actions to oodles of parts.

pjf commented 10 years ago

I'm doing these changes now.

Is there an MFT definition that supports LOX, LH2 and Water? Because that would be really handy right now. :)

~ pjf

pjf commented 10 years ago

I've got a work in progress that should do everything we want here. However I haven't yet tested it. :)

RedAV8R commented 10 years ago

Oh no...I just did one too..Figuring about 1/6 that of what Apollo did, and it appears Elektron is about 1/6 of what the ISS is.

pjf commented 10 years ago

@RedAV8R : Sweet! We can compare notes! :)

pjf commented 10 years ago

@RedAV8R : Mine (linked above, but still untested as I've been out) is designed to be balanced insofar that 1 LOX tank + 1 LH2 tank = 1 water tank, and 1 Fuel cell is enough to support 1 kerbonaut in water (and 500W). The fuel cell output can be tweaked with a single number change (TACLS generators have a neat scaling factor), and will stop operating if the water tanks fill.

RedAV8R commented 10 years ago

I did like what you did with the actual hubs, and allows any vessel to use the LOX as Oxygen.

Volume. I basically did this..if you read the texture of the tanks, both the H2 and O2 are indeed LOX and LH2...seems we both agree on that. So then I looked at the physical size of the objects...tanks 0.2m diameter with rounded ends total length of 0.35m...so volume would be a 0.2m diameter sphere plus a 0.2m diameter cylinder that is 0.15m long. if tank was paper thin volume would be just under 9L now obviously a LOX tank won't be paper thin so i figured 8L would be a good compromise for it.

Water has 4 tanks, LOX has 4 tanks (I've corrected this, silly me now 32=4*8), and the LH2 tank is a sphere that is 0.4m in diameter giving 33.5L of volume...again that's paper thin, so hey look, that's close to 32L let's use that:)

The radial...yes the description reads low pressure gas...so we can use the standard oxygen tank for it, which would be an oxygen tank pressurized to ~3000psi, giving us 1600L of usable oxygen (LOX would have given almost 7kL). I'll make that change.

This is Realism Overhaul, so I'm not making tanks that visually can only hold 8-9L hold nearly twice that. Nothing in RO has done that for 'balance', and we aren't going to start.

The reason for MFT is that nearly everything, and maybe everything does use it, so why stop, and bonus it does boil-off simulation. Right now just using ServiceModule TANK_DEFINITION, but it wouldn't hurt, and be easy enough, to use a newly created one simply for UniversalStorage.

The conversion to use TACConverters is a good idea if I'm not mistaken because it handles being on rails better.

RedAV8R commented 10 years ago

Like I said, I've taken the Apollo SM which contained 3 units, and taken values 1/6 of that to represent just 1/2 of one of the 3 units.

The elektron was a test. The ISS, 1kg=1L of water is broken down into 25L of O2 with H2 being dumped overboard every hour. Giving 600L of O2 every day, just over the requirement for 1 person...of course the unit is capable of a lot more...using 6kg=6L of water and generating 150L of oxygen an hour or 3600L a day, enough for 6 people...that's normal operation...max operation is up to 10L of water into 250L of oxygen an hour. Since the unit is approximately half sized from the real thing, I figure we can halve that normal operation capacity...so 3L of water to 75L of oxygen per hour. 72L of water to 1800L of O2 per day. Power consumption for the unit is 1kW so half will be 0.5kW.

pjf commented 10 years ago

So then I looked at the physical size of the objects...

Oh my! You measured the tanks! You rock! I don't have facilities to read the models directly, so I've been eye-balling them, and using the original part config as a guide. You rock. :)

The radial...yes the description reads low pressure gas...so we can use the standard oxygen tank for it, which would be an oxygen tank pressurized to ~3000psi, giving us 1600L of usable oxygen.

I never did any calculations on the radial oxygen; I'm glad you did, because the original amount was wildly unrealistic.

This is Realism Overhaul, so I'm not making tanks that visually can only hold 8-9L hold nearly twice that. Nothing in RO has done that for 'balance', and we aren't going to start.

Oh no, I'm not suggesting you should! I am interested in making sure the tanks make sense from a mission design standpoint. If the fuel cell uses LOX:LH2 in a 4:3 ratio, then it would make sense for the tank volumes to match that. A quad-core consisting of 1 each of a fuel cell, LOX, LH2, and water wedges is a natural design, and off 40 litres of LOX would run for about 14.7 days, or a two week mission, which is Apollo length plus a generous safety buffer. However it would leave 8 litres of LH2 left over at the end.

I know MFTs can do nifty things when engines are installed (allowing them to be loaded up with pre-set fuel mixes); can we put some sort of selector functionality on the LH2 tanks which would allow them to be filled to 32 litres (suitable for a 4 LH2, 3 LOX, 1 FC long-haul configuration), or 24 litres (suitable for a 1 LH2, 1 LOX, 1 FC fortnight configuration)?

Like I said, I've taken the Apollo SM which contained 3 units, and taken values 1/6 of that to represent just 1/2 of one of the 3 units.

Awesome, I like this. :)

The reason for MFT is that nearly everything, and maybe everything does use it, so why stop, and bonus it does boil-off simulation. Right now just using ServiceModule TANK_DEFINITION, but it wouldn't hurt, and be easy enough, to use a newly created one simply for UniversalStorage.

Sweet. I don't want people filling US tanks with ElectricCharge (currently possible with them being ServiceModules), so I might define some tanks for this. That would also mean the water wedge could be configured to hold a combination of Water and WasteWater (if RO doesn't already have a LS Water tank defined).

The conversion to use TACConverters is a good idea if I'm not mistaken because it handles being on rails better.

TAC Converters are amazing, especially because they can be configured to not "overfill" resources (eg: stop producing O2 if levels are already full), or to dump resources if no space is available (we could have the Elektron vent H2 if there's no storage for it).

I'm working on some finishing slides for a talk I'm giving next week, but I'm happy to send through a pull request later today with changes (documentation, TAC Converters, tank definitions, etc).

Keep being amazing, and thank you!

~ pjf

RedAV8R commented 10 years ago

Well...measured in the sense of made a PP tank as close as possible to the size of whatever I was measuring. Not a perfect system, but it gets damn close.

I'm actually less interested in making sure tanks represent input/output of the fuel cell or elektron and rather keep sizes to what they actually are. For example your hypothetical 4:3 ratio..wanting tanks to match this...I can't realistically do this. Sure it makes things easy, but space isn't easy:)

As it stands with the Service Module tank type, pretty much anything can go in the tanks, it'll be preset with whatever it should be, but a person can go in and change it to whatever they want, just can't bust the 32L limit. I will go through though and add some new tank definitions appropriate to what they should be so nobody goes and adds ElecCharge to something.

I'll start making the changes and issue a new release (should be alpha5) tonight.

pjf commented 10 years ago

Ah! In which case can we have the hydrogen tanks default to 24 litres of LH2, with 32 litres capacity? That means they work out of the box for a short mission design standpoint, can be filled for a long-haul mission configuration using 4:3 tank ratios with no break in realism. :)

pjf commented 10 years ago

Aha! 32 litres LOX + 32 litres LH2 gives ~ 12 days of running time, but leaves 8 litres of LO2. That's breathing gas for... 12.5 days! That make sense from a mission design standpoint, so I withdraw my suggestion of doing wacky fills with the LH2 tanks. :)

pjf commented 10 years ago

And now I see why I'm confused! The fuel cell comes with 8 litres of LOX, and 6 litres of LH2, but consumes more Hydrogen than oxygen, so these should be swapped.

The model definitely shows the oxygen tank being bigger, but that doesn't make sense at all for a fuel cell. I would argue that the labels are switched and change the cell to have 6 litres of LOX, and 8 litres of LH2.

(We can also report this upstream to get the textures flipped for the next version of US)

RedAV8R commented 10 years ago

Exactly, keep tanks completely full at all times, generally you'll have more O2 than H2 due to ECS requirements. So what if the fuel cell comes with more O2 than H2, yes the fuel cell does consume more H2, BUT...let's look at this...8L of LOX and 6L of LH2...the H2 is consumed in about a day and a half, leaving roughly ~3.5L of LOX remaining...which is good for ~2964L of O2...allowing 1 person to survive for not quite 5.5days...what if there are 3 people though suddenly now it's a bit over 1.5 days...seems the tanks in the fuel cell are just fine too:)

pjf commented 10 years ago

@RedAV8R : Okay, the large LOX tank in the fuel cell makes sense if we're going with the design of them supplying breathing gas as well as fuel. I'll rebase out my swapping from my branch. :)

NathanKell commented 10 years ago

By volume, a fuel cell will use just over 2x as many liters of LH2 as LOX. So I think having 5 extra liters of LOX is really a bit much. Besides, my understanding of this part was that it was just a fuel cell, not a combined fuel cell + O2 storage unit. Honestly, I'd say the best bet at this point is to talk to the part maker and ask if they can do up a version with realistic proportions of LOX and LH2.

pjf commented 10 years ago

I've asked Paul if he can drop by here and give some feedback. :)

pjf commented 10 years ago

My pull request is in! See #11 for joy. :)

Paul-kingtiger commented 10 years ago

Hi guys, Reading through I might be able to help you with the numbers. First up, I'm publishing all my stuff online at http://1drv.ms/1tKi3f3

The main thing you'll be interested in is Resources research. It contains multiple tabs, although excel online sort of hides them. At the bottom right of the page is an ... icon, keep clicking on that to reveal the extra tabs.

Anyway, I did some research on real world storage for compressed gasses, and some theoretical values for cryogenic liquids, based on the properties of the molecule. I found that, for example, liquid O2 is 798 times as dense as O2 at STP.

For the values in the parts, I measured the tanks in the models then used that to work out how much could be stored. In the O2 part there are 4 tanks and each has a volume of ~14.5l so the total is ~58l. Because the O2 is stored as LOX I then multiplied that value by 798 to get the capacity.

What I haven't done yet, but will be included in the next (0.75) release, in time for KSP 0.24, is account for the thickness of the tank and thermal insulation. I currently have values for compressed gas tanks, and it's ~60% of the external volume is available for resource. I know that seems really low but all the data I have supports it and I assume thats because the tank isn't filled to the brim. Until I have more complete data I'm going to assume the same value for cryogenic liquids. Uncompressed stuff like water and food will have a higher ratio.

So first up, I recommend waiting for the 0.75 release with the new capacities. Then if you want to convert the resource to cryogenic liquids simply divide the capacity by the following:

LOX - 798 LH2 - 790 LCO2 - 389

For the fuel cell, it's been balanced to match one of the Apollo cells, so 1/3 of the total Apollo output. You'll also have to divide the inputs by the value above to match.

The elektron is also balanced to match the ISS and you'll need to divide the outputs by the above (the power requirements includes the equipment to liquify the outputs to LOX and LH2).

Talking of power, I balanced everything to 1 unit = 33 watts, which I based on the mean of the stock solar panels compared to the ISS panels (trying to get the same power per sqft). My aim was to make sure that the power requirements and generation of US parts was balanced with the stock options, so they'd work alongside and not replace.

pjf brought up the strange tanks built in the fuel cell, it's based on the part model which doesn't have the right sized tanks to provide the correct ratios. This might change when I rebalance everything for 0.75

Finally I'm publishing everything so that people can use the research but also so people can check my figures and help me with anything I've missed, so if you spot some mistakes or have some sources that support different values please let me know so I can review. Best place to catch me is on the US thread in the KSP forums.

RedAV8R commented 10 years ago

@Paul-kingtiger, I appreciate the input. A couple things that are on my hit list...could you please tell me what the dimensions of your tanks are. While my measurements are crude, I'd like to know what they really are (or supposed to be). I'd also like to ask why you have simply gone by density to determine expansion ratio, when the measured expansion ratio of LOX is 860-861. I kind of laughed when if the tank has a volume of 14.5L...8L is 55%:)

I understand the balance of being 1/3 total Apollo output, but when the model is ~1/2size of what 1 Apollo fuel cell is my reason for making fuel cell 1/6 of my Apollo figures. Again your Elektron model is roughly 1/2 size of an ISS unit so I'm taking half of what the ISS unit can do.

When it comes to tanks in the fuel cell model, a fuel cell doesn't have ANY tankage, just feed lines from tankage, so why is it even being discussed, i don't know. Think of the fuel cell as just a fuel cell and oh, this model has some tankage too, which just so happens can supply 1.5 days of power, and enough oxygen to a crew of 3 for the same time.

@NathanKell , my research into a fuel cell basically is the fact that power consumption kind of drives what a fuel cell makes, and rates are not linear on usage vs output. I'd like to know how/where you got the figure of using ~2:1 ratio. The rates in my Apollo config uses actual Apollo data.

Paul-kingtiger commented 10 years ago

Tank size:
The O2 and CO2 tanks have an external volume of 14.5l per tank (4 in the model) The H2 tank has an external volume of 33.5l.

For the expansion ratio, I didn't have that data. I've updated Oxy and Hyd. Do you know the expansion ratio for liquid CO2. Also the Oxygen wedge model is likely to change in 0.8, just a heads up.

Tanks in the fuel cell. We wanted to include some tankage in the wedge because as a basic part in the core pack we wanted it to be usable by itself.

pjf commented 10 years ago

@Paul-kingtiger: You so rock. Have I missed CO2 tanks in the current version of US, or are we implying that the O2 wedge could be configured with half LOX and half CO2 tanks? (We could do the same with water; half waste, half fresh.)

For the record, I like having the FC usable as a stand-alone unit too. :)

My understanding is that MFT already has goodies for figuring out utilisation based upon tank size and contents, although I'm not sure that we're using it for the US wedges. We probably should be; it's not like rockets don't use LH2/LOX elsewhere. :)

Paul-kingtiger commented 10 years ago

There is a separate CO2 wedge. It currently used the same model as the H2O and O2, although O2 is changing to a new twin spherical tank model.

The CO2 capacity is going to change in 0.75 to compressed gas (124 BAR), so the capacity will be less that it currently is.

When the TAC pack comes out there will be separate wedges for water and waste water.

pjf commented 10 years ago

@Paul-kingtiger: Oh! I totally failed to install the ECLSS pack because I was using TACLS, but I don't see why we can't have tweaks to convert it to RO+TACLS if it is installed. :)

You've mentioned 0.75, is there a 0.74 that I've somehow missed? (I've got 0.71, which is mentioned in the KSP forum thread.)

Thank you again so much for all your help. I really do appreciate it! :)

Paul-kingtiger commented 10 years ago

Nope, it's going 0.71 to 0.75 as this is a minor update, mostly an art pass. 0.8 will be the next major release

RedAV8R commented 10 years ago

@Paul-kingtiger No, I was referring to actual dimensions of the tank. The measurements I got, while somewhat crude I'll admit, is a cylinder with hemispherical ends that is 0.35m tall by 0.2m in diameter. Even a straight cylinder with those dimensions would be 11L, with hemispherical ends that is even less. Being that my measurements of the LH2 sphere is spot on with what you have (33.5L) which due to insulation and what not I dropped to 32L, I wouldn't think my other measurements would be THAT far off (~9L dropped to 8L for insulation) vs. 14.5L.

LOX->O2 = 860-861 LH2->H2 = ~850 LCO2->CO2 = 450

To me, adding the tankage to the fuel cell model for use with only that part seems logical, and the math to me supports the size of tanks as well.

@pjf , I've looked at the ELCSS and while we COULD use the parts..The biggest issue is a MM file that is installed that changes CarbonDioxide to CO2..which then causes all sorts of headaches with TACLS

@Paul-kingtiger, is there a reason why you are doing this??? /\

I could tell people to delete the file or but I'm not going to account for it to change things, then change things back etc. Too much hastle for a mod that SHOULD NOT be installed with RO...I need to specify that in the Readme and OP.

Paul-kingtiger commented 10 years ago

Ah, I see. My measurements have the O2 tanks with a radius of 0.12 meters and a length of 0.4 meters. Although I've just retaken the measurements and am going to revise the diameter down to 0.1 meters to give 10.5 liters.

I've also updated the spreadsheet shared above.

RedAV8R commented 10 years ago

@Paul-kingtiger um...maybe the radius down to 0.1m;) I hope not the diameter to 0.1m;)

Are you sure about the length? Just the tank, no additional pipes or anything???

Paul-kingtiger commented 10 years ago

Yep sorry Radius, end of a long day. Tank length, is the same as the wedge height which is .40

RedAV8R commented 10 years ago

@Paul-kingtiger Figured as much;)

Ok, I'm going to press this, but I don't see length being 0.4m, I will agree wedge height is 0.4m, and this is confirmed by the config itself for the hub, but each tank has either piping on the top or the bottom..therefore if height of wedge = 0.4m, if pipe is observed on the top or bottom, the tank can not = 0.4m. Be the tank 0.35m or 0.36m I don't care, as long as one recognizes that it can't be 0.4m.