Closed BenPortner closed 1 year ago
Nice, thanks for testing!
The reason it failed was because the molar heat capacity (Cn) for liquid water at high temperatures becomes very high, but the solver was still using an old Cn value as an estimate. I updated the solver to use updated Cn values after a couple of tries and make it raise an error when the solver fails.
import thermosteam as tmo
tmo.settings.set_thermo(["H2O"])
feed = tmo.MultiStream(T=372.75, P=1e5, l=[('H2O', 0.1)], g=[('H2O', 0.9)]) # water in two-phase region
print(feed.S) # 185, correct
out = feed.copy()
print(out.S) # 185, correct
print(out.Cn) # ~38 (good)
out.P = 100e5
out.S = feed.S # should be superheated steam, but it is partially liquid (need to run VLE)
print(out.S) # now its 185 (yay, correct!)
print(out.Cn) # ~645 (very high, but expected due to liquid Cn model)
Thanks,
Amazing work! Thanks @yoelcortes. Closing this issue.
@BenPortner, I introduced a silly bug in my last commit (it is fixed now). Please pull again when you get a chance :)
The newly implemented entropy setter function does not seem to work properly in some cases. For example: