Kerbalism / Kerbalism4

Hundreds of Kerbals were killed in the making of this mod.
Other
10 stars 3 forks source link

Thermal control #14

Open ccaviness opened 5 years ago

ccaviness commented 5 years ago

Currently, there aren't many uses for the radiators in the stock game, apart from drilling. In the real world, however, thermal management is much more important. ISS has several large thermal radiators for heat dissipation.

It would be very cool (hah!) if Kerbalism would start tracking heating effects while in space, requiring the use of radiator panels to dissipate.

gotmachine commented 5 years ago

See this (very old) PR : https://github.com/ShotgunNinja/Kerbalism/pull/105 and the (very old) issue : https://github.com/ShotgunNinja/Kerbalism/issues/83

The reason why this has not been added yet is because there is a blocking issue with incorrect evaluation of radiator output and habitat heat gains/losses at high timewarp speeds. The old PR was aiming for the following features :

  1. modelling of thermal conditions based on sunlight/shadow status and solar, albedo, body and background radiation, as well as basic convection/conduction flux when in atmosphere.
  2. modelling of habitat heat flux based on 1.
  3. modelling of radiator cooling capacity based on 1.
  4. use of a coolant resource generated by radiators and required by exothermic processes

The problem is that 1. can't be reliably evaluated at high timewarp rates, resulting in chaotic behavior and random kerbal death. This is related to a common issue that kerbalism has with environmental conditions evaluation at high timewarp rates. It can maybe be solved, but there is no plans for that currently.

A less realistic system can be done and should work reliably, by eliminating everything that is unreliable in 1. :

dgfl-gh commented 2 years ago

I was thinking about the thermal system recently. Read a bit on what was in the linked issue and PR, but my impression was that it's not terribly relevant anymore.

The problem is that 1. can't be reliably evaluated at high timewarp rates, resulting in chaotic behavior and random kerbal death. This is related to a common issue that kerbalism has with environmental conditions evaluation at high timewarp rates. It can maybe be solved, but there is no plans for that currently.

This especially. My thought is that substepping may be accurate enough to overcome this issue, leading us to ignore the subsequent workarounds. Of course, correct me if that's not the case - you know your system far better than me.

I was therefore thinking again on the principles of the implementation, with an eye (or two) pointed at RO. We should design a system that isn't meant strictly for high power engines, but also for kerbals and electronics.

Big picture view: We build a completely separate thermal simulation. It only ignores aerothermal heating, but considers almost everything else. The stock thermal system has no way to model something very fragile inside a robust and well-insulated part, so our new system handles the (very important) requirements of the fragile part by considering it completely separate from the external structure.

I don't love the idea of completely ignoring structural temperatures, but I don't see another way to make it work. This kind of steady-state simulation is better than nothing, after all.


I've referred to the holder of parameters for each part as "module", but what it should be is not yet clear to me. We should surely use virtual resources ("flux in" and "flux out"), so a process seems like a good fit, but I'll have to investigate.

gotmachine commented 2 years ago

Some ramblings about this...

Possible implementation :

Questions :

What to do ?

warriorsabe commented 2 years ago

It should also make sure that the hull of the vessel still functions to radiate heat too; otherwise anything in space not equipped with radiators would heat up without bound even with only very small heat sources.

Also, convective fluxes through radiators are probably important too - deploying a radiator on Venus would be pretty counterproductive for most things after all. It would be cool to have special encased radiators insulated from convective heating, but that's probably out of scope - though the existence of a convective multiplier would be nice for anyone wanting to make one such radiator.

As for intra-vessel occlusion, is that not already done for solar storm shadow shielding? Could that not be reused here?

gotmachine commented 2 years ago

It should also make sure that the hull of the vessel still functions to radiate heat too; otherwise anything in space not equipped with radiators would heat up without bound even with only very small heat sources.

Well, that's the "should parts exchange heat with the environment ?" question.

A while ago, I did a prototype implementation that was doing it. This introduce a lot of complexity. First on a technical level this mean managing a separate surface temperature, per part thermal capacity and internal stored thermal energy, surface to internal flux ratios, surface emissivity/absorptivity values, etc...

Aside from the coding work needed to make all that work correctly, from the player POV, this mean a lot of tweaking around those values and careful planning for every thermal environment the vessel will have to go through. Achieving "passive equilibrium" is actually quite difficult. My feeling is that this would end up being a very frustrating gameplay element and that it would severely limit achievable mission profiles.

To illustrate the issue, take KSP stock thermal system (which is a rather decent implementation of all that), and think how difficult it would be to tweak each part stock thermal config so crewed parts internal temperature always stay in the 295±25 K survivable temperature range. It's nearly impossible. It's no coincidence that all KSP parts are configured with an absurdly high max internal temperature of 1200K, making the whole stock thermal simulation more or less pointless.

In the end the issue is that a "realistic" thermal simulation isn't something that translate well into a gameplay element. For this Kerbalism subsystem, I'm trying to thing the other way around : what gameplay elements do we want to introduce ? And only then, how to make them vaguely realistic ?

For now, the main thing I want to cover is thermal management for "extreme temperatures" processes : ISRU, drills, nuclear power/propulsion, cryo-cooled electromagnetic radiation shields. This is the main major feature currently missing from Kerbalism. For those gameplay elements, we don't really care about part vs environment thermal interactions, as it's a negligible factor compared to the energy magnitudes involved. It's all about heat production/rejection balance, or said otherwise, about how many radiators you need to slap onto the vessel.

I might look into extending the implementation to cryogenic fuels boiloff management and habitat / life support processes heat management, which will require some form part to environment thermal interaction to be meaningful. But for now, that will likely stay out of scope, and I don't plan to have any form of habitat heat management requirement for now.

Also, convective fluxes through radiators are probably important too

Radiators should definitely take convective fluxes into account, yup.

As for intra-vessel occlusion, is that not already done for solar storm shadow shielding? Could that not be reused here?

Kinda, but not really. First, the radiation raytracing code isn't really checking occlusion, it mainly compute the thickness of every occluder, their density, the secondary radiation emitted, etc. But more importantly, it doesn't actually evaluate the "visual" occlusion, which is what really matters in the thermal case. To do that reliably and efficiently, raytracing is likely not the right tool.