Jump to content

[1.12.x] SystemHeat - a replacement for the CoreHeat system (October 9)


Nertea

Recommended Posts

Chipping away at this and actually getting close to a rough alpha for people to look at.

This is two separate loops as visualized by the toggleable overlay. You can click on the info icons to see more about a part, specifically the heat it contributes to the loop, its output temperature and the loop's temperature.

screenshot220.png

 

 

Link to comment
Share on other sites

Just wanted to say I really appreciate all the work you've put into modding KSP over the years, it's a huge part of what's kept me coming back to the game.

Are loops only going to be possible to set in the VAB/SPH or will it be possible to set them up in-flight like the new action groups? A fair number of the ships I build end up having radiators and engines in separate blocks that get docked together, and I'm curious whether that would still work with the new system you have planned.

Link to comment
Share on other sites

27 minutes ago, personaleyrie said:

Just wanted to say I really appreciate all the work you've put into modding KSP over the years, it's a huge part of what's kept me coming back to the game.

Are loops only going to be possible to set in the VAB/SPH or will it be possible to set them up in-flight like the new action groups? A fair number of the ships I build end up having radiators and engines in separate blocks that get docked together, and I'm curious whether that would still work with the new system you have planned.

I'm a bit torn, changing loops in-flight might lend itself to some exploits though it would be useful in situations like that. 

Link to comment
Share on other sites

Maybe make changes to the loops take time? I dunno how much extra coding this would involve, but this could simulate the construction effort needed to modify the cooling system. It would work for orbital assembly (since you likely don't need it right after docking a new section) and would prevent someone from quickly adding some more radiators to say the reactor cooling loop when the reactor is already overheating. Maybe deactivate loops that are currently undergoing construction. Like in real life, "Can you afford to shut it down for maintenance?"

Link to comment
Share on other sites

39 minutes ago, Nertea said:

I'm a bit torn, changing loops in-flight might lend itself to some exploits though it would be useful in situations like that. 

Feel free to ignore any of this that doesn't make sense, but maybe it would make sense to have it as a difficulty option like CommNet (not the mod as a whole, just access to it in flight)? If it would be too much work to implement it's definitely possible to build ships around that problem, and adding new constraints on ship designs isn't a bad thing.

Link to comment
Share on other sites

You can probably get away without support for in-flight loop editing in a first release. There are probably cases where this interferes with orbital assembly of large ships, that is true. But you can validate the basic function of the mod without supporting every edge case. Also, it would probably help identify the edge cases in the first place, with people coming and saying "I wish I could do that" or "with this mod installed my usual way of doing things no longer works".

For the future, maybe the simplest solution would be that you can launch with your coolant loops inactive, and as long as they are inactive, they can be edited freely in flight. As soon as you actually start one up and have it do work, though, it becomes permanently fixed in its configuration. This would allow for orbital assembly without letting players rewire everything on the spot in finished ships to exploit mechanics.

Link to comment
Share on other sites

So currently, the loops are fixed when you leave the VAB. When you dock two ships, their loops get merged - Loop 1 objects in Vessel 1 are now part of Loop 1 obejcts in Vessel 2. I had thought in the future to make it so loops are automatically incremented when docking so that loops wouldn't auto-merge.

Maybe a good solution however, not the cleanest, is to preserve the merging behaviour but allow the player to increment loop IDs in flight, so you any changes to loops are applied to all members of the loop. That would allow you to create systems where you want to merge loops (docking radiators to engine), and systems where you don't (docking engine section to ship). Thoughts?

Link to comment
Share on other sites

Well, it's more permissive than I would allow :P But if I understood it right, then you cannot actually split loops with this, or take parts out of them, unless you physically undock? That probably works well enough to prevent exploits, yeah. Maybe someone will build some sort of crazy vessel with ship-internal docking ports that can latch or unlatch without actually separating anything in order to cheat with the loops... but, you know, I suppose that that amount of effort might as well be called commendable, and allowed. Certainly wouldn't be practical in 99.9% of all cases.

Link to comment
Share on other sites

On 6/4/2020 at 11:51 AM, personaleyrie said:

As long as there's a way to keep loops separate, auto merging sounds good to me. Is it safe to assume that the mod will break any craft already in flight and should be used on a clean save?

Yeah this will need to be the case. I will probably keep the stock balance similar in terms of radiators per ISRU or whatever, but the second you throw my other mods in I'll be doing more exotic things

Plus, in the near term this will be highly experimental.

Things are getting close to useable...

screenshot223.png

Edited by Nertea
Link to comment
Share on other sites

This would totally give a reason to have lower-temp radiators, like the ammonia radiators typically used for life support on STS and ISS. Looking forward to testing and using this, once you release it. Also depending on how it's implemented, flash coolers and heat sinks are a potential option.

Link to comment
Share on other sites

10 hours ago, Nertea said:

Yeah this will need to be the case. I will probably keep the stock balance similar in terms of radiators per ISRU or whatever, but the second you throw my other mods in I'll be doing more exotic things

Plus, in the near term this will be highly experimental.

Things are getting close to useable...

screenshot223.png

I've never seen that plume before, is this from an existing mod, or is it something new with Waterfall?

Link to comment
Share on other sites

You have no idea how happy I am to find this thread. I started digging into the CoreHeat system to try and fix the ludicrous numbers for RSS and actually have something closer to realistic. Unfortunately, my modding skills start and end with module manager patches and CoreHeat was incredibly resistant to what I wanted it to do. I don't think it liked me spreading out the numbers over 7 orders of magnitude.

On 5/18/2020 at 5:37 PM, Nertea said:

This way, you have two mostly orthogonal problems to solve. Regulate the operating temperature of the loop, and regulate the radiative capacity of the loop. If you mix these problems too much, you end up with an undergraduate level thermodynamics course. There are some couplings in that radiators are more effective at higher operating temperatures, but they are intentionally minimized.

As someone who has taken several of those courses, can confirm 1,000%.

If I may chime in a tad with your earlier discussion with @AccidentalDisassembly

On 5/18/2020 at 7:46 PM, AccidentalDisassembly said:

If it's something like "the average temperature of the coolant or the radiator parts" or something like that, then I am extra stumped, because I don't understand where I'm going wrong in my logic...:

  1. You have a "loop" with the 3000k reactor and a 300k snack machine. (I am imagining this as an actual circuit of pipe moving coolant around, but I think the principle would be theoretically the same even if you were talking about taking those two systems, which need vastly different temperatures to function correctly, and gluing them to opposite ends of a gigantic metal brick with radiating fins.) 
  2. There's a coolant reservoir somewhere. It's ambient temperature. Ambient-temperature coolant starts there, then goes to the reactor. The inside of the reactor is a nice, toasty 3000k - its operating temperature. Once it achieves that temperature, its flux/heat output is 1000kW, so 1000kW of energy is applied to the coolant, which heats up.
  3. Toasty coolant (presumably close to 3000k and a volume determined by a bunch of math related to how much energy it takes to heat this magic liquid by X degrees) exits the reactor, then pipes through four 250kW radiators. After coming out of the radiators, the coolant has returned to ambient temperature. If it hasn't, then the radiators didn't actually achieve that rate of cooling, presumably.
  4. Now, still on the same loop, the coolant enters the 300k part, an insanely powerful snack fabricator whose flux is also 1000kW - applied to coolant, which then passes through four more 250kW radiators (so 8 in total on the single loop). 
  5. Coolant is back to ambient temperature again, and it returns to reservoir. Loop complete.

This right here is the disconnect. In a steady-state cooling loop, the 'cold side' never gets anywhere close to ambient temp. Think about the radiator in your car. The water coming out the bottom is somewhat cooler than the water going in, but it's still well above ambient. Unfortunately, because [lots of integrals], reaching ambient temp at the outflow of the radiator would require an infinitely large radiator. Also, the larger the temperature differential is across the radiator, the less efficient is gets. In practice, the radiators are made just big enough to dissipate the required power at a workable temperature and often have relatively small ΔT. In steam systems for power plants and refineries, the ΔT can be next to zero since all the energy is being moved by the hot side being a vapor and the cold side being a liquid. You can pump a shocking amount of power into a heat exchanger by feeding it steam at 101°C and draining water at 99°C. Thus, the assumption that the cooling loops are non-directional and homogeneous is probably pretty darn close.

 

@Nertea Is there going to be a way to balance radiators based on that whole T^4 goodness or do you plan to actually implement Stefan–Boltzmann somehow? Low temp loops like the ISS radiators achieve specific heat rejection of only about 10w/kg running at 100°C (trying to cool a megawatt level reactor with these would take over 100 tons of radiators). High temp carbon fiber research looks to be potentially capable of >50kw/kg at 800°C (and now a 2kg radiator can cool your entire space station no problem). Will it just be that low temp radiators blow up at high temps and high temp radiators won't start working until they're heated up sufficiently?

You seem to have a decent grasp of thermo and heat transfer, and my coding skills are almost non-existent, but if I can help out somehow, I'd love to. I actually have an excel sheet set up trying to figure out balance numbers for the stock radiators and some of your Heat Control radiators.

Link to comment
Share on other sites

23 hours ago, panarchist said:

This would totally give a reason to have lower-temp radiators, like the ammonia radiators typically used for life support on STS and ISS. Looking forward to testing and using this, once you release it. Also depending on how it's implemented, flash coolers and heat sinks are a potential option.

Yes, both are possible, but I won't be making either as part of the base mod. 

17 hours ago, coyotesfrontier said:

I've never seen that plume before, is this from an existing mod, or is it something new with Waterfall?

Yep.

42 minutes ago, ShakeNBake said:

I've never seen that plume before, is this from an existing mod, or is it something new with Waterfall?

Yeah, I don't know how well this will react to 7 orders of magnitude, heh, I've only really been testing up to 5 figures, but it seems stable there! I'm always glad to see interest.

48 minutes ago, ShakeNBake said:

@Nertea Is there going to be a way to balance radiators based on that whole T^4 goodness or do you plan to actually implement Stefan–Boltzmann somehow? Low temp loops like the ISS radiators achieve specific heat rejection of only about 10w/kg running at 100°C (trying to cool a megawatt level reactor with these would take over 100 tons of radiators). High temp carbon fiber research looks to be potentially capable of >50kw/kg at 800°C (and now a 2kg radiator can cool your entire space station no problem). Will it just be that low temp radiators blow up at high temps and high temp radiators won't start working until they're heated up sufficiently?

The current model is deterministic. I have a mental note to provide a more physical temperature model for radiators, but the advantage of determinism is that the numbers can be cooked properly to account for KSP garbage, or to tune balance. Right now it looks like this for a low temperature radiator:

temperatureCurve
    {
      key = 0 0
      key = 350 150
    }

The keys are the temperature, the values the amount radiated. Nothing blows up if the loop is above the temperature, you just don't get benefits. A high temperature radiator might look more like this:

temperatureCurve
    {
      key = 0 0
      key = 1000 2500
    }

Again, it'll still work if you only supply it with low temperature coolant, but not as well. You could as an end user tweak it very easily as well. 

As you're coming from RSS, this is less relevant, but the idea will be to spec the stock radiators as ISS-like, with radiators that don't work well about 400K or so, and design the ISRU/drills to operate in a similar regime. This makes the system's interaction with stock very low footprint, you can deal with all heat generation and rejection generated by stock parts with other stock parts. When I get into reactors, nuclear engines, etc, it will make more sense to install radiator packs to get high temperature things. 

45 minutes ago, ShakeNBake said:

You seem to have a decent grasp of thermo and heat transfer, and my coding skills are almost non-existent, but if I can help out somehow, I'd love to. I actually have an excel sheet set up trying to figure out balance numbers for the stock radiators and some of your Heat Control radiators.

I actually have some experience in doing thermal modeling for smallsats, so I'm fairly aware of where I'm throwing out realism for gameplay. 

The best way to help is going to be hanging around, testing and providing feedback :). One thing that I'm struggling with right now is how much to make ambient temperatures affect the simulation, could use some input here. Right now I have it so that the minimum temperature of a loop can never go lower than ambient, which is an ok assumption sometimes, but it runs into trouble on planets and such. 

 

