Closed GoogleCodeExporter closed 9 years ago
Original comment by yarmond
on 10 Apr 2012 at 3:18
Calling the setState_HP method holds the composition fixed, so it can't end up
at state 2. If you set the mass fractions as they are in state 2 and then call
setState_HP, it works fine.
Original comment by yarmond
on 18 May 2012 at 8:27
Thank you, Ray! This clarifies how setState_HP function works exactly but it
doesn't solve my problem, sorry. I want to obtain the state 2 from state 3
given only enthalpy and pressure. So far I solve this problem with an external
iteration that gives values for temperature of state 3 and applies
equilibrate('TP') until the new enthalpy of state 3 be equal to the enthalpy of
state 2. It can be very useful if Cantera could do this internally.
Original comment by rodolfo.enq
on 18 May 2012 at 9:55
The problem is that your state 2 has an extremely non-physical composition and
extremely high enthalpy. You can get from State 3 to state 2 with the following:
gas.set(T = 300, P = OneAtm, X = 'C:1, H:4, O:4') # state #3
gas.equilibrate('TP', solver=1)
gas.set(H=h2, P=OneAtm)
gas.equilibrate('HP')
By equilibrating first at constant T and P, you get to a more realistic
composition while keeping T and P finite and positive. Then setting the
enthalpy to the value you want will work. Even in this case, I found it
necessary to use the alternative (nominally more stable) equilibrium solver.
Original comment by yarmond
on 19 May 2012 at 12:21
Thanks again, Ray. This solves my issue definitively.
Original comment by rodolfo.enq
on 19 May 2012 at 3:14
Original issue reported on code.google.com by
rodolfo.enq
on 20 Oct 2011 at 4:25Attachments: