Welcome to Keen Software House Forums! Log in or Sign up to interact with the KSH community.
  1. You are currently browsing our forum as a guest. Create your own forum account to access all forum functionality.

Mod for fueled Thruster enthusiasts - Theorycrafting

Discussion in 'Modding' started by Cronos988, Oct 25, 2015.

Thread Status:
This last post in this thread was made more than 31 days old.
  1. Cronos988 Junior Engineer

    Messages:
    545
    Hey everyone,

    so with the latest patch we finally got thrusters that require fuel - Yay! Unfortunately, Keen is envisioning these as "only afterburnders" that occupy a spot between the no-fuel atmospheric thrusters and the no-fuel ion thrusters for very limited applications. I don't like that.

    Luckily, modifying the system via CubeBlocks is easy even if I can't model, so it should be possible to turn the hydrogen thrusters into our main source of propulsion and therefore get more interesting (in my mind, anyways) gameplay. Here is how I intend to do that:

    • Hydrogen thrusters will become more efficient. The current consumption rate is too high to be any good for gameplay if used as your main source of propulsion, so it needs to go down quite a bit.
    • I will try to balance the TWR, ISP and overall thrust of the hydrogen thrusters based on real world examples as well as their actual relative sizes, with some generous extrapolations to account for advanced technology and the needs of gameplay
    • The old Thrusters will be relegated to the role of maneuvering thrusters. Their advantage will be no fuel consumption and no thruster damage - in effect turning them into some sort of miniature gravity drive. That way, they will remain relevant as you can do many things with them that you cannot do with the "real" thrusters, but they won't be useful as main drives. Turning them into some kind of gravity drive also explains why they don't require fuel.
    • As with the hydrogen thrusters, I will also balance the normal thrusters among themselves so that larger thrusters have proportionate amounts of thrust and weight, with economy of scale factors for both TWR and energy consumption.
    What do you guys think of these ideas? Anyone else excited about having "real" thrusters instead of just electricity?
     
  2. Tristavius Senior Engineer

    Messages:
    1,368
    I suspect it's more a case of they are designed for lifting heavy payloads or getting out of particularly deep gravity wells rather than spaceborne applications. Having played with them, I can see few cases I would use them on a regular starship... the volume of parts needed is too large for smaller capital ships which would benefit from low-power high-thrust solutions and they just don't add that much to larger capital ships (and are as you say, far too inefficient for that).

    Very exciting though that we may soon have alternative options. I intend to play with the API soon and see whether we are at the stage that an entirely new fuel type can be produced (from refinement to storage and drive usage).
     
  3. Iskaroth Trainee Engineer

    Messages:
    18
  4. GotLag Senior Engineer

    Messages:
    1,114
    Is it currently possible to make thrusters use power and hydrogen? I've had a quick look through CubeBlocks and it appears to be one or the other. I've been thinking about a quick balance mod to make hydrogen thrusters use less fuel but also a bit of power, to make them a viable alternative to ions but not outright superior in all applications.

    Also they don't make sense as power-less hydrogen burners as there's no oxidiser.
     
  5. Cronos988 Junior Engineer

    Messages:
    545
    There is no difference in the configs save for the <FuelConverter> entries. Given the name I would think whenever a thruster has that flag set, it converts it's power consumption into whatever fuel is given, at the given efficiency value.

    You're correct that the current system makes little sense. I initially assumed they would use both power and fuel, but they appear not to.

    In any event it's not easy to balance them. I am currently looking for a sweetspot where they are cheap enough to have an application, yet not so cheap as to eliminate fuel as a concern. The issue is that there is very little room for different thrusters within a speed limit of just 104m/s. Acceleration times matter very little for most applications.
     
  6. GotLag Senior Engineer

    Messages:
    1,114
    I find the acceleration matters a lot. By swapping the ion thrusters for hydrogen on my drone carrier I was able to use a few small reactors instead of one large, and the increased thrust means that lateral and vertical movement (relative to the cockpit) is actually responsive.

    And more importantly, they look way cooler:
    [​IMG]
    [​IMG]
     
  7. Cronos988 Junior Engineer

    Messages:
    545
  8. GotLag Senior Engineer

    Messages:
    1,114
    I see where you're going but I guess I would be reluctant to tinker too much with ions. If I made any change to those it would be to reduce only large ship ions 3x but leave energy usage untouched (undoing the buff part of 1.095 but leaving the 6x energy increase intact).

    I've been thinking of my own balancing mod but that depends on finding (or being given) a way to make hydrogen thrusters use power and hydrogen. That would give a lot more freedom for tweaking usage while maximising compatibility with other mods.

    Edit: It's also worth noting that the battery changes are a hidden but significant buff to ion thrusters - you can trickle charge them while idling and they'll kick in for thrusting, meaning you don't have to have enough reactors to run all your thrusters any more. True you could use batteries before but you had to remember to switch modes, and then when they started recharging you'd overload.

    Edit 2: I think the hydrogen tank capacity buff was a step in the wrong direction. It's not that tank capacity is too low, it's that current thruster hydrogen usage is ridiculously high. Also the hydrogen configuration has a significant error, as indicated by the comment in the file: the figure given is specified as megawatt-hours but the game treats it as megajoules (i.e. megawatts-per-second), so consumption 3600 times higher than the numbers would suggest.
     
    Last edited: Oct 30, 2015
  9. entspeak Senior Engineer

    Messages:
    1,744
    I've been trying to base H2 on real world data, but testing it currently is impossible for me. There is, currently, no way to accurately determine what a unit of H2 in-game means in terms of kg of H2. This is because H2 generation is wildly inconsistent and doesn't make sense. It's also impacted O2 generation which has become wildly inconsistent and no longer operates the same (even though the IceToGasRatio didn't change). If you're generating H2 and O2, for no apparent reason, you get significantly less of both gasses then if you generate each gas on its own.

    Where did you get real-world hydrogen consumption data for thrusters? How did you come up with your figures?
     
  10. Cronos988 Junior Engineer

    Messages:
    545
    I didn't actually use real numbers yet, I decided to try some basic settings in actual gameplay first.

    That said, I found some numbers for typical rocket engines here:
    http://www.lr.tudelft.nl/en/organis...n/design-data/performance-and-operating-data/

    The only pure LH2 engines are thermo-nuclear, which are given at the bottom. They have a specific impulse between 800 and 900 second. Let's assume we have even more effective engines at an ISP of 1000 seconds. That means for 1000 Newtons of thrust, an engine should consume 0,1 kg of liquid hydrogen.

    The "standard" density of LH2 appears to be ca. 0,71kg/L. So we are at 0,14 L/s for each kN of thrust.

    The in-game consumption of a thruster is simply it's power consumption divided by the energy density as defined in "GasProperties", so 0,001556. So for each kN of thrust, a thruster should consume 0,000218 MW of energy, at an efficiency of 1. The standard small/small thruster has 82 kN of thrust, so should use 0,0179 MW of energy.

    Which actually happens to be exactly what it uses in vanilla. So, the thrusters seem to actually be realistic.
     
  11. entspeak Senior Engineer

    Messages:
    1,744
    This is very helpful, thanks! So, 1000 N of thrust consumes .1kg of H2 per second? From this, I should be able to time how long it takes to empty a tank and get kg H2/unit. From there, I would like be able to determine the appropriate IceToGasRatio to match my "more realistic" settings for O2 generation and consumption. Unfortunately, I'm still getting bizarre results and, having looked in the source, I don't know why the IceToGasRatio isn't working right. Should result in 3 units per kg of ice, but it doesn't. Well, if 1000 N uses .1kg H2/s, I can at least get started on testing that.
     
  12. GotLag Senior Engineer

    Messages:
    1,114
    I looked up the LH2 capacity and burn time numbers for the Saturn V third stage, which had one engine.
     
  13. GotLag Senior Engineer

    Messages:
    1,114
    The energy density in the configuration files (0.001556 MWh/L) is the value for gaseous hydrogen at 700 bar (5.6 MJ/L / 3600).
    Do note that the game incorrectly uses the 0.001556 figure as if it were MJ/L: the large ship large thruster is rated at 10 MW, and uses 6427 L/s (10 / 0.001556). This gives the large ship large hydrogen thruster an effective energy consumption of 36 GW.

    Edit: also at 700 bar the density of hydrogen is 0.04 kg/L

    Edit 2: the config files assume we're somehow using the chemical energy of the compressed hydrogen (although without using oxygen), rocket chat assumes we're using it purely as reaction mass.
     
    Last edited: Oct 31, 2015
  14. GotLag Senior Engineer

    Messages:
    1,114
    Crunching some numbers and a hydrogen consumption of 0.1 kg/s/kN thrust means 2.38 L/s/kN (using the density for gaseous hydrogen at 700 bar, 0.04 kg/L). For a 1,350-tonne ship with a single large hydrogen tank (2.5 ML) this gives a delta-V of 778 m/s - is reaching max speed 7 times on a single tank acceptable? Also, how much ice must be mined for this?
     
  15. entspeak Senior Engineer

    Messages:
    1,744
    It's 2.5 M units - I don't want to assume that 1 unit = 1 litre. If that's indeed true, then the IceToGasRatio is way off. This is why I'm trying to guage how many kg of H2 should be in a unit based on how thrusters should work. If I can do that, I can adjust the IceToGasRatio to make it more accurate. Unfortunately, the O2/H2 generating process is borked - I get more units of both gasses from 1 kg of ice than I should and the numbers are wildly different every time. If I try to process 1kg of ice to get O2 and H2 simultaneously, I get the same number of units for both gases, but it's always more than the ratio would suggest and it varies with each attempt. When I try to process just O2 or just H2, I get significantly more units / kg than that and it still varies each time.

    I've tried to look in the Source to see how it's calculated, but I can't find the problem. Everything seems to indicate that you should get 3 units of gas / kg of ice in the vanilla game. But, that's not what's happening at all. I went back to 1.104 and the problem exists there, as well. So, I don't know when it started or what went wrong.

    I feel like, if I could solve the problem, it would be like what happened when I did this for O2... having to mine less ice to get exponentially more H2.

    EDIT: I'm going to do some calculations based on the assumption that 1 unit = 1 litre of gas.
     
    Last edited: Oct 31, 2015
  16. GotLag Senior Engineer

    Messages:
    1,114
    I set the gas ratios to 1.301448 for oxygen and and 2.645503 for hydrogen (assuming 700 bar for both oxygen and hydrogen) and got 115.9 litres of oxygen and 295 litres of hydrogen from 100 kg of ice, which are in the right ball-park.
     
  17. GotLag Senior Engineer

    Messages:
    1,114
    I'm getting consistent (but strange) results with gas ratios: it seems the total gas produced is in proportion to the product of ratios.

    For example, 10,000 kg of ice with both O and H ratios at 1 produces ~10,500 L of gas, total. Change the H ratio to 2, and the total amount of gas (O + H) produced is ~20,800 L, with exactly twice as much H produced as O.

    This tracks quite well, ratio of 0.5 for both produces 1/4 the total gas (compared to both ratios at 1), and setting ratios to 2 and 4 produces 8 times as much as 1.
     
  18. entspeak Senior Engineer

    Messages:
    1,744
    Okay. Assuming that 1 unit = 1 litre, I came up with these results. If we treat H2 in the tank as a liquid, the energy density is 8.491 MJ/L. Liquid Hydrogen is 0.07078559 kg/L. This means that in order to be more realistic in terms of mining, the IceToGasRatio for Hydrogen should be set to 0.001570799933 (for pure ice) because you get .11119 kg of H2 from 1kg of pure ice. This would mean you would need to mine a ton of ice to get enough H2 to fill a tank, but once full, it would last a very long time. (see below)

    EDITED to correct figures.
     
    Last edited: Oct 31, 2015
  19. entspeak Senior Engineer

    Messages:
    1,744
    Ugh. I spent ages calculating kg/m^3 for O2 back when O2 was first introduced and learned that 1 unit was 1 kg/M^3 or .001 kg/L. This was based on pressurizing rooms. It looks like I may have to go back to the drawing board and test room pressurization again if 1 unit = 1 L of gas.

    Using the ratios to determine how many liters of gas is ridiculous, really because O2 and H2 are different gases and it should really be based on kg.

    EDIT: You should see how much gas you get using a different generator for each tank (O2 and H2). I was getting strange results with that. You seem to magically get more gas from the same amount of ice.
     
  20. entspeak Senior Engineer

    Messages:
    1,744
    Uh... okay. So, if you're correct and the game is actually using the energy density as MJ/L, then treating H2 in the tank as a liquid is f'ing AMAZING! This thruster has been going for over 3 minutes now and the tank is still 99.98 % full.

    I set the energy density to 8.491 (the energy density of liquid H2 in MJ/L). Are you sure the game is treating energy density as MJ/L, because this is crazy... it's coming up on 8 minutes now and the tank is still 99.97% full.

    23 minutes firing at 6 MN and the tank is still over 99.9% full.

    Even changing the energy density to 0.0023586111 MWh/L (8.941 MJ/L / 3600), it lasts much longer than before. You get roughly 10 minutes of full burn on 1 tank.
     
    Last edited: Oct 31, 2015
  21. Cronos988 Junior Engineer

    Messages:
    545
    The Problem with the whole energy density argument is that the energy usage of thrusters is completely arbitrary. The energy density doesn't matter unless we also have realistic energy consumption numbers.

    We dont have such numbers because the process by which the chemical energy is turned into thrust is obscure to us. You cannot simply convert energy density in MWh into thrust in Newton.

    Therefore it makes more sense to pick a realistic ISP number for a possible engine and go from there, as I did above. I would assume the hydrogen is liquid because that makes the most sense in terms of setting and gameplay - even if the energy density is wrong. What matters is that the actual throughput of mass makes sense.
     
  22. GotLag Senior Engineer

    Messages:
    1,114
    Gaseous hydrogen, not LH2.

    From GasProperties.sbc:
    Code:
    <EnergyDensity>0.001556</EnergyDensity>  <!-- MWh/litres -->
    From Wikipedia:
    Hydrogen at 700 bar: 5.6 MJ/L

    From WolframAlpha:
    5.6 MJ/L = 0.001556 MWh/L

    And density:
    ~0.040 kg/L (temperature-dependent)


    Currently it's a mess, Keen need to decide what units they're using before we can do any meaningful modding.
     
  23. Cronos988 Junior Engineer

    Messages:
    545
    Why wait for Keen to fix something we are changing anyways?
    We just need to decide What kind of engine makes sense for the setting (probably something nuclear, maybe a VASIMIR type), figure out a reasonable specific Impulse (it should be pretty high for gameplay reasons) and calculate the consumption of hydrogen from that. Liquid hydrogen is the only thing that makes sense, you wouldnt be using gaseous hydrogen, no matter What the config says. It also gives better endurance for tanks, which is important for gameplay.

    Energy consumption of the thrusters is arbitrary anyways, it doesnt matter What the numbers are as long as the fuel consumption in kg is reasonable.
     
  24. entspeak Senior Engineer

    Messages:
    1,744
    I understand that the game is treating it as gaseous. I think it should be liquid and was going to use that for a mod. My question to you is how do you know the game uses energy density as MJ/L instead of MWh/L as they indicate in the configs?

    As far as temperature is concerned, I used 20.3722 K (-423 F) - the temperature NASA uses for H2 storage. The density of H2 as a liquid at that temp is .07078559 kg/L.

    We should figure out how Keen is arriving at fuel consumption first and then alter the settings. We can't simply assume a particular figure without knowing how the game deals with that. How does Keen arrive at a specific impulse? That's the question.
     
    Last edited: Oct 31, 2015
  25. GotLag Senior Engineer

    Messages:
    1,114
    Because that figure is used directly in the calculation of per-second fuel consumption: (thruster power in MW) / (0.001556) = (fuel consumption in L/second). Punch those numbers into a calculator or spreadsheet and it will correctly predict fuel use (and hence burn time per tank).

    It's a cobbled-together mess and needs a total re-working on Keen's end. Electrical power consumption and fuel consumption should be separate, not mutually exclusive options with no sensible conversion method.
     
  26. entspeak Senior Engineer

    Messages:
    1,744
    Ah. But, if we want to use more realistic numbers, would it be better to put MJ/L in the EnergyDensity config setting if the game is treating EnergyDensity as MJ/L instead of MWh/L?

    If I put the energy density of liquid H2 (0.00235861 MWh/L) in GasProperties, I get roughly 50% more burn time. If I put MJ/L instead, the burn time goes off the charts (about 589 hours/tank) - which seems crazy.


    Keens approach to gases as a whole makes little sense. That's why I created my O2 mod which was based on more realistic data (how many units it takes to fill a room at a pressure where humans can safely breathe pure O2 for long periods of time). The way the vanilla game handles O2 makes no sense to me at all and if O2 is any indicator, they may not change H2 much.
     
    Last edited: Oct 31, 2015
  27. GotLag Senior Engineer

    Messages:
    1,114
    For consistency I think it would be better to put MJ/L in the gas properties and increase the thruster power usage to compensate

    Or better yet Keen should uncouple gas as a propellant from gas as a source of chemical energy
     
  28. entspeak Senior Engineer

    Messages:
    1,744
    Compressed Hydrogen at 700 bar and 273 K has a density of 0.0621675 kg/L.

    If we use Keen's H2 settings, what we should be getting from 10,000kg of ice is 17885.55 L of H2 gas (.11119 kg H2 in 1 kg of H2O.)

    If we assume 273 K and 4.7 psi for O2 (that's the pressure at which a human can safely breathe pure O2), we should get 19455.45 L of O2 (.88881 kg O2 in H2O).

    The ratios should be set accordingly.

    Later today, I'm going to have to retest.
     
    Last edited: Oct 31, 2015
  29. GotLag Senior Engineer

    Messages:
    1,114
    1 tank unit of oxygen is 1 cubic metre of ship atmosphere (16.25 units to fill one block of ship with air), which is within shouting distance of 1 unit of oxygen being 1 L of liquid oxygen.
     
  30. entspeak Senior Engineer

    Messages:
    1,744
    But, we aren't breathing liquid O2 in-game, clearly we are filling a room with gas. The H2 and O2 can be in different states, that's not really an issue. In various testing before with Vendan, I got so close to 1 unit/m^3 that it may as well be that. Then, considering we can safely breathe pure O2 at 4.7 psi and assuming a temp of 273 K, we can get O2 density and, therefore kg O2/unit.

    Likewise, for liquid H2, if we can establish a realistic power consumption for the thruster, we can find the kg H2/unit and adjust the IceToGasRatio accordingly.

    The problem that I see is that the generator is doing strange stuff with H2 and O2 depending on whether or not you gather them at the same time or separately. I can't figure out how the generator is working. That is what is blocking me from updating my mod to work with the current version.
     
    Last edited: Oct 31, 2015
Thread Status:
This last post in this thread was made more than 31 days old.