-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Peng-Robinson failing to solve pure #9
Comments
from pyomo.environ import ConcreteModel, Constraint, Var, SolverFactory, value, assert_optimal_termination
from idaes.core import FlowsheetBlock
from property_packages.build_package import build_package
m = ConcreteModel()
m.fs = FlowsheetBlock(dynamic=False)
m.fs.properties = build_package("peng-robinson", ["water"])
m.fs.state = m.fs.properties.build_state_block([0], defined_state=True)
sb = m.fs.state[0]
sb.flow_mol.fix(1)
sb.pressure.fix(101325)
sb.constrain("enth_mol", -40000)
sb.mole_frac_comp["water"].fix(1)
m.fs.state.initialize(outlvl=1)
opt = SolverFactory('ipopt')
def try_solve(enth_val):
sb.constraints.del_component("enth_mol")
sb.constrain("enth_mol", enth_val)
res = opt.solve(m)
assert_optimal_termination(res)
print(f"[enth_mol={enth_val}]: Temperature: {value(sb.temperature)}")
# now try to solve the block with different enthalpy values
# and observe the temperature
try_solve(-40000)
try_solve(-41000)
try_solve(-42000)
try_solve(-43000)
try_solve(-44000)
try_solve(-45000)
try_solve(-46000) the temperature values we're getting here might suggest a modelling error
|
The problems with initialization come at the "Phase equilibrium initialization" step. before initialization:
after:
Notice the change in |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Idaes fails to solve single components
e.g. build_package("peng-robinson", ["benzene"], ["Liq", "Vap"])
currently assuming state definition change to enthalpy will fix this.
The text was updated successfully, but these errors were encountered: