CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

What does the 'makeChemistryModel.H' file do?

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   October 31, 2011, 14:50
Default What does the 'makeChemistryModel.H' file do?
  #1
Senior Member
 
Adhiraj
Join Date: Sep 2010
Location: Pennsylvania, United States
Posts: 101
Rep Power: 6
adhiraj is on a distinguished road
Hi all,
I am talking about the file
Quote:
~/OpenFOAM/OpenFOAM-1.7.1/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/makeChemistryModel.H
Thanks in advance.
adhiraj is offline   Reply With Quote

Old   November 14, 2013, 13:02
Default ODE Solvers for Chemistry Models
  #2
New Member
 
Manuel
Join Date: Jan 2013
Posts: 21
Rep Power: 4
Manuel CFD is on a distinguished road
I have the same question; ODEChemistryModel class appears as argument of makeChemistryModel, but looking at the source files it doesn't seem connected to any derived class among basicChemistryModel, psiChemistryModel and rhoChemistryModel.
Thanks
Manuel CFD is offline   Reply With Quote

Old   November 14, 2013, 14:45
Default
  #3
Senior Member
 
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 397
Rep Power: 12
marupio is on a distinguished road
In 1.6 it makes sense, I'm not sure if it was removed from 1.7 and left the macro definition file by accident... but this file defines a macro that other files invoke to create their instantiations.

Look for derived chemistry models ending in "s.C", such as psiChemistryModels.C.
__________________
~~~
Follow me on twitter @DavidGaden
marupio is offline   Reply With Quote

Old   November 15, 2013, 06:25
Default
  #4
New Member
 
Manuel
Join Date: Jan 2013
Posts: 21
Rep Power: 4
Manuel CFD is on a distinguished road
Thank you a lot for your answer.

Only to be more precise: this means that virtual functions defined in .H files (such as solve() and calculate() virtual methods inserted in psiChemistryModel.H) can be explicited in other .H files (ODEChemistryModel.H), not directly connected to the previous ones (psiChemistryModel.H doesnt include any link to ODEChemistryModel.H)??

If I understood well the psiChemistryModels.C establishes this kind of connection between ODEChemistryModel class and psiChemistryModel one??

Furthermore let consider the following lines appearing in psiChemistryModels.H (OpenFoam version 2.1.1):

namespace Foam
{
makeChemistryModel
(
ODEChemistryModel,
psiChemistryModel,
gasThermoPhysics
);
}

When the compiler reads these lines, what does it do? Is it correct to say that it creates a common space where the three arguments share their functions/methods???
I thank you a lot in advance.

Manuel
Manuel CFD is offline   Reply With Quote

Old   November 15, 2013, 17:40
Default
  #5
Senior Member
 
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 397
Rep Power: 12
marupio is on a distinguished road
ODEChemistryModel is entirely different from the other derived classes in the folder. It doesn't inherit basicChemistryModel. If you expand the makeChemistryModel define, you will see. Take psiChemistry, for instance:

Code:
    makeChemistryModel
    (
        ODEChemistryModel,
        psiChemistryModel,
        gasThermoPhysics
    );
expands into:
Code:
typedef ODEChemistryModel<psiChemistryModel, gasThermoPhysics> 
    ODEChemistryModelpsiChemistryModelgasThermoPhysics;

defineTemplateTypeNameAndDebugWithName
(
    ODEChemistryModelpsiChemistryModelgasThermoPhysics,
    "ODEChemistryModel<psiChemistryModel,gasThermoPhysics>",
    0
);

addToRunTimeSelectionTable
(
    psiChemistryModel,
    ODEChemistryModelpsiChemistryModelgasThermoPhysics,
    fvMesh
);
Two of those are also macros that expand. defineTemplateTypeName... adds static data members for OpenFOAM's built-in class name and debug tracking system. The addToRunTimeSelection.. is for OpenFOAM's runTime selection mechanism, which adds virtual constructors for this chemistry model... basically when the user puts this chemistry model into the input file, OpenFOAM knows which piece of code to load, even if it is a brand new piece of code that didn't exist when OpenFOAM was compiled on your machine.

I'm sure I'm being confusing. Also running out of time before I have to jet!

-Dave
__________________
~~~
Follow me on twitter @DavidGaden
marupio is offline   Reply With Quote

Old   November 18, 2013, 06:06
Default
  #6
New Member
 
Manuel
Join Date: Jan 2013
Posts: 21
Rep Power: 4
Manuel CFD is on a distinguished road
Hi marupio,

Thanks a lot for your explanation. This feature is now clear to me.
Anyway I have still a doubt: what is the product of the following lines

makeChemistryModel
(
ODEChemistryModel,
psiChemistryModel,
gasThermoPhysics
);

?? Are the 3 classes gathered in a single class??

Because if it does not happen, I can't understand how a function/method of psiChemistryModel class could be specified in ODEChemistryModel class, since ODEChemistryModel does not inherit psiChemistryModel.

Thank you.

Manuel
Manuel CFD is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
GroovyBC the dynamic cousin of funkySetFields that lives on the suburb of the mesh gschaider OpenFOAM 300 October 29, 2014 19:00
channelFoam for a 3D pipe AlmostSurelyRob OpenFOAM 3 June 24, 2011 13:06
1.7.x Environment Variables on Linux 10.04 rasma OpenFOAM Installation 9 July 30, 2010 04:43
BlockMesh FOAM warning gaottino OpenFOAM Native Meshers: blockMesh 7 July 19, 2010 14:11
ParaView Compilation jakaranda OpenFOAM Installation 3 October 27, 2008 12:46


All times are GMT -4. The time now is 13:27.