hkmoffat / cantera

Automatically exported from code.google.com/p/cantera
0 stars 0 forks source link

wrong result with: setState_SV() #151

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1.When calculating a simple compression, equilibration, expansion process 
sometimes the final step which should be isentropic expansion with 
setState_SV()  ends in a state with different entropy but constant internal 
energy/Temperature. I am attaching a simple script, when AR is replaced by N2 
everything seems to be fine again.
2.
3.

What is the expected output? What do you see instead?

Check the two printed lines (equilibrated and Final state) of the attached 
script, both printed lines consist of: T,p,v,u,s

Thus u should differ, s should not, for the final line.
However the output is:
[  8.65957173e+02   6.02348002e+06   3.86020859e-02  -1.23408976e+06
   5.40020962e+03] equilibrated
[  8.65957164e+02   3.01173998e+05   7.72041717e-01  -1.23408976e+06
   6.20459621e+03] Final state, expanded

What version of the product are you using? On what operating system?
Cantera 2.0.2. within python 2.7(python(x,y) , Windows 7

Please provide any additional information below.

Original issue reported on code.google.com by Burak.At...@gmail.com on 19 Mar 2013 at 3:28

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by yarmond on 19 Mar 2013 at 7:15

GoogleCodeExporter commented 9 years ago
Hi,

Not a fix, but just a comment on the issue. It seems that the error is 
encountered only when the final temperature (st3[0]) is (or should be) lower 
than the minimum temperature for which some thermodynamic data is available in 
the phase (g.minTemp()=300K in that case). 

This can be seen by looking at the attached graphs, that I obtained from a 
script derived from your example (see attached). In those two graphs, I plot 
the final temperature after the last setState_SV as a function of the initial 
gas temperature for different mole fractions of AR and N2. 

When setState_SV() fails (wrong value of the final entropy), the final 
temperature stays very high, to its pre-expansion value. When it succeeds, the 
final temperature is lower. From the two plots, you see that as long as the 
final temperature is above 300K, setState_SV functions properly.

Hope this helps,
Charles

Original comment by chdoi...@gmail.com on 1 Jul 2013 at 9:08

Attachments:

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r2482.

Original comment by yarmond on 18 Jul 2013 at 7:07