dbirch997 / cantera

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

Temperature different in computation than what is defined #166

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Please download attached files and place in appropriate directories.
2. Run 'TEST.m'

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

The output in MATLAB will be a 2x100 matrix with the first column as time and 
the second column as temperature.  The temperature in the second column is not 
what I am setting it as 
'set(gas,'T',1001.0,'P',6e5,'X','ic3h7oh:1,h2o:1,n2:398');'.  Instead the 
computation outputs a temperature of ~628 K.  I have run all the tutorials 
successfully.

What version of the product are you using? On what operating system?

Cantera-1.70.win32-py2.5/Python 2.7/Windows 7/Matlab R2012a

Please provide any additional information below.

I just downloaded Cantera yesterday and begun using it today.  I apologize if 
this is a 'newbie' error on my part.  thanks!

Original issue reported on code.google.com by heyne...@gmail.com on 9 Jul 2013 at 8:43

Attachments:

GoogleCodeExporter commented 9 years ago
That's an old version of Cantera. Can you try downloading the current version 
(2.0.2) from this site and seeing if you still have the same problem?

Original comment by yarmond on 9 Jul 2013 at 11:26

GoogleCodeExporter commented 9 years ago
Thanks for the response.  I am having the same problem... There is an error 
that is time step sensitive as well.  At larger time steps the error reproduced 
in full below is returned.
    Error using ctmethods
    ************************************************
                Cantera Error!
    ************************************************

    Procedure: CVodesIntegrator
    Error:    CVodes error encountered. Error code: -3

    Error in reactornetmethods (line 6)
        v = ctmethods(65, n, job, a);

    Error in ReactorNet/advance (line 22)
    reactornetmethods(8, reactornet_hndl(n), tout);

    Error in reactor1JSHedit (line 49)
      advance(network, t);

Thanks again!

Original comment by heyne...@gmail.com on 10 Jul 2013 at 1:59

GoogleCodeExporter commented 9 years ago
The problem here is that you have your Reactor at P=6e5 Pa connected to a 
Reservoir at P=101325 Pa. As soon as the time integration starts, the wall 
moves in response to the pressure difference, so the gas in your reactor 
expands isentropically and the temperature drops to the value you're seeing. 
This happens very fast because the "ExpansionRateCoeff" is set to such a large 
value.

To fix the issue with the pressure: Set the state of reservoir gas "a" to the 
same pressure as the Reactor before creating the Reservoir object.

One likely reason you're seeing integration errors is because the 
ExpansionRateCoeff is too high and is introducing extremely short time scales 
into the system. You should probably set it to something more like 1e3 or so. 
You can examine the pressure variation after the fact to verify that it is 
sufficiently small.

[The "reactor1.m" example should be updated to set the pressure of the 
reservoir object explicitly, instead of using the default pressure from the 
.cti file]

Original comment by yarmond on 11 Jul 2013 at 1:16

GoogleCodeExporter commented 9 years ago
Just ran it with your corrections! Looks great so far! Thanks and sorry for the 
trouble.

Original comment by heyne...@gmail.com on 11 Jul 2013 at 1:27

GoogleCodeExporter commented 9 years ago

Original comment by yarmond on 11 Jul 2013 at 2:51

GoogleCodeExporter commented 9 years ago
The changes in r2476 should resolve this confusion.

Original comment by yarmond on 16 Jul 2013 at 10:12