Masterpintsman Posted April 20, 2017 Share Posted April 20, 2017 Background: https://en.wikipedia.org/wiki/Enthalpy (especially Enthalpy_changes -> physical properties) Substance phase changes should happen gradually as phase changes release/absorb energy from/to the material, which need to be transfered to/from surroundings, limiting the speed at which phase change can happen to the maximum flow of energy to/from/in the system or between its components. This essay ignores pressure when it comes to energy transfer effects on phase changes. Phase changes, especially with water, require way more energy flux than simply warming/cooling the matter without changing the current phase state does. It costs several times (~6 iirc) as much energy to vaporize a given amount of water at 100°C into steam of the same temperature than it costs to heat the same amount water from 0°C to 100°C - the energy captured in the steam can (and will) be freed when the water condenses, or as a different perspective has to be actively removed from he steam to condense it. Ice blobs for example should, when reaching their melting point, melt gradually by absorbing heat from their surroundings and use it up for the phase change instead of simply raising the temperature of the complete blob till it spontaneously turns completely into a surprising amount of fluid (one compactor of ice will give 20 full tiles, contaminated ice will give 25 full tiles). Fluid at freezing temperature cooled further should should freeze gradually as the the phase change from fluid to solid releases energy into the reminder of the fluid. Also ice blobs should surface melt when exposed to temperatures above their melting point, and surface freeze surrounding fluids should the solid be at a lower temperature than the freezing point of the fluid. This can be modeled by the following rules (surroundings = everything not being the solid that is processed by the rule): fluid below freezing point and no corresponding solid nearby: freeze a minimal (lowest that the game can handle) amount of fluid to create a new solid object in this tile with minimum size, let the other rules work on it fluid below freezing point and nearby corresponding solid: freezing of fluid into the solid, amount capped by the energy (freezing enthalpy released by the phase change) that will heat the remaining fluid up to the freezing point. fluid at freezing point and corresponding colder solid: freezing of fluid into the solid, amount capped by the energy (freezing enthalpy released by the phase change) that will heat the solid up to the freezing point. surroundings of higher temperature than melting point of solid: surface melting, paced according to temperature differential between the surroundings vs. the melting temperature, pulls in the energy [needed for phase change and heating the thawed part of the solid to melting point] from the surroundings, emit the created fluid (where it can mix with existing fluid, equibrilating their individual temperatures according to their temperature&mass relations) surroundings of lower temperature than melting point of solid: heat flux paced according to temperature differentials and heat transfer properties Rules 2-4 should limit the maximum amount of matter changing phase per game tick to make the change incremental instead of instantly to yield more pleasing optics (ice blob forming as a pixel and growing in size over time instead of popping into existance at final size). For 3+4 this could be done by comparing the temperature differential vs. the thermal conductivity of the solid, the higher the first and the lower the latter the faster it should change phase - for 2 a somewhat sensibly picked value will do. Rules will lead to ice effectively cooling water, melting into it in the process till either the ice melted completely or the water is cooled down to freezing temperature and is starting to freeze into the ice, eventually solidifying completely should the ice blob be cold (and big) enough to absorb all the excess energy (temperature differential and freezing enthalpy) contained in the water. Same goes for the phase changes on evaporation/condensation, a volume of fluid brought to the boiling point should gradually turn into vapor while additional energy is being added to it - instead of turning into gas instantly and completely. Same with condensation, should also only happen to the amount of energy extracted from a hot gas at condensation point. This would give a much nicer (and more realistic) simulation with: ice melting realistically ice blobs building over time when cooling fluids instead of insta-appearing gradually cooling water by dropping ice into it and retrieving the (then smaller) ice blob when intended temerature is reached storage compactors that drip fluid over time instead of spontaneously releasing up to 20/25 (water/dirtwater) tiles evaporators where the fluids are actually boiling realistic storages for liquid gasses Link to comment https://forums.kleientertainment.com/forums/topic/77979-model-enthalpy-especially-for-phase-changes/ Share on other sites More sharing options...
Kasuha Posted April 20, 2017 Share Posted April 20, 2017 I would guess devs know about that physics property and decided to implement things the current way because of performance concerns. Consider ice biome containing 100 ice tiles. Converting them all to water in current implementation is 100 events that need to be cared about when each tile reaches the right temperature. Adding tiny amounts of water around each of them each physics step over number of cycles as they gradually thaw is millions of events of similar complexity. Link to comment https://forums.kleientertainment.com/forums/topic/77979-model-enthalpy-especially-for-phase-changes/#findComment-910824 Share on other sites More sharing options...
Ciderblock Posted April 20, 2017 Share Posted April 20, 2017 1 hour ago, Kasuha said: I would guess devs know about that physics property and decided to implement things the current way because of performance concerns. Consider ice biome containing 100 ice tiles. Converting them all to water in current implementation is 100 events that need to be cared about when each tile reaches the right temperature. Adding tiny amounts of water around each of them each physics step over number of cycles as they gradually thaw is millions of events of similar complexity. There is discretization all over the place, but it seems to me that it is less coarse when it comes to most other phenomena. They could refine it a bit by having a melting ice block accumulate energy until it has enough to melt x kg and then instantly melt that x kg off, leaving a lighter block behind. This is not much different from how oxylite works already. That said I think this issue is a lot more minor than some of the other issues that are already there with temperature, such as extremely slow exchange of heat between two different substances in thermal contact. Link to comment https://forums.kleientertainment.com/forums/topic/77979-model-enthalpy-especially-for-phase-changes/#findComment-910849 Share on other sites More sharing options...
BlueOrange Posted June 6, 2017 Share Posted June 6, 2017 Given how realistic the movement of gases seems to my (high school science only) eye, the wildly unrealistic behaviour of liquids turning into solids and back again is quite jarring, and does disrupt the experience for me. A smaller improvement over the current state would be enough for me - treat a melting solid the same way that oxylite or bleach stone is treated and have it emit liquids using the same principles - hold the temperature of the melting solid at the melting point, and use the heat wattage going into it to determine how much gets turned into liquid. If there is no place for the liquid to go, then hold off on melting it (weird things happen under pressure - this kind of weirdness is an improvement over the current weirdness. Perhaps ice tiles can be made porous, like mesh tiles? Freezing things does require a 'water' tile to become an 'ice' tile at some point, even if it is porous. It's probably OK if that happens at the moment that things hit the freezing point and still have energy loss to be accounted for. But having an 11kg piece of ice sitting in 8 degree water for THREE DAYS and still be an 11kg piece of ice? That destroys my ability to believe in the physics, which is a damned shame. Link to comment https://forums.kleientertainment.com/forums/topic/77979-model-enthalpy-especially-for-phase-changes/#findComment-929008 Share on other sites More sharing options...
Trego Posted June 7, 2017 Share Posted June 7, 2017 On 6/5/2017 at 7:11 PM, BlueOrange said: Given how realistic the movement of gases seems to my (high school science only) eye, the wildly unrealistic behaviour of liquids turning into solids and back again is quite jarring, and does disrupt the experience for me. A smaller improvement over the current state would be enough for me - treat a melting solid the same way that oxylite or bleach stone is treated and have it emit liquids using the same principles - hold the temperature of the melting solid at the melting point, and use the heat wattage going into it to determine how much gets turned into liquid. If there is no place for the liquid to go, then hold off on melting it (weird things happen under pressure - this kind of weirdness is an improvement over the current weirdness. Perhaps ice tiles can be made porous, like mesh tiles? Freezing things does require a 'water' tile to become an 'ice' tile at some point, even if it is porous. It's probably OK if that happens at the moment that things hit the freezing point and still have energy loss to be accounted for. But having an 11kg piece of ice sitting in 8 degree water for THREE DAYS and still be an 11kg piece of ice? That destroys my ability to believe in the physics, which is a damned shame. I agree with your point about the loss of immersion, but you haven't really answered the performance issue...unless you're suggesting that Klei make water/ice as uncommon as oxylite and bleachstone are Link to comment https://forums.kleientertainment.com/forums/topic/77979-model-enthalpy-especially-for-phase-changes/#findComment-929513 Share on other sites More sharing options...
LeadfootSlim Posted June 7, 2017 Share Posted June 7, 2017 Would more gradients to switch between in the current fashion make more sense, perhaps? For example, having water turn into a "slush" liquid, then a "slush solid which acts like a Mesh Tile, then finally solid Ice. Same for steam condensation - go from "steam" gas to "mist" gas to "condensation" liquid to regular water. Either way, I agree the phase changes could use some improvement. Link to comment https://forums.kleientertainment.com/forums/topic/77979-model-enthalpy-especially-for-phase-changes/#findComment-929518 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.
Please be aware that the content of this thread may be outdated and no longer applicable.