SD Toolbox and ZND calculations

332 views
Skip to first unread message

Jon Tegner

unread,
Mar 16, 2017, 10:48:44 AM3/16/17
to cantera-users
Hi, have installed the SD toolbox (http://shepherd.caltech.edu/EDL/public/cantera/html/SD_Toolbox/) and that seemd to work. Included in the link above there are also C++ code for solving ZND-problems.

I did not succeed in building these using Cantera-2.3, however, on Cantera-2.1 they did build. It seems that the compilation of the ZND-codes require a set of include files of which two are missing in 2.3: "equilibrium.h" and "equil.h" (at least as I interpreted it).

Since I managed to build on 2.1 this is no big problem for me, but if I missed something and there is a quick fix for this I would certainly prefer to have it running on 2.3, nd any hints would be appreciated

All on Fedora24.

Thanks,

/jon

Ray Speth

unread,
Mar 16, 2017, 7:33:35 PM3/16/17
to Cantera Users' Group

Hi Jon,

Since the current version of the SD Toolbox targets Cantera 2.1, it misses some of the API changes that have come in more recent versions. Among these is the fact that “equilibrate” is no longer a function but instead a method of the ThermoPhase class. As such, these headers are no longer necessary and calls to:

equilibrate(gas, ...);

should be replaced with

gas.equilibrate(...);

(assuming gas is an object derived from ThermoPhase, e.g. IdealGasMix).

Regards,
Ray

Jon Tegner

unread,
Mar 17, 2017, 5:40:48 AM3/17/17
to cantera-users
Thanks Ray,

tried this, but got complaints of the type

../src/ps/postshock_fcn.cpp: In function ‘double CJSpeed2(Cantera::IdealGasMix*, Cantera::IdealGasMix*, Cantera::IdealGasMix*)’:
../src/ps/postshock_fcn.cpp:386:7: error: request for member ‘equilibrate’ in ‘gas’, which is of pointer type ‘Cantera::IdealGasMix*’ (maybe you meant to use ‘->’ ?)
   gas.equilibrate("UV");

My knowledge of c++ is VERY limited, so I really don't know what to do with
this. Tried

gas->equilibrate("UV");

however, after which it compiled, but trying to run faild with

NotImplementedError thrown by FuncEval::getState:
Not implemented.

As I wrote, I can use installation under 2.1, so this is really of no big importance (mostly curious).

Regards,
/jon

--
You received this message because you are subscribed to the Google Groups "Cantera Users' Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cantera-users+unsubscribe@googlegroups.com.
To post to this group, send email to canter...@googlegroups.com.
Visit this group at https://groups.google.com/group/cantera-users.
For more options, visit https://groups.google.com/d/optout.

Matei Radulescu

unread,
Mar 17, 2017, 8:37:54 AM3/17/17
to canter...@googlegroups.com
Jon,
A few months ago, I posted on this archive a ZND code written in python.  
matei
To unsubscribe from this group and stop receiving emails from it, send an email to cantera-user...@googlegroups.com.

Ray Speth

unread,
Mar 17, 2017, 6:01:29 PM3/17/17
to Cantera Users' Group
Jon,

Your change is fine for the equilibrate method -- what I wrote assumed that you had a reference to an IdealGasMix object, but if it's a pointer then the dot should be a "->" instead. I guess that updating the SD Toolbox to Cantera 2.3. will require some more work from its maintainers.

Regards,
Ray

Jon Tegner

unread,
Mar 20, 2017, 2:55:27 AM3/20/17
to canter...@googlegroups.com
Yes, I noticed. Haven't tried it yet (will do).

Thanks for the hint!

/Jon
To unsubscribe from this group and stop receiving emails from it, send an email to cantera-user...@googlegroups.com.
To post to this group, send email to canter...@googlegroups.com.
Visit this group at https://groups.google.com/group/cantera-users.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Cantera Users' Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cantera-user...@googlegroups.com.
To post to this group, send email to canter...@googlegroups.com.
Visit this group at https://groups.google.com/group/cantera-users.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages