Modeling phase changes accurately

  • Mdkar
    3rd Sep 2019 Member 0 Permalink

    I was thinking about making a mod with some more realistic science features. 

    In the vanilla game, water vaporizes/condenses at different temperatures depending on pressure, but I don't know how the game calculates it.

     

    If we map the points where the phase change occurs and compare it to the data in a phase diagram for water, can the in game pressure be given a standardized unit? As far as I know, the pressure has arbitrary units. This might be easier if I knew how it worked. 

     

    Using this standardized pressure, all the other elements could also obey their phase diagrams.

  • Mdkar
    5th Sep 2019 Member 0 Permalink

    So I looked through the code for WATR and DSTW but neither has code that raises or lowers the transition temperature based on pressure. Where is this code located?

     

    These properties are all constants

    LowPressure = IPL;
    LowPressureTransition = NT;
    HighPressure = IPH;
    HighPressureTransition = NT;
    LowTemperature = 273.15f;
    LowTemperatureTransition = PT_ICEI;
    HighTemperature = 373.0f;
    HighTemperatureTransition = PT_WTRV;

  • LBPHacker
    6th Sep 2019 Developer 0 Permalink

    It's here. It actually applies to a bunch of elements, not just WATR.