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

Adding thermophysical model to chemistryType runtime table

Register Blogs Community New Posts Updated Threads Search

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   February 4, 2014, 22:00
Default Adding thermophysical model to chemistryType runtime table
  #1
Member
 
Chris
Join Date: Aug 2012
Location: Calgary, Alberta, Canada
Posts: 77
Rep Power: 13
ChrisA is on a distinguished road
I'm attempting to add a thermophysical model (myGasThermoPhysics) to the chemistry model runtime selection table so I can use my own Cp and viscosity in my reacting simulations. I've managed to get it added to the selection table as evidenced by:

Code:
ode                psi              hollis      myJanaf      perfectGas                specie  sensibleEnthalpy
When I error out the thermoType. However, when I attempt to run the simulations I get the following error:

Code:
Selecting combustion model PaSR<psiChemistryCombustion>
Selecting chemistry type 
{
    chemistrySolver ode;
    chemistryThermo psi;
}

Selecting thermodynamics package 
{
    type            hePsiThermo;
    mixture         massAveragedMixture;
    transport       hollis;
    thermo          myJanaf;
    energy          sensibleEnthalpy;
    equationOfState perfectGas;
    specie          specie;
}

terminate called after throwing an instance of 'std::bad_cast'
  what():  std::bad_cast
Aborted (core dumped)
which basically means I've missed something. The steps I've taken to get this far are the following:

In my custom library where the custom Cp, viscosity and mixtures are defined I created 3 files with the following code sections:

Code:
#include "makeChemistrySolverTypes.H"
#include "speciesPhysicsTypes.H"
//#include "thermoPhysicsTypes.H"
#include "psiChemistryModel.H"
#include "rhoChemistryModel.H"

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

namespace Foam
{
    // Chemistry solvers based on sensibleEnthalpy
    makeChemistrySolverTypes(psiChemistryModel, myGasThermoPhysics);

}
Code:
#ifndef reactionTypes_H
#define reactionTypes_H

//#include "thermoPhysicsTypes.H"
#include "Reaction.H"
#include "speciesPhysicsTypes.H"

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

namespace Foam
{

    typedef Reaction<myGasThermoPhysics> myGasReaction;

}

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

#endif
Code:
#include "makeChemistryModel.H"
#include "speciesPhysicsTypes.H"
#include "psiChemistryModel.H"
#include "chemistryModel.H"
//#include "thermoPhysicsTypes.H"

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

namespace Foam
{
    // Chemistry moldels based on sensibleEnthalpy
    makeChemistryModel
    (
        chemistryModel,
        psiChemistryModel,
        myGasThermoPhysics
    );

}
where speciesPhysicsTypes.H defines myGasThermoPhysics

I then of course added them as make targets in the Make/files file and added the proper lnInclude folders in the Make/options file.

As far as I can tell from the source this is all I need to do to add a thermophysical model to the runtime selection for the chemistry, but I seem to be missing something given the error. Can anyone shed some light on this?
ChrisA is offline   Reply With Quote

 


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding a Turbulence Model doug OpenFOAM Running, Solving & CFD 11 May 21, 2018 13:54
Problem in3D model processing mebinitap OpenFOAM 2 December 12, 2014 04:40
Adding a turbulence model into my own CFD code quarkz Main CFD Forum 3 November 23, 2013 22:53
DPM model w/ Wave model - errors in documentation HS FLUENT 0 April 12, 2006 04:37
Advanced Turbulence Modeling in Fluent, Realizable k-epsilon Model Jonas Larsson FLUENT 5 March 13, 2000 03:27


All times are GMT -4. The time now is 04:59.