BioSTEAMDevelopmentGroup / thermosteam

BioSTEAM's Premier Thermodynamic Engine
Other
57 stars 12 forks source link

`Mixture.solve_T_at_SP` returns incorrect results #66

Closed BenPortner closed 2 years ago

BenPortner commented 2 years ago

The newly introduced solver Mixture.solve_T_at_SP does not work correctly:

    import thermosteam as tmo
    tmo.settings.set_thermo(['Water'], cache=True)

    s = tmo.Stream(T=298, P=1e5, Water=1)
    Ts = s.mixture.solve_T_at_SP(phase=s.phase, mol=s.mol, S=s.S, T_guess=s.T, P=s.P) # returns 964, should be 298

I went ahead and added this as a test in https://github.com/BioSTEAMDevelopmentGroup/thermosteam/pull/65. However, I could not fix the error yet.

yoelcortes commented 2 years ago

Thanks for this! I had the functional form in the solver wrong. It is now fixed in 0cf7582