SOFC demo for Matlab

343 views
Skip to first unread message

franzf...@yahoo.it

unread,
Jun 27, 2011, 1:49:11 PM6/27/11
to Cantera User's Group
Hi to everyone! I installed Cantera 1.6 for Matlab 2009a and I was
looking for a SOFC demo when I found the translation into Matlab code
made by Steven DeCaluwe at http://groups.google.com/group/cantera-users/browse_thread/thread/23a67437384f2b1c.
That's awesome and it contains a lot of folders with instructions
about where to put them but I couldn't find sofc.cti file anywhere.
How can I get it? Can anyone give it to me please?

Thanks a lot!

Steven DeCaluwe

unread,
Jun 29, 2011, 10:54:39 AM6/29/11
to canter...@googlegroups.com
Hi Franz,

I've attached it here.  It also comes with the Cantera installation - depending on your installation, I have found it in either of two locations:  Cantera\demos\Python\fuel_cells\
and
Cantera\python\examples\fuel_cells\

I should emphasize that the demo, as written by Dr. Goodwin, is for demonstration purposes only - the kinetics, thermo, and general approach are not intended to give accurate results, only to demonstrate one approach to modeling fuel cells in Cantera.

Best of luck,
Steven






--
You received this message because you are subscribed to the Google Groups "Cantera User's Group" group.
To post to this group, send email to canter...@googlegroups.com.
To unsubscribe from this group, send email to cantera-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cantera-users?hl=en.


sofc.cti

franzf...@yahoo.it

unread,
Jun 29, 2011, 5:35:21 PM6/29/11
to Cantera User's Group
Hi Steven,
thank you so much for your help.

I'm sorry to say that I still have problems when running the sofc
demo. I couldn't find the file you gave me anywhere (maybe it's
because of a different installation or a different version of Cantera,
isn't it?). However, I put it into the data folder but some errors
still occurr while running the demo and I really don't know where they
come from. Here they are:


>>>> WARNING: method Kinetics(thermo_t*) of class Kinetics is deprecated.
Use method Kinetics() instead.
(If you want to rescue this method from deprecated
status, see http://www.cantera.org/deprecated.html)>>>>
WARNING: method Kinetics(thermo_t*) of class Kinetics is deprecated.
Use method Kinetics() instead.
(If you want to rescue this method from deprecated
??? Error using ==> ctmethods
unknown attribute.

Error in ==> thermo_set at 5
i = ctmethods(20,n,-job,a);

Error in ==> ThermoPhase.setElectricPotential at 4
thermo_set(a.tp_id,2,phi);
Error in ==> cantera_sofc_demo>anode_curr at 111
setElectricPotential(anode_bulk,E);

Error in ==> cantera_sofc_demo>NewtonSolver at 52
f0 = f(X_in) - C;

Error in ==> cantera_sofc_demo at 203
Ea0 = NewtonSolver(@anode_curr,-0.51,0);


Can you please give me any suggestion about it? I'm trying to use
Cantera to make a preliminar study on SOFC for my thesis research and
I need to make it work before starting to use a more complex software
(Detchem) but since Cantera is not so used for this kind of problems
in my university, nobody can actually give me any help.

Thanks a lot for your kind help.

Franz







On Jun 29, 4:54 pm, Steven DeCaluwe <steven.decal...@gmail.com> wrote:
> Hi Franz,
>
> I've attached it here.  It also comes with the Cantera installation -
> depending on your installation, I have found it in either of two locations:
> Cantera\demos\Python\fuel_cells\
> and
> Cantera\python\examples\fuel_cells\
>
> I should emphasize that the demo, as written by Dr. Goodwin, is for
> demonstration purposes only - the kinetics, thermo, and general approach are
> not intended to give accurate results, only to demonstrate one approach to
> modeling fuel cells in Cantera.
>
> Best of luck,
> Steven
>
> On Mon, Jun 27, 2011 at 1:49 PM, franzf1ra...@yahoo.it <
>
>
>
>
>
>
>
> franzf1ra...@yahoo.it> wrote:
> > Hi to everyone! I installed Cantera 1.6 for Matlab 2009a and I was
> > looking for a SOFC demo when I found the translation into Matlab code
> > made by Steven DeCaluwe at
> >http://groups.google.com/group/cantera-users/browse_thread/thread/23a...
> > .
> > That's awesome and it contains a lot of folders with instructions
> > about where to put them but I couldn't find sofc.cti file anywhere.
> > How can I get it? Can anyone give it to me please?
>
> > Thanks a lot!
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Cantera User's Group" group.
> > To post to this group, send email to canter...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > cantera-user...@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/cantera-users?hl=en.
>
>
>
>  sofc.cti
> 17KViewDownload

Steven DeCaluwe

unread,
Jun 29, 2011, 6:12:14 PM6/29/11
to canter...@googlegroups.com
Hi Franz,

Which version of Cantera are you using?

This error seems a little odd to me - thermo_set.m is calling ctmethods.cpp, and passing a case number (20, which denotes a thermodynamic function),  plus the phase handle, the job # (corresponding to the setElectricPotential function), and the electric potential input.

All ctmethods.cpp is supposed to do is read in the case number, realize that it's a thermodynamic function, and then call thermomethods.cpp, passing the other arguments to this function.  So even if there is something wrong with my instructions, or 'setElectricPotential.m' hasn't been installed correctly, or some other problem, it should not throw an error at this point.

A couple of questions:
1.  Are you able to run other demos?  Could it be that your Cantera simply can't call ctmethods?

2.  Related sub-question: can you (or anyone else here) tell if the error is thrown from inside ctmethods, or if the problem is indeed with calling ctmethods itself?

Cheers,
Steven

franzf...@yahoo.it

unread,
Jun 30, 2011, 2:29:24 PM6/30/11
to Cantera User's Group
Hi Steven,

I'm using Cantera 1.6 for Matlab R2009a. All demos are OK. I just
can't run the SOFC one. I can't even actually tell you either where
the error with ctmethods.cpp comes from or if my Cantera can't call it
at all. Do you think I should change my Cantera version? If you do,
which one do you suggest me by considering my version of Matlab?

I extremely appreciate your help again.

Thanks!

Franz










On Jun 30, 12:12 am, Steven DeCaluwe <steven.decal...@gmail.com>
wrote:
> Hi Franz,
>
> Which version of Cantera are you using?
>
> This error seems a little odd to me - thermo_set.m is calling ctmethods.cpp,
> and passing a case number (20, which denotes a thermodynamic function),
> plus the phase handle, the job # (corresponding to the setElectricPotential
> function), and the electric potential input.
>
> All ctmethods.cpp is supposed to do is read in the case number, realize that
> it's a thermodynamic function, and then call thermomethods.cpp, passing the
> other arguments to this function.  So even if there is something wrong with
> my instructions, or 'setElectricPotential.m' hasn't been installed
> correctly, or some other problem, it should not throw an error at this
> point.
>
> A couple of questions:
> 1.  Are you able to run other demos?  Could it be that your Cantera simply
> can't call ctmethods?
>
> 2.  Related sub-question: can you (or anyone else here) tell if the error is
> thrown from inside ctmethods, or if the problem is indeed with calling
> ctmethods itself?
>
> Cheers,
> Steven
>
> On Wed, Jun 29, 2011 at 5:35 PM, franzf1ra...@yahoo.it <
>
>
>
>
>
>
>
> franzf1ra...@yahoo.it> wrote:
> > Hi Steven,
> > thank you so much for your help.
>
> > I'm sorry to say that I still have problems when running the sofc
> > demo. I couldn't find the file you gave me anywhere (maybe it's
> > because of a different installation or a different version of Cantera,
> > isn't it?). However, I put it into the data folder but some errors
> > still occurr while running the demo and I really don't know where they
> > come from. Here they are:
>
> > >>>> WARNING: method Kinetics(thermo_t*) of class Kinetics is deprecated.
> >          Use method Kinetics() instead.
> >          (If you want to rescue this method from deprecated
> >          status, seehttp://www.cantera.org/deprecated.html)>>>>
Reply all
Reply to author
Forward
0 new messages