Link to comment
Share on other sites

Is there any reason that the high-temp radiators couldn't be

temperatureCurve
    {
      key = 0 0
      key = 500 0
      key = 1000 2500
    }

or make a multi-key curve that's (roughly) quartic?

 

26 minutes ago, Nertea said:

Right now I have it so that the minimum temperature of a loop can never go lower than ambient, which is an ok assumption sometimes, but it runs into trouble on planets and such. 

Seems like a solid assumption to me, maybe even ambient*1.02. What sort of trouble?

Link to comment
Share on other sites

3 hours ago, ShakeNBake said:

or make a multi-key curve that's (roughly) quartic?

 

You can add as many keys as you want, it's a standard FloatCurve.

3 hours ago, ShakeNBake said:

Seems like a solid assumption to me, maybe even ambient*1.02. What sort of trouble?

It means that you can never cool a part below the ambient temperature, really, which isn't strictly true (say, a refrigerator). You're on Eve, so all your cooling loops are now at ~450K, which might have negative implications for life support and stuff that fundamentally would have temperature goals that could be either higher or lower than ambient. 

1 hour ago, kirmie44 said:

Do you see any foreseeable incompatibilities out there? This mod looks great but if it doesn't work with kerbalism (for me), I think I'll have to sit aside

I don't support Kerbalism with any of my mods: they tend to do their own thing and replace the modules and code I make. 

Link to comment
Share on other sites

4 hours ago, Nertea said:

You can add as many keys as you want, it's a standard FloatCurve.

It means that you can never cool a part below the ambient temperature, really, which isn't strictly true (say, a refrigerator). You're on Eve, so all your cooling loops are now at ~450K, which might have negative implications for life support and stuff that fundamentally would have temperature goals that could be either higher or lower than ambient. 

A refrigerator uses a heat pump, not just radiators. In order to reject heat to the environment, the radiators MUST be hotter than that environment. I know !moar parts! isn't the answer you want but a heat pump that consumes power to move heat from a cooler loop to a hotter loop is the real world solution. Have your 350K habitation loop connect to a heat pump that consumes power in order to move the energy (plus the input energy to the heat pump) to a 600K radiator loop.

As far as a good way to fudge it without adding parts, not sure, I'll think on it. 
 

Also; after thinking a bit, all of this radiative heat transfer is really only relevant in space. If you are in an atmosphere, convection will absolutely dominate. Convective radiators designed to work in atmosphere will move SIGNIFICANTLY more heat than radiative radiators (heh) working in vacuum. Not sure if there’s any easy way to model that though.

Edited by ShakeNBake
Second thought
Link to comment
Share on other sites

5 hours ago, ShakeNBake said:

Also; after thinking a bit, all of this radiative heat transfer is really only relevant in space. If you are in an atmosphere, convection will absolutely dominate. Convective radiators designed to work in atmosphere will move SIGNIFICANTLY more heat than radiative radiators (heh) working in vacuum. Not sure if there’s any easy way to model that though.

Stock KSP models convection for its own heat model - as in, the "not CoreHeat" one.

If what Systemheat radiators do is raise their own part temperature from the energy received from the loops, then KSP would automatically take care of things like convection and ambient temperature interactions and such. But it sounds like SystemHeat does its own thing and just has the radiators delete a certain amount of heat flux without interacting with either of stock KSP's two heat systems. In that case, maybe the convection figure can be cribbed and reused, even if no other part of the stock system is?

Link to comment
Share on other sites

22 hours ago, ShakeNBake said:

A refrigerator uses a heat pump, not just radiators. In order to reject heat to the environment, the radiators MUST be hotter than that environment. I know !moar parts! isn't the answer you want but a heat pump that consumes power to move heat from a cooler loop to a hotter loop is the real world solution. Have your 350K habitation loop connect to a heat pump that consumes power in order to move the energy (plus the input energy to the heat pump) to a 600K radiator loop.

As far as a good way to fudge it without adding parts, not sure, I'll think on it. 
 

Also; after thinking a bit, all of this radiative heat transfer is really only relevant in space. If you are in an atmosphere, convection will absolutely dominate. Convective radiators designed to work in atmosphere will move SIGNIFICANTLY more heat than radiative radiators (heh) working in vacuum. Not sure if there’s any easy way to model that though.

This is more about the backend of the system - what values are allowed for a loop. 

17 hours ago, Streetwind said:

If what Systemheat radiators do is raise their own part temperature from the energy received from the loops, then KSP would automatically take care of things like convection and ambient temperature interactions and such. But it sounds like SystemHeat does its own thing and just has the radiators delete a certain amount of heat flux without interacting with either of stock KSP's two heat systems. In that case, maybe the convection figure can be cribbed and reused, even if no other part of the stock system is?

Convection in stock is garbage as well. Garbage is mean, it's functional for simulating re-entry, but again has issues when talking about timewarp and long-term things.

Anyways I'm releasing this now for alpha alpha feedback. I need to start having people gather edge cases, report bugs, think about balance, etc. Be gentle, this is not at the polish level of any of my usual mod releases. 

Current feature list:

  • A new heat system as described
  • Some UI tools (overlay) to help with building ships
  • Stock radiators, harvesters, converters and the LV-N have been patched to use the new system

Things that are not done/known issues/planned: 

  • Anything in the Issues section of the repo
  • Radiators always say they're overheated in flight
  • None of the settings in the settings file work.
  • More overlay fine tuning including tooltips and better cues for heat rates
  • Support for my other mods (notably Near Future Electrical and Heat Control)

Things that could use testing

  • The utility of the UI and how well it communicates information
  • The robustness of the thermal simulation in different situations
  • Balance-type things

You will notice a ridiculous amount of debug messages in the log, this is intended and helpful for debugging. If you do get some error please make sure you provide the following

  • Logs
  • Screenshots of thermal overlay and ship
  • Screenshots of the thermal debug window, if possible

To get it, you'll need to  download the repo and install it by dropping the included GameData folder into your KSP install.

 I'm not making official testing releases. I'll post here when I've committed fixes or updates. 

 

Edited by Nertea
Link to comment
Share on other sites

1 hour ago, Nertea said:

This is more about the backend of the system - what values are allowed for a loop. 

Can it be the lesser of ambient or the lowest system design temperature? Even if you can't reject heat at that temperature, the parts should be able to make a loop at their design temp, even if the loop overheats immediately because the heat isn't going anywhere. After the loop is overheated, it shouldn't be able to go back below ambient without a heat pump.

I'll check it out next time I get gaming time.

Link to comment
Share on other sites

New update has been pushed to the repo. Notable improvements

  • Fixed several null reference exceptions in the VAB
  • Dealt with an edge case where ambient temperature could become equal to float.Max() at random times (lolsquad)
  • Thermal simulation values in the VAB are no longer propagated to the pad
  • Fixed several cases where the overlay could go haywire in the VAB
Edited by Nertea
Link to comment
Share on other sites

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