combustionModel, chemistryModel: Simplified model selection

The combustion and chemistry model selection has been simplified so
that the user does not have to specify the form of the thermodynamics.

Examples of new combustion and chemistry entries are as follows:

    In constant/combustionProperties:

        combustionModel PaSR;

        combustionModel FSD;

    In constant/chemistryProperties:

        chemistryType
        {
            solver          ode;
            method          TDAC;
        }

All the angle bracket parts of the model names (e.g.,
<psiThermoCombustion,gasHThermoPhysics>) have been removed as well as
the chemistryThermo entry.

The changes are mostly backward compatible. Only support for the
angle bracket form of chemistry solver names has been removed. Warnings
will print if some of the old entries are used, as the parts relating to
thermodynamics are now ignored.
This commit is contained in:
Will Bainbridge
2017-12-07 11:54:48 +00:00
parent dfd7d0b5b4
commit 61cab84fa6
107 changed files with 1720 additions and 2345 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -33,7 +33,8 @@ Description
#include "fvCFD.H"
#include "psiReactionThermo.H"
#include "psiChemistryModel.H"
#include "BasicChemistryModel.H"
#include "reactingMixture.H"
#include "chemistrySolver.H"
#include "OFstream.H"
#include "thermoPhysicsTypes.H"

View File

@ -1,5 +1,8 @@
psiChemistryModel& chemistry = pChemistry();
scalar dtChem = refCast<const psiChemistryModel>(chemistry).deltaTChem()[0];
BasicChemistryModel<psiReactionThermo>& chemistry = pChemistry();
scalar dtChem = refCast<const BasicChemistryModel<psiReactionThermo>>
(
chemistry
).deltaTChem()[0];
basicMultiComponentMixture& composition = thermo.composition();
PtrList<volScalarField>& Y = composition.Y();
volScalarField& p = thermo.p();

View File

@ -28,7 +28,10 @@
psiReactionThermo& thermo = pThermo();
thermo.validate(args.executable(), "h");
autoPtr<psiChemistryModel> pChemistry(psiChemistryModel::New(thermo));
autoPtr<BasicChemistryModel<psiReactionThermo>> pChemistry
(
BasicChemistryModel<psiReactionThermo>::New(thermo)
);
volScalarField rho
(

View File

@ -65,9 +65,13 @@ autoPtr<compressible::turbulenceModel> turbulence
);
Info<< "Creating combustion model\n" << endl;
autoPtr<combustionModels::psiCombustionModel> combustion
autoPtr<combustionModels::CombustionModel<psiReactionThermo>> combustion
(
combustionModels::psiCombustionModel::New(thermo, turbulence())
combustionModels::CombustionModel<psiReactionThermo>::New
(
thermo,
turbulence()
)
);

View File

@ -38,7 +38,8 @@ Description
#include "radiationModel.H"
#include "SLGThermo.H"
#include "solidChemistryModel.H"
#include "psiCombustionModel.H"
#include "psiReactionThermo.H"
#include "CombustionModel.H"
#include "pimpleControl.H"
#include "fvOptions.H"

View File

@ -62,9 +62,13 @@ autoPtr<compressible::turbulenceModel> turbulence
);
Info<< "Creating reaction model\n" << endl;
autoPtr<combustionModels::psiCombustionModel> reaction
autoPtr<combustionModels::CombustionModel<psiReactionThermo>> reaction
(
combustionModels::psiCombustionModel::New(thermo, turbulence())
combustionModels::CombustionModel<psiReactionThermo>::New
(
thermo,
turbulence()
)
);
Info<< "Creating field dpdt\n" << endl;

View File

@ -31,7 +31,8 @@ Description
#include "fvCFD.H"
#include "turbulentFluidThermoModel.H"
#include "psiCombustionModel.H"
#include "psiReactionThermo.H"
#include "CombustionModel.H"
#include "multivariateScheme.H"
#include "pimpleControl.H"
#include "pressureControl.H"

View File

@ -63,9 +63,13 @@ autoPtr<compressible::turbulenceModel> turbulence
);
Info<< "Creating reaction model\n" << endl;
autoPtr<combustionModels::rhoCombustionModel> reaction
autoPtr<combustionModels::CombustionModel<rhoReactionThermo>> reaction
(
combustionModels::rhoCombustionModel::New(thermo, turbulence())
combustionModels::CombustionModel<rhoReactionThermo>::New
(
thermo,
turbulence()
)
);
#include "readGravitationalAcceleration.H"

View File

@ -31,7 +31,8 @@ Description
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "rhoCombustionModel.H"
#include "rhoReactionThermo.H"
#include "CombustionModel.H"
#include "turbulentFluidThermoModel.H"
#include "multivariateScheme.H"
#include "pimpleControl.H"

View File

@ -65,9 +65,13 @@ autoPtr<compressible::turbulenceModel> turbulence
);
Info<< "Creating reaction model\n" << endl;
autoPtr<combustionModels::rhoCombustionModel> reaction
autoPtr<combustionModels::CombustionModel<rhoReactionThermo>> reaction
(
combustionModels::rhoCombustionModel::New(thermo, turbulence())
combustionModels::CombustionModel<rhoReactionThermo>::New
(
thermo,
turbulence()
)
);

View File

@ -31,7 +31,8 @@ Description
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "rhoCombustionModel.H"
#include "rhoReactionThermo.H"
#include "CombustionModel.H"
#include "turbulentFluidThermoModel.H"
#include "multivariateScheme.H"
#include "pimpleControl.H"

View File

@ -34,7 +34,8 @@ Description
#include "turbulentFluidThermoModel.H"
#include "basicThermoCloud.H"
#include "coalCloud.H"
#include "psiCombustionModel.H"
#include "psiReactionThermo.H"
#include "CombustionModel.H"
#include "fvOptions.H"
#include "radiationModel.H"
#include "SLGThermo.H"

View File

@ -108,9 +108,13 @@ autoPtr<compressible::turbulenceModel> turbulence
);
Info<< "Creating combustion model\n" << endl;
autoPtr<combustionModels::psiCombustionModel> combustion
autoPtr<combustionModels::CombustionModel<psiReactionThermo>> combustion
(
combustionModels::psiCombustionModel::New(thermo, turbulence())
combustionModels::CombustionModel<psiReactionThermo>::New
(
thermo,
turbulence()
)
);
Info<< "Creating field dpdt\n" << endl;

View File

@ -64,9 +64,13 @@ autoPtr<compressible::turbulenceModel> turbulence
);
Info<< "Creating combustion model\n" << endl;
autoPtr<combustionModels::rhoCombustionModel> combustion
autoPtr<combustionModels::CombustionModel<rhoReactionThermo>> combustion
(
combustionModels::rhoCombustionModel::New(thermo, turbulence())
combustionModels::CombustionModel<rhoReactionThermo>::New
(
thermo,
turbulence()
)
);
Info<< "Creating field dpdt\n" << endl;

View File

@ -34,7 +34,8 @@ Description
#include "turbulentFluidThermoModel.H"
#include "basicReactingMultiphaseCloud.H"
#include "surfaceFilmModel.H"
#include "rhoCombustionModel.H"
#include "rhoReactionThermo.H"
#include "CombustionModel.H"
#include "radiationModel.H"
#include "SLGThermo.H"
#include "fvOptions.H"

View File

@ -87,9 +87,13 @@ autoPtr<compressible::turbulenceModel> turbulence
);
Info<< "Creating combustion model\n" << endl;
autoPtr<combustionModels::rhoCombustionModel> combustion
autoPtr<combustionModels::CombustionModel<rhoReactionThermo>> combustion
(
combustionModels::rhoCombustionModel::New(thermo, turbulence())
combustionModels::CombustionModel<rhoReactionThermo>::New
(
thermo,
turbulence()
)
);
Info<< "Creating multi-variate interpolation scheme\n" << endl;

View File

@ -33,7 +33,8 @@ Description
#include "fvCFD.H"
#include "turbulentFluidThermoModel.H"
#include "basicReactingMultiphaseCloud.H"
#include "rhoCombustionModel.H"
#include "rhoReactionThermo.H"
#include "CombustionModel.H"
#include "radiationModel.H"
#include "IOporosityModelList.H"
#include "fvOptions.H"

View File

@ -87,9 +87,13 @@ autoPtr<compressible::turbulenceModel> turbulence
);
Info<< "Creating combustion model\n" << endl;
autoPtr<combustionModels::psiCombustionModel> combustion
autoPtr<combustionModels::CombustionModel<psiReactionThermo>> combustion
(
combustionModels::psiCombustionModel::New(thermo, turbulence())
combustionModels::CombustionModel<psiReactionThermo>::New
(
thermo,
turbulence()
)
);
Info<< "Creating field dpdt\n" << endl;

View File

@ -35,7 +35,8 @@ Description
#include "engineMesh.H"
#include "turbulentFluidThermoModel.H"
#include "basicSprayCloud.H"
#include "psiCombustionModel.H"
#include "psiReactionThermo.H"
#include "CombustionModel.H"
#include "radiationModel.H"
#include "SLGThermo.H"
#include "pimpleControl.H"

View File

@ -34,7 +34,8 @@ Description
#include "dynamicFvMesh.H"
#include "turbulenceModel.H"
#include "basicSprayCloud.H"
#include "psiCombustionModel.H"
#include "psiReactionThermo.H"
#include "CombustionModel.H"
#include "radiationModel.H"
#include "SLGThermo.H"
#include "pimpleControl.H"

View File

@ -33,7 +33,8 @@ Description
#include "fvCFD.H"
#include "turbulentFluidThermoModel.H"
#include "basicSprayCloud.H"
#include "psiCombustionModel.H"
#include "psiReactionThermo.H"
#include "CombustionModel.H"
#include "radiationModel.H"
#include "SLGThermo.H"
#include "pimpleControl.H"

View File

@ -98,6 +98,12 @@ void Foam::twoPhaseMixtureThermo::correct()
}
Foam::word Foam::twoPhaseMixtureThermo::thermoName() const
{
return thermo1_->thermoName() + ',' + thermo2_->thermoName();
}
bool Foam::twoPhaseMixtureThermo::incompressible() const
{
return thermo1_->incompressible() && thermo2_->incompressible();

View File

@ -113,6 +113,9 @@ public:
//- Update mixture properties
virtual void correct();
//- Return the name of the thermo physics
virtual word thermoName() const;
//- Return true if the equation of state is incompressible
// i.e. rho != f(p)
virtual bool incompressible() const;

View File

@ -152,6 +152,21 @@ void Foam::multiphaseMixtureThermo::correctRho(const volScalarField& dp)
}
Foam::word Foam::multiphaseMixtureThermo::thermoName() const
{
PtrDictionary<phaseModel>::const_iterator phasei = phases_.begin();
word name = phasei().thermo().thermoName();
for (++ phasei; phasei != phases_.end(); ++ phasei)
{
name += ',' + phasei().thermo().thermoName();
}
return name;
}
bool Foam::multiphaseMixtureThermo::incompressible() const
{
bool ico = true;

View File

@ -238,6 +238,9 @@ public:
//- Update densities for given pressure change
void correctRho(const volScalarField& dp);
//- Return the name of the thermo physics
virtual word thermoName() const;
//- Return true if the equation of state is incompressible
// i.e. rho != f(p)
virtual bool incompressible() const;

View File

@ -28,7 +28,7 @@ License
#include "rhoThermo.H"
#include "rhoReactionThermo.H"
#include "rhoCombustionModel.H"
#include "CombustionModel.H"
#include "phaseModel.H"
#include "ThermoPhaseModel.H"
@ -127,7 +127,7 @@ namespace Foam
<
ThermoPhaseModel<phaseModel, rhoReactionThermo>
>,
combustionModels::rhoCombustionModel
combustionModels::CombustionModel<rhoReactionThermo>
>
>
>

View File

@ -23,46 +23,51 @@ License
\*---------------------------------------------------------------------------*/
#include "psiChemistryCombustion.H"
#include "ChemistryCombustion.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::combustionModels::psiChemistryCombustion::psiChemistryCombustion
template<class ReactionThermo>
Foam::combustionModels::ChemistryCombustion<ReactionThermo>::ChemistryCombustion
(
const word& modelType,
psiReactionThermo& thermo,
ReactionThermo& thermo,
const compressibleTurbulenceModel& turb,
const word& combustionProperties
)
:
psiCombustionModel
CombustionModel<ReactionThermo>
(
modelType,
thermo,
turb,
combustionProperties
),
chemistryPtr_(psiChemistryModel::New(thermo))
chemistryPtr_(BasicChemistryModel<ReactionThermo>::New(thermo))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::combustionModels::psiChemistryCombustion::~psiChemistryCombustion()
template<class ReactionThermo>
Foam::combustionModels::ChemistryCombustion<ReactionThermo>::
~ChemistryCombustion()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::psiReactionThermo&
Foam::combustionModels::psiChemistryCombustion::thermo()
template<class ReactionThermo>
ReactionThermo&
Foam::combustionModels::ChemistryCombustion<ReactionThermo>::thermo()
{
return chemistryPtr_->thermo();
}
const Foam::psiReactionThermo&
Foam::combustionModels::psiChemistryCombustion::thermo() const
template<class ReactionThermo>
const ReactionThermo&
Foam::combustionModels::ChemistryCombustion<ReactionThermo>::thermo() const
{
return chemistryPtr_->thermo();
}

View File

@ -22,22 +22,22 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::rhoChemistryCombustion
Foam::ChemistryCombustion
Description
Density-based chemistry model wrapper for combustion models
Chemistry model wrapper for combustion models
SourceFiles
rhoChemistryCombustion.C
ChemistryCombustion.C
\*---------------------------------------------------------------------------*/
#ifndef rhoChemistryCombustion_H
#define rhoChemistryCombustion_H
#ifndef ChemistryCombustion_H
#define ChemistryCombustion_H
#include "autoPtr.H"
#include "rhoCombustionModel.H"
#include "rhoChemistryModel.H"
#include "CombustionModel.H"
#include "BasicChemistryModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -47,28 +47,20 @@ namespace combustionModels
{
/*---------------------------------------------------------------------------*\
class rhoChemistryCombustion Declaration
class ChemistryCombustion Declaration
\*---------------------------------------------------------------------------*/
class rhoChemistryCombustion
template<class ReactionThermo>
class ChemistryCombustion
:
public rhoCombustionModel
public CombustionModel<ReactionThermo>
{
// Private Member Functions
//- Construct as copy (not implemented)
rhoChemistryCombustion(const rhoChemistryCombustion&);
//- Disallow default bitwise assignment
void operator=(const rhoChemistryCombustion&);
protected:
// Protected data
//- Pointer to chemistry model
autoPtr<rhoChemistryModel> chemistryPtr_;
autoPtr<BasicChemistryModel<ReactionThermo>> chemistryPtr_;
public:
@ -76,26 +68,26 @@ public:
// Constructors
//- Construct from components and thermo
rhoChemistryCombustion
ChemistryCombustion
(
const word& modelType,
rhoReactionThermo& thermo,
ReactionThermo& thermo,
const compressibleTurbulenceModel& turb,
const word& combustionProperties
);
//- Destructor
virtual ~rhoChemistryCombustion();
virtual ~ChemistryCombustion();
// Member Functions
//- Return access to the thermo package
virtual rhoReactionThermo& thermo();
virtual ReactionThermo& thermo();
//- Return const access to the thermo package
virtual const rhoReactionThermo& thermo() const;
virtual const ReactionThermo& thermo() const;
};
@ -106,6 +98,12 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "ChemistryCombustion.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -23,25 +23,15 @@ License
\*---------------------------------------------------------------------------*/
#include "rhoCombustionModel.H"
/* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */
namespace Foam
{
namespace combustionModels
{
defineTypeNameAndDebug(rhoCombustionModel, 0);
defineRunTimeSelectionTable(rhoCombustionModel, dictionary);
}
}
#include "CombustionModel.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::combustionModels::rhoCombustionModel::rhoCombustionModel
template<class ReactionThermo>
Foam::combustionModels::CombustionModel<ReactionThermo>::CombustionModel
(
const word& modelType,
rhoReactionThermo& thermo,
ReactionThermo& thermo,
const compressibleTurbulenceModel& turb,
const word& combustionProperties
)
@ -50,15 +40,38 @@ Foam::combustionModels::rhoCombustionModel::rhoCombustionModel
{}
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
template<class ReactionThermo>
Foam::autoPtr<Foam::combustionModels::CombustionModel<ReactionThermo>>
Foam::combustionModels::CombustionModel<ReactionThermo>::New
(
ReactionThermo& thermo,
const compressibleTurbulenceModel& turb,
const word& combustionProperties
)
{
return
combustionModel::New<CombustionModel<ReactionThermo>>
(
thermo,
turb,
combustionProperties
);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::combustionModels::rhoCombustionModel::~rhoCombustionModel()
template<class ReactionThermo>
Foam::combustionModels::CombustionModel<ReactionThermo>::~CombustionModel()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
bool Foam::combustionModels::rhoCombustionModel::read()
template<class ReactionThermo>
bool Foam::combustionModels::CombustionModel<ReactionThermo>::read()
{
if (combustionModel::read())
{

View File

@ -22,25 +22,24 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::psiCombustionModel
Foam::CombustionModel
Description
Combustion models for compressibility-based thermodynamics
Combustion models for templated thermodynamics
SourceFiles
psiCombustionModelI.H
psiCombustionModel.C
psiCombustionModelNew.C
CombustionModelI.H
CombustionModel.C
CombustionModelNew.C
\*---------------------------------------------------------------------------*/
#ifndef psiCombustionModel_H
#define psiCombustionModel_H
#ifndef CombustionModel_H
#define CombustionModel_H
#include "combustionModel.H"
#include "autoPtr.H"
#include "runTimeSelectionTables.H"
#include "psiReactionThermo.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -50,41 +49,33 @@ namespace combustionModels
{
/*---------------------------------------------------------------------------*\
class psiCombustionModel Declaration
class CombustionModel Declaration
\*---------------------------------------------------------------------------*/
class psiCombustionModel
template<class ReactionThermo>
class CombustionModel
:
public combustionModel
{
// Private Member Functions
//- Construct as copy (not implemented)
psiCombustionModel(const psiCombustionModel&);
//- Disallow default bitwise assignment
void operator=(const psiCombustionModel&);
public:
//- Thermo type
typedef psiReactionThermo reactionThermo;
typedef ReactionThermo reactionThermo;
//- Runtime type information
TypeName("psiCombustionModel");
TypeName("CombustionModel");
//- Declare run-time constructor selection tables
declareRunTimeSelectionTable
(
autoPtr,
psiCombustionModel,
CombustionModel,
dictionary,
(
const word& modelType,
psiReactionThermo& thermo,
ReactionThermo& thermo,
const compressibleTurbulenceModel& turb,
const word& combustionProperties
),
@ -95,35 +86,35 @@ public:
// Constructors
//- Construct from components
psiCombustionModel
CombustionModel
(
const word& modelType,
psiReactionThermo& thermo,
ReactionThermo& thermo,
const compressibleTurbulenceModel& turb,
const word& combustionProperties
);
//- Selector
static autoPtr<psiCombustionModel> New
static autoPtr<CombustionModel> New
(
psiReactionThermo& thermo,
ReactionThermo& thermo,
const compressibleTurbulenceModel& turb,
const word& combustionProperties=combustionPropertiesName
);
//- Destructor
virtual ~psiCombustionModel();
virtual ~CombustionModel();
// Member Functions
//- Return access to the thermo package
virtual psiReactionThermo& thermo() = 0;
virtual ReactionThermo& thermo() = 0;
//- Return const access to the thermo package
virtual const psiReactionThermo& thermo() const = 0;
virtual const ReactionThermo& thermo() const = 0;
// IO
@ -140,6 +131,12 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "CombustionModel.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -23,18 +23,18 @@ License
\*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
#include "makeCombustionTypes.H"
inline Foam::rhoReactionThermo& Foam::rhoChemistryModel::thermo()
{
return thermo_;
}
#include "ChemistryCombustion.H"
#include "ThermoCombustion.H"
#include "rhoReactionThermo.H"
#include "psiReactionThermo.H"
inline const Foam::rhoReactionThermo& Foam::rhoChemistryModel::thermo() const
{
return thermo_;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makeCombustion(psiReactionThermo);
makeCombustion(rhoReactionThermo);
// ************************************************************************* //

View File

@ -23,39 +23,49 @@ License
\*---------------------------------------------------------------------------*/
#include "psiThermoCombustion.H"
#include "ThermoCombustion.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::combustionModels::psiThermoCombustion::psiThermoCombustion
template<class ReactionThermo>
Foam::combustionModels::ThermoCombustion<ReactionThermo>::ThermoCombustion
(
const word& modelType,
psiReactionThermo& thermo,
ReactionThermo& thermo,
const compressibleTurbulenceModel& turb
)
:
psiCombustionModel(modelType, thermo, turb, combustionPropertiesName),
CombustionModel<ReactionThermo>
(
modelType,
thermo,
turb,
combustionModel::combustionPropertiesName
),
thermo_(thermo)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::combustionModels::psiThermoCombustion::~psiThermoCombustion()
template<class ReactionThermo>
Foam::combustionModels::ThermoCombustion<ReactionThermo>::~ThermoCombustion()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::psiReactionThermo&
Foam::combustionModels::psiThermoCombustion::thermo()
template<class ReactionThermo>
ReactionThermo&
Foam::combustionModels::ThermoCombustion<ReactionThermo>::thermo()
{
return thermo_;
}
const Foam::psiReactionThermo&
Foam::combustionModels::psiThermoCombustion::thermo() const
template<class ReactionThermo>
const ReactionThermo&
Foam::combustionModels::ThermoCombustion<ReactionThermo>::thermo() const
{
return thermo_;
}

View File

@ -22,22 +22,21 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::rhoThermoCombustion
Foam::ThermoCombustion
Description
Density-based thermo model wrapper for combustion models
Thermo model wrapper for combustion models
SourceFiles
rhoThermoCombustion.C
ThermoCombustion.C
\*---------------------------------------------------------------------------*/
#ifndef rhoThermoCombustion_H
#define rhoThermoCombustion_H
#ifndef ThermoCombustion_H
#define ThermoCombustion_H
#include "autoPtr.H"
#include "rhoCombustionModel.H"
#include "rhoChemistryModel.H"
#include "CombustionModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -47,28 +46,20 @@ namespace combustionModels
{
/*---------------------------------------------------------------------------*\
class rhoThermoCombustion Declaration
class ThermoCombustion Declaration
\*---------------------------------------------------------------------------*/
class rhoThermoCombustion
template<class ReactionThermo>
class ThermoCombustion
:
public rhoCombustionModel
public CombustionModel<ReactionThermo>
{
// Private Member Functions
//- Construct as copy (not implemented)
rhoThermoCombustion(const rhoThermoCombustion&);
//- Disallow default bitwise assignment
void operator=(const rhoThermoCombustion&);
protected:
// Protected data
//- Thermo
rhoReactionThermo& thermo_;
ReactionThermo& thermo_;
public:
@ -76,25 +67,25 @@ public:
// Constructors
//- Construct from components
rhoThermoCombustion
ThermoCombustion
(
const word& modelType,
rhoReactionThermo& thermo,
ReactionThermo& thermo,
const compressibleTurbulenceModel& turb
);
//- Destructor
virtual ~rhoThermoCombustion();
virtual ~ThermoCombustion();
// Member Functions
//- Return access to the thermo package
virtual rhoReactionThermo& thermo();
virtual ReactionThermo& thermo();
//- Return const access to the thermo package
virtual const rhoReactionThermo& thermo() const;
virtual const ReactionThermo& thermo() const;
};
@ -105,6 +96,12 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "ThermoCombustion.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -27,16 +27,16 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
Foam::combustionModels::EDC<Type>::EDC
template<class ReactionThermo>
Foam::combustionModels::EDC<ReactionThermo>::EDC
(
const word& modelType,
typename Type::reactionThermo& thermo,
ReactionThermo& thermo,
const compressibleTurbulenceModel& turb,
const word& combustionProperties
)
:
laminar<Type>(modelType, thermo, turb, combustionProperties),
laminar<ReactionThermo>(modelType, thermo, turb, combustionProperties),
version_
(
EDCversionNames
@ -72,15 +72,15 @@ Foam::combustionModels::EDC<Type>::EDC
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class Type>
Foam::combustionModels::EDC<Type>::~EDC()
template<class ReactionThermo>
Foam::combustionModels::EDC<ReactionThermo>::~EDC()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
template<class Type>
void Foam::combustionModels::EDC<Type>::correct()
template<class ReactionThermo>
void Foam::combustionModels::EDC<ReactionThermo>::correct()
{
if (this->active())
{
@ -174,17 +174,17 @@ void Foam::combustionModels::EDC<Type>::correct()
}
template<class Type>
template<class ReactionThermo>
Foam::tmp<Foam::fvScalarMatrix>
Foam::combustionModels::EDC<Type>::R(volScalarField& Y) const
Foam::combustionModels::EDC<ReactionThermo>::R(volScalarField& Y) const
{
return kappa_*laminar<Type>::R(Y);
return kappa_*laminar<ReactionThermo>::R(Y);
}
template<class Type>
template<class ReactionThermo>
Foam::tmp<Foam::volScalarField>
Foam::combustionModels::EDC<Type>::Qdot() const
Foam::combustionModels::EDC<ReactionThermo>::Qdot() const
{
tmp<volScalarField> tQdot
(
@ -213,10 +213,10 @@ Foam::combustionModels::EDC<Type>::Qdot() const
}
template<class Type>
bool Foam::combustionModels::EDC<Type>::read()
template<class ReactionThermo>
bool Foam::combustionModels::EDC<ReactionThermo>::read()
{
if (Type::read())
if (laminar<ReactionThermo>::read())
{
version_ =
(

View File

@ -128,10 +128,10 @@ const scalar EDCexp2[] = {3, 3, 2, 2};
Class EDC Declaration
\*---------------------------------------------------------------------------*/
template<class Type>
template<class ReactionThermo>
class EDC
:
public laminar<Type>
public laminar<ReactionThermo>
{
// Private data
@ -170,7 +170,7 @@ public:
EDC
(
const word& modelType,
typename Type::reactionThermo& type,
ReactionThermo& type,
const compressibleTurbulenceModel& turb,
const word& combustionProperties
);

View File

@ -25,8 +25,8 @@ License
#include "makeCombustionTypes.H"
#include "psiChemistryCombustion.H"
#include "rhoChemistryCombustion.H"
#include "psiReactionThermo.H"
#include "rhoReactionThermo.H"
#include "EDC.H"
// * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * * //
@ -55,7 +55,7 @@ Foam::combustionModels::EDCdefaultVersion
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makeCombustionTypes(EDC, psiChemistryCombustion, psiCombustionModel);
makeCombustionTypes(EDC, rhoChemistryCombustion, rhoCombustionModel);
makeCombustionTypes(EDC, psiReactionThermo);
makeCombustionTypes(EDC, rhoReactionThermo);
// ************************************************************************* //

View File

@ -36,16 +36,16 @@ namespace combustionModels
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class CombThermoType, class ThermoType>
FSD<CombThermoType, ThermoType>::FSD
template<class ReactionThermo, class ThermoType>
FSD<ReactionThermo, ThermoType>::FSD
(
const word& modelType,
typename CombThermoType::reactionThermo& thermo,
ReactionThermo& thermo,
const compressibleTurbulenceModel& turb,
const word& combustionProperties
)
:
singleStepCombustion<CombThermoType, ThermoType>
singleStepCombustion<ReactionThermo, ThermoType>
(
modelType,
thermo,
@ -87,15 +87,15 @@ FSD<CombThermoType, ThermoType>::FSD
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class CombThermoType, class ThermoType>
FSD<CombThermoType, ThermoType>::~FSD()
template<class ReactionThermo, class ThermoType>
FSD<ReactionThermo, ThermoType>::~FSD()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
template<class CombThermoType, class ThermoType>
void FSD<CombThermoType, ThermoType>::calculateSourceNorm()
template<class ReactionThermo, class ThermoType>
void FSD<ReactionThermo, ThermoType>::calculateSourceNorm()
{
this->singleMixturePtr_->fresCorrect();
@ -335,8 +335,8 @@ void FSD<CombThermoType, ThermoType>::calculateSourceNorm()
}
template<class CombThermoType, class ThermoType>
void FSD<CombThermoType, ThermoType>::correct()
template<class ReactionThermo, class ThermoType>
void FSD<ReactionThermo, ThermoType>::correct()
{
this->wFuel_ ==
dimensionedScalar("zero", dimMass/pow3(dimLength)/dimTime, 0.0);
@ -348,10 +348,10 @@ void FSD<CombThermoType, ThermoType>::correct()
}
template<class CombThermoType, class ThermoType>
bool FSD<CombThermoType, ThermoType>::read()
template<class ReactionThermo, class ThermoType>
bool FSD<ReactionThermo, ThermoType>::read()
{
if (singleStepCombustion<CombThermoType, ThermoType>::read())
if (singleStepCombustion<ReactionThermo, ThermoType>::read())
{
this->coeffs().lookup("Cv") >> Cv_ ;
this->coeffs().lookup("ftVarMin") >> ftVarMin_;

View File

@ -77,10 +77,10 @@ namespace combustionModels
Class FSD Declaration
\*---------------------------------------------------------------------------*/
template<class CombThermoType, class ThermoType>
template<class ReactionThermo, class ThermoType>
class FSD
:
public singleStepCombustion <CombThermoType, ThermoType>
public singleStepCombustion <ReactionThermo, ThermoType>
{
// Private data
@ -139,7 +139,7 @@ public:
FSD
(
const word& modelType,
typename CombThermoType::reactionThermo& thermo,
ReactionThermo& thermo,
const compressibleTurbulenceModel& turb,
const word& combustionProperties
);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -26,10 +26,8 @@ License
#include "makeCombustionTypes.H"
#include "thermoPhysicsTypes.H"
#include "psiCombustionModel.H"
#include "psiThermoCombustion.H"
#include "rhoCombustionModel.H"
#include "rhoThermoCombustion.H"
#include "psiReactionThermo.H"
#include "rhoReactionThermo.H"
#include "FSD.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -38,66 +36,58 @@ License
makeCombustionTypesThermo
(
FSD,
psiThermoCombustion,
gasHThermoPhysics,
psiCombustionModel
psiReactionThermo,
gasHThermoPhysics
);
makeCombustionTypesThermo
(
FSD,
psiThermoCombustion,
constGasHThermoPhysics,
psiCombustionModel
psiReactionThermo,
constGasHThermoPhysics
);
makeCombustionTypesThermo
(
FSD,
rhoThermoCombustion,
gasHThermoPhysics,
rhoCombustionModel
rhoReactionThermo,
gasHThermoPhysics
);
makeCombustionTypesThermo
(
FSD,
rhoThermoCombustion,
constGasHThermoPhysics,
rhoCombustionModel
rhoReactionThermo,
constGasHThermoPhysics
);
// Combustion models based on sensibleInternalEnergy
makeCombustionTypesThermo
(
FSD,
psiThermoCombustion,
gasEThermoPhysics,
psiCombustionModel
psiReactionThermo,
gasEThermoPhysics
);
makeCombustionTypesThermo
(
FSD,
psiThermoCombustion,
constGasEThermoPhysics,
psiCombustionModel
psiReactionThermo,
constGasEThermoPhysics
);
makeCombustionTypesThermo
(
FSD,
rhoThermoCombustion,
gasEThermoPhysics,
rhoCombustionModel
rhoReactionThermo,
gasEThermoPhysics
);
makeCombustionTypesThermo
(
FSD,
rhoThermoCombustion,
constGasEThermoPhysics,
rhoCombustionModel
rhoReactionThermo,
constGasEThermoPhysics
);

View File

@ -1,14 +1,5 @@
combustionModel/combustionModel.C
psiCombustionModel/psiCombustionModel/psiCombustionModel.C
psiCombustionModel/psiCombustionModel/psiCombustionModelNew.C
psiCombustionModel/psiThermoCombustion/psiThermoCombustion.C
psiCombustionModel/psiChemistryCombustion/psiChemistryCombustion.C
rhoCombustionModel/rhoCombustionModel/rhoCombustionModel.C
rhoCombustionModel/rhoCombustionModel/rhoCombustionModelNew.C
rhoCombustionModel/rhoThermoCombustion/rhoThermoCombustion.C
rhoCombustionModel/rhoChemistryCombustion/rhoChemistryCombustion.C
CombustionModel/CombustionModel/CombustionModels.C
diffusion/diffusions.C
infinitelyFastChemistry/infinitelyFastChemistrys.C

View File

@ -27,16 +27,16 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
Foam::combustionModels::PaSR<Type>::PaSR
template<class ReactionThermo>
Foam::combustionModels::PaSR<ReactionThermo>::PaSR
(
const word& modelType,
typename Type::reactionThermo& thermo,
ReactionThermo& thermo,
const compressibleTurbulenceModel& turb,
const word& combustionProperties
)
:
laminar<Type>(modelType, thermo, turb, combustionProperties),
laminar<ReactionThermo>(modelType, thermo, turb, combustionProperties),
Cmix_(readScalar(this->coeffs().lookup("Cmix"))),
kappa_
(
@ -56,19 +56,19 @@ Foam::combustionModels::PaSR<Type>::PaSR
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class Type>
Foam::combustionModels::PaSR<Type>::~PaSR()
template<class ReactionThermo>
Foam::combustionModels::PaSR<ReactionThermo>::~PaSR()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
template<class Type>
void Foam::combustionModels::PaSR<Type>::correct()
template<class ReactionThermo>
void Foam::combustionModels::PaSR<ReactionThermo>::correct()
{
if (this->active())
{
laminar<Type>::correct();
laminar<ReactionThermo>::correct();
tmp<volScalarField> tepsilon(this->turbulence().epsilon());
const scalarField& epsilon = tepsilon();
@ -100,33 +100,33 @@ void Foam::combustionModels::PaSR<Type>::correct()
}
template<class Type>
template<class ReactionThermo>
Foam::tmp<Foam::fvScalarMatrix>
Foam::combustionModels::PaSR<Type>::R(volScalarField& Y) const
Foam::combustionModels::PaSR<ReactionThermo>::R(volScalarField& Y) const
{
return kappa_*laminar<Type>::R(Y);
return kappa_*laminar<ReactionThermo>::R(Y);
}
template<class Type>
template<class ReactionThermo>
Foam::tmp<Foam::volScalarField>
Foam::combustionModels::PaSR<Type>::Qdot() const
Foam::combustionModels::PaSR<ReactionThermo>::Qdot() const
{
return tmp<volScalarField>
(
new volScalarField
(
this->thermo().phasePropertyName(typeName + ":Qdot"),
kappa_*laminar<Type>::Qdot()
kappa_*laminar<ReactionThermo>::Qdot()
)
);
}
template<class Type>
bool Foam::combustionModels::PaSR<Type>::read()
template<class ReactionThermo>
bool Foam::combustionModels::PaSR<ReactionThermo>::read()
{
if (laminar<Type>::read())
if (laminar<ReactionThermo>::read())
{
this->coeffs().lookup("Cmix") >> Cmix_;
return true;

View File

@ -52,10 +52,10 @@ namespace combustionModels
Class PaSR Declaration
\*---------------------------------------------------------------------------*/
template<class Type>
template<class ReactionThermo>
class PaSR
:
public laminar<Type>
public laminar<ReactionThermo>
{
// Private data
@ -87,7 +87,7 @@ public:
PaSR
(
const word& modelType,
typename Type::reactionThermo& thermo,
ReactionThermo& thermo,
const compressibleTurbulenceModel& turb,
const word& combustionProperties
);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -25,14 +25,14 @@ License
#include "makeCombustionTypes.H"
#include "psiChemistryCombustion.H"
#include "rhoChemistryCombustion.H"
#include "psiReactionThermo.H"
#include "rhoReactionThermo.H"
#include "PaSR.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makeCombustionTypes(PaSR, psiChemistryCombustion, psiCombustionModel);
makeCombustionTypes(PaSR, rhoChemistryCombustion, rhoCombustionModel);
makeCombustionTypes(PaSR, psiReactionThermo);
makeCombustionTypes(PaSR, rhoReactionThermo);
// ************************************************************************* //

View File

@ -101,6 +101,18 @@ public:
);
// Selectors
//- Generic New for each of the related chemistry model
template<class CombustionModel>
static autoPtr<CombustionModel> New
(
typename CombustionModel::reactionThermo& thermo,
const compressibleTurbulenceModel& turb,
const word& combustionProperties
);
//- Destructor
virtual ~combustionModel();
@ -147,6 +159,10 @@ public:
#include "combustionModelI.H"
#ifdef NoRepository
#include "combustionModelTemplates.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif

View File

@ -0,0 +1,171 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
template<class CombustionModel>
Foam::autoPtr<CombustionModel> Foam::combustionModel::New
(
typename CombustionModel::reactionThermo& thermo,
const compressibleTurbulenceModel& turb,
const word& combustionProperties
)
{
word combModelName
(
IOdictionary
(
IOobject
(
thermo.phasePropertyName(combustionProperties),
thermo.db().time().constant(),
thermo.db(),
IOobject::MUST_READ,
IOobject::NO_WRITE,
false
)
).lookup("combustionModel")
);
Info<< "Selecting combustion model " << combModelName << endl;
const wordList cmpts2(basicThermo::splitThermoName(combModelName, 2));
const wordList cmpts3(basicThermo::splitThermoName(combModelName, 3));
if (cmpts2.size() == 2 || cmpts3.size() == 3)
{
combModelName = cmpts2.size() ? cmpts2[0] : cmpts3[0];
WarningInFunction
<< "Template parameters are no longer required when selecting a "
<< combustionModel::typeName << ". This information is now "
<< "obtained directly from the thermodynamics. Actually selecting "
<< "combustion model " << combModelName << "." << endl;
}
typedef typename CombustionModel::dictionaryConstructorTable cstrTableType;
cstrTableType* cstrTable = CombustionModel::dictionaryConstructorTablePtr_;
const word compCombModelName =
combModelName + '<' + CombustionModel::reactionThermo::typeName + '>';
const word thermoCombModelName =
combModelName + '<' + CombustionModel::reactionThermo::typeName + ','
+ thermo.thermoName() + '>';
typename cstrTableType::iterator compCstrIter =
cstrTable->find(compCombModelName);
typename cstrTableType::iterator thermoCstrIter =
cstrTable->find(thermoCombModelName);
if (compCstrIter == cstrTable->end() && thermoCstrIter == cstrTable->end())
{
FatalErrorInFunction
<< "Unknown " << combustionModel::typeName << " type "
<< combModelName << endl << endl;
const wordList names(cstrTable->toc());
wordList thisCmpts;
thisCmpts.append(word::null);
thisCmpts.append(CombustionModel::reactionThermo::typeName);
thisCmpts.append(basicThermo::splitThermoName(thermo.thermoName(), 5));
wordList validNames;
forAll(names, i)
{
wordList cmpts(basicThermo::splitThermoName(names[i], 2));
if (cmpts.size() != 2)
{
cmpts = basicThermo::splitThermoName(names[i], 7);
}
bool isValid = true;
for (label i = 1; i < cmpts.size() && isValid; ++ i)
{
isValid = isValid && cmpts[i] == thisCmpts[i];
}
if (isValid)
{
validNames.append(cmpts[0]);
}
}
FatalErrorInFunction
<< "Valid " << combustionModel::typeName << " types for this "
<< "thermodynamic model are:" << endl << validNames << endl;
List<wordList> validCmpts2, validCmpts7;
validCmpts2.append(wordList(2, word::null));
validCmpts2[0][0] = combustionModel::typeName;
validCmpts2[0][1] = "reactionThermo";
validCmpts7.append(wordList(7, word::null));
validCmpts7[0][0] = combustionModel::typeName;
validCmpts7[0][1] = "reactionThermo";
validCmpts7[0][2] = "transport";
validCmpts7[0][3] = "thermo";
validCmpts7[0][4] = "equationOfState";
validCmpts7[0][5] = "specie";
validCmpts7[0][6] = "energy";
forAll(names, i)
{
const wordList cmpts2(basicThermo::splitThermoName(names[i], 2));
const wordList cmpts7(basicThermo::splitThermoName(names[i], 7));
if (cmpts2.size() == 2)
{
validCmpts2.append(cmpts2);
}
if (cmpts7.size() == 7)
{
validCmpts7.append(cmpts7);
}
}
FatalErrorInFunction
<< "All " << validCmpts2[0][0] << '/' << validCmpts2[0][1]
<< " combinations are:" << endl << endl;
printTable(validCmpts2, FatalErrorInFunction);
FatalErrorInFunction << endl;
FatalErrorInFunction
<< "All " << validCmpts7[0][0] << '/' << validCmpts7[0][1]
<< "/thermoPhysics combinations are:" << endl << endl;
printTable(validCmpts7, FatalErrorInFunction);
FatalErrorInFunction << exit(FatalError);
}
return autoPtr<CombustionModel>
(
thermoCstrIter != cstrTable->end()
? thermoCstrIter()(combModelName, thermo, turb, combustionProperties)
: compCstrIter()(combModelName, thermo, turb, combustionProperties)
);
}
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -30,61 +30,63 @@ License
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define makeCombustionTypesThermo(CombModel, CombType, Thermo, Table) \
#define makeCombustion(Comp) \
\
typedef Foam::combustionModels::CombModel \
<Foam::combustionModels::CombType, Foam::Thermo> \
CombModel##CombType##Thermo; \
typedef typename Foam::combustionModels::CombustionModel<Foam::Comp> \
CombustionModel##Comp; \
\
defineTemplateTypeNameAndDebugWithName \
( \
CombModel##CombType##Thermo, \
#CombModel"<"#CombType","#Thermo">", \
CombustionModel##Comp, \
"CombustionModel<"#Comp">", \
0 \
); \
\
namespace Foam \
{ \
namespace combustionModels \
{ \
typedef CombModel<CombType, Thermo> CombModel##CombType##Thermo; \
addToRunTimeSelectionTable \
( \
Table, \
CombModel##CombType##Thermo, \
dictionary \
); \
} \
}
defineTemplateRunTimeSelectionTable \
( \
CombustionModel##Comp, \
dictionary \
);
#define makeCombustionTypes(CombModel, CombType, Table) \
#define makeCombustionTypesThermo(CombModel, Comp, Thermo) \
\
typedef Foam::combustionModels::CombModel \
<Foam::combustionModels::CombType> \
CombModel##CombType; \
typedef Foam::combustionModels::CombModel<Foam::Comp, Foam::Thermo> \
CombModel##Comp##Thermo; \
\
defineTemplateTypeNameAndDebugWithName \
( \
CombModel##CombType, \
#CombModel"<"#CombType">", \
CombModel##Comp##Thermo, \
( \
Foam::word(CombModel##Comp##Thermo::typeName_()) + "<"#Comp"," \
+ Foam::Thermo::typeName() + ">" \
).c_str(), \
0 \
); \
\
namespace Foam \
{ \
namespace combustionModels \
{ \
typedef CombModel<CombType> CombModel##CombType; \
Foam::combustionModels::CombustionModel<Foam::Comp>:: \
add##dictionary##ConstructorToTable<CombModel##Comp##Thermo> \
add##CombModel##Comp##Thermo##dictionary##ConstructorTo##\
CombustionModel##Comp##Table_;
#define makeCombustionTypes(CombModel, Comp) \
\
addToRunTimeSelectionTable \
( \
Table, \
CombModel##CombType, \
dictionary \
); \
} \
}
typedef Foam::combustionModels::CombModel<Foam::Comp> \
CombModel##Comp; \
\
defineTemplateTypeNameAndDebugWithName \
( \
CombModel##Comp, \
(Foam::word(CombModel##Comp::typeName_()) + "<"#Comp">").c_str(), \
0 \
); \
\
Foam::combustionModels::CombustionModel<Foam::Comp>:: \
add##dictionary##ConstructorToTable<CombModel##Comp> \
add##CombModel##Comp##dictionary##ConstructorTo##CombustionModel##Comp\
##Table_;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -33,16 +33,16 @@ namespace combustionModels
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class CombThermoType, class ThermoType>
diffusion<CombThermoType, ThermoType>::diffusion
template<class ReactionThermo, class ThermoType>
diffusion<ReactionThermo, ThermoType>::diffusion
(
const word& modelType,
typename CombThermoType::reactionThermo& thermo,
ReactionThermo& thermo,
const compressibleTurbulenceModel& turb,
const word& combustionProperties
)
:
singleStepCombustion<CombThermoType, ThermoType>
singleStepCombustion<ReactionThermo, ThermoType>
(
modelType,
thermo,
@ -56,15 +56,15 @@ diffusion<CombThermoType, ThermoType>::diffusion
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class CombThermoType, class ThermoType>
diffusion<CombThermoType, ThermoType>::~diffusion()
template<class ReactionThermo, class ThermoType>
diffusion<ReactionThermo, ThermoType>::~diffusion()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
template<class CombThermoType, class ThermoType>
void diffusion<CombThermoType, ThermoType>::correct()
template<class ReactionThermo, class ThermoType>
void diffusion<ReactionThermo, ThermoType>::correct()
{
this->wFuel_ ==
dimensionedScalar("zero", dimMass/pow3(dimLength)/dimTime, 0.0);
@ -92,10 +92,10 @@ void diffusion<CombThermoType, ThermoType>::correct()
}
template<class CombThermoType, class ThermoType>
bool diffusion<CombThermoType, ThermoType>::read()
template<class ReactionThermo, class ThermoType>
bool diffusion<ReactionThermo, ThermoType>::read()
{
if (singleStepCombustion<CombThermoType, ThermoType>::read())
if (singleStepCombustion<ReactionThermo, ThermoType>::read())
{
this->coeffs().lookup("C") >> C_ ;
this->coeffs().readIfPresent("oxidant", oxidantName_);

View File

@ -50,10 +50,10 @@ namespace combustionModels
Class diffusion Declaration
\*---------------------------------------------------------------------------*/
template<class CombThermoType, class ThermoType>
template<class ReactionThermo, class ThermoType>
class diffusion
:
public singleStepCombustion<CombThermoType, ThermoType>
public singleStepCombustion<ReactionThermo, ThermoType>
{
// Private data
@ -85,7 +85,7 @@ public:
diffusion
(
const word& modelType,
typename CombThermoType::reactionThermo& thermo,
ReactionThermo& thermo,
const compressibleTurbulenceModel& turb,
const word& combustionProperties
);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -26,8 +26,8 @@ License
#include "makeCombustionTypes.H"
#include "thermoPhysicsTypes.H"
#include "psiThermoCombustion.H"
#include "rhoThermoCombustion.H"
#include "psiReactionThermo.H"
#include "rhoReactionThermo.H"
#include "diffusion.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -36,33 +36,29 @@ License
makeCombustionTypesThermo
(
diffusion,
psiThermoCombustion,
gasHThermoPhysics,
psiCombustionModel
psiReactionThermo,
gasHThermoPhysics
);
makeCombustionTypesThermo
(
diffusion,
psiThermoCombustion,
constGasHThermoPhysics,
psiCombustionModel
psiReactionThermo,
constGasHThermoPhysics
);
makeCombustionTypesThermo
(
diffusion,
rhoThermoCombustion,
gasHThermoPhysics,
rhoCombustionModel
rhoReactionThermo,
gasHThermoPhysics
);
makeCombustionTypesThermo
(
diffusion,
rhoThermoCombustion,
constGasHThermoPhysics,
rhoCombustionModel
rhoReactionThermo,
constGasHThermoPhysics
);
@ -71,33 +67,29 @@ makeCombustionTypesThermo
makeCombustionTypesThermo
(
diffusion,
psiThermoCombustion,
gasEThermoPhysics,
psiCombustionModel
psiReactionThermo,
gasEThermoPhysics
);
makeCombustionTypesThermo
(
diffusion,
psiThermoCombustion,
constGasEThermoPhysics,
psiCombustionModel
psiReactionThermo,
constGasEThermoPhysics
);
makeCombustionTypesThermo
(
diffusion,
rhoThermoCombustion,
gasEThermoPhysics,
rhoCombustionModel
rhoReactionThermo,
gasEThermoPhysics
);
makeCombustionTypesThermo
(
diffusion,
rhoThermoCombustion,
constGasEThermoPhysics,
rhoCombustionModel
rhoReactionThermo,
constGasEThermoPhysics
);

View File

@ -32,16 +32,16 @@ namespace combustionModels
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class CombThermoType, class ThermoType>
infinitelyFastChemistry<CombThermoType, ThermoType>::infinitelyFastChemistry
template<class ReactionThermo, class ThermoType>
infinitelyFastChemistry<ReactionThermo, ThermoType>::infinitelyFastChemistry
(
const word& modelType,
typename CombThermoType::reactionThermo& thermo,
ReactionThermo& thermo,
const compressibleTurbulenceModel& turb,
const word& combustionProperties
)
:
singleStepCombustion<CombThermoType, ThermoType>
singleStepCombustion<ReactionThermo, ThermoType>
(
modelType,
thermo,
@ -54,15 +54,15 @@ infinitelyFastChemistry<CombThermoType, ThermoType>::infinitelyFastChemistry
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class CombThermoType, class ThermoType>
infinitelyFastChemistry<CombThermoType, ThermoType>::~infinitelyFastChemistry()
template<class ReactionThermo, class ThermoType>
infinitelyFastChemistry<ReactionThermo, ThermoType>::~infinitelyFastChemistry()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
template<class CombThermoType, class ThermoType>
void infinitelyFastChemistry<CombThermoType, ThermoType>::correct()
template<class ReactionThermo, class ThermoType>
void infinitelyFastChemistry<ReactionThermo, ThermoType>::correct()
{
this->wFuel_ ==
dimensionedScalar("zero", dimMass/pow3(dimLength)/dimTime, 0.0);
@ -90,10 +90,10 @@ void infinitelyFastChemistry<CombThermoType, ThermoType>::correct()
}
template<class CombThermoType, class ThermoType>
bool infinitelyFastChemistry<CombThermoType, ThermoType>::read()
template<class ReactionThermo, class ThermoType>
bool infinitelyFastChemistry<ReactionThermo, ThermoType>::read()
{
if (singleStepCombustion<CombThermoType, ThermoType>::read())
if (singleStepCombustion<ReactionThermo, ThermoType>::read())
{
this->coeffs().lookup("C") >> C_ ;
return true;

View File

@ -50,10 +50,10 @@ namespace combustionModels
Class infinitelyFastChemistry Declaration
\*---------------------------------------------------------------------------*/
template<class CombThermoType, class ThermoType>
template<class ReactionThermo, class ThermoType>
class infinitelyFastChemistry
:
public singleStepCombustion<CombThermoType, ThermoType>
public singleStepCombustion<ReactionThermo, ThermoType>
{
// Private data
@ -82,7 +82,7 @@ public:
infinitelyFastChemistry
(
const word& modelType,
typename CombThermoType::reactionThermo& thermo,
ReactionThermo& thermo,
const compressibleTurbulenceModel& turb,
const word& combustionProperties
);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -26,8 +26,8 @@ License
#include "makeCombustionTypes.H"
#include "thermoPhysicsTypes.H"
#include "psiThermoCombustion.H"
#include "rhoThermoCombustion.H"
#include "psiReactionThermo.H"
#include "rhoReactionThermo.H"
#include "infinitelyFastChemistry.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -37,33 +37,29 @@ License
makeCombustionTypesThermo
(
infinitelyFastChemistry,
psiThermoCombustion,
gasHThermoPhysics,
psiCombustionModel
psiReactionThermo,
gasHThermoPhysics
);
makeCombustionTypesThermo
(
infinitelyFastChemistry,
psiThermoCombustion,
constGasHThermoPhysics,
psiCombustionModel
psiReactionThermo,
constGasHThermoPhysics
);
makeCombustionTypesThermo
(
infinitelyFastChemistry,
rhoThermoCombustion,
gasHThermoPhysics,
rhoCombustionModel
rhoReactionThermo,
gasHThermoPhysics
);
makeCombustionTypesThermo
(
infinitelyFastChemistry,
rhoThermoCombustion,
constGasHThermoPhysics,
rhoCombustionModel
rhoReactionThermo,
constGasHThermoPhysics
);
// Combustion models based on sensibleInternalEnergy
@ -71,33 +67,29 @@ makeCombustionTypesThermo
makeCombustionTypesThermo
(
infinitelyFastChemistry,
psiThermoCombustion,
gasEThermoPhysics,
psiCombustionModel
psiReactionThermo,
gasEThermoPhysics
);
makeCombustionTypesThermo
(
infinitelyFastChemistry,
psiThermoCombustion,
constGasEThermoPhysics,
psiCombustionModel
psiReactionThermo,
constGasEThermoPhysics
);
makeCombustionTypesThermo
(
infinitelyFastChemistry,
rhoThermoCombustion,
gasEThermoPhysics,
rhoCombustionModel
rhoReactionThermo,
gasEThermoPhysics
);
makeCombustionTypesThermo
(
infinitelyFastChemistry,
rhoThermoCombustion,
constGasEThermoPhysics,
rhoCombustionModel
rhoReactionThermo,
constGasEThermoPhysics
);

View File

@ -29,16 +29,22 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
Foam::combustionModels::laminar<Type>::laminar
template<class ReactionThermo>
Foam::combustionModels::laminar<ReactionThermo>::laminar
(
const word& modelType,
typename Type::reactionThermo& thermo,
ReactionThermo& thermo,
const compressibleTurbulenceModel& turb,
const word& combustionProperties
)
:
Type(modelType, thermo, turb, combustionProperties),
ChemistryCombustion<ReactionThermo>
(
modelType,
thermo,
turb,
combustionProperties
),
integrateReactionRate_
(
this->coeffs().lookupOrDefault("integrateReactionRate", true)
@ -57,23 +63,23 @@ Foam::combustionModels::laminar<Type>::laminar
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class Type>
Foam::combustionModels::laminar<Type>::~laminar()
template<class ReactionThermo>
Foam::combustionModels::laminar<ReactionThermo>::~laminar()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
template<class Type>
template<class ReactionThermo>
Foam::tmp<Foam::volScalarField>
Foam::combustionModels::laminar<Type>::tc() const
Foam::combustionModels::laminar<ReactionThermo>::tc() const
{
return this->chemistryPtr_->tc();
}
template<class Type>
void Foam::combustionModels::laminar<Type>::correct()
template<class ReactionThermo>
void Foam::combustionModels::laminar<ReactionThermo>::correct()
{
if (this->active())
{
@ -114,9 +120,9 @@ void Foam::combustionModels::laminar<Type>::correct()
}
template<class Type>
template<class ReactionThermo>
Foam::tmp<Foam::fvScalarMatrix>
Foam::combustionModels::laminar<Type>::R(volScalarField& Y) const
Foam::combustionModels::laminar<ReactionThermo>::R(volScalarField& Y) const
{
tmp<fvScalarMatrix> tSu(new fvScalarMatrix(Y, dimMass/dimTime));
@ -134,9 +140,9 @@ Foam::combustionModels::laminar<Type>::R(volScalarField& Y) const
}
template<class Type>
template<class ReactionThermo>
Foam::tmp<Foam::volScalarField>
Foam::combustionModels::laminar<Type>::Qdot() const
Foam::combustionModels::laminar<ReactionThermo>::Qdot() const
{
tmp<volScalarField> tQdot
(
@ -165,10 +171,10 @@ Foam::combustionModels::laminar<Type>::Qdot() const
}
template<class Type>
bool Foam::combustionModels::laminar<Type>::read()
template<class ReactionThermo>
bool Foam::combustionModels::laminar<ReactionThermo>::read()
{
if (Type::read())
if (ChemistryCombustion<ReactionThermo>::read())
{
integrateReactionRate_ =
this->coeffs().lookupOrDefault("integrateReactionRate", true);

View File

@ -35,6 +35,8 @@ SourceFiles
#ifndef laminar_H
#define laminar_H
#include "ChemistryCombustion.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
@ -46,10 +48,10 @@ namespace combustionModels
Class laminar Declaration
\*---------------------------------------------------------------------------*/
template<class Type>
template<class ReactionThermo>
class laminar
:
public Type
public ChemistryCombustion<ReactionThermo>
{
// Private data
@ -87,7 +89,7 @@ public:
laminar
(
const word& modelType,
typename Type::reactionThermo& thermo,
ReactionThermo& thermo,
const compressibleTurbulenceModel& turb,
const word& combustionProperties
);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -25,14 +25,14 @@ License
#include "makeCombustionTypes.H"
#include "psiChemistryCombustion.H"
#include "rhoChemistryCombustion.H"
#include "psiReactionThermo.H"
#include "rhoReactionThermo.H"
#include "laminar.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makeCombustionTypes(laminar, psiChemistryCombustion, psiCombustionModel);
makeCombustionTypes(laminar, rhoChemistryCombustion, rhoCombustionModel);
makeCombustionTypes(laminar, psiReactionThermo);
makeCombustionTypes(laminar, rhoReactionThermo);
// ************************************************************************* //

View File

@ -28,36 +28,36 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class CombThermoType>
Foam::combustionModels::noCombustion<CombThermoType>::noCombustion
template<class ReactionThermo>
Foam::combustionModels::noCombustion<ReactionThermo>::noCombustion
(
const word& modelType,
typename CombThermoType::reactionThermo& thermo,
ReactionThermo& thermo,
const compressibleTurbulenceModel& turb,
const word& combustionProperties
)
:
CombThermoType(modelType, thermo, turb)
ThermoCombustion<ReactionThermo>(modelType, thermo, turb)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class CombThermoType>
Foam::combustionModels::noCombustion<CombThermoType>::~noCombustion()
template<class ReactionThermo>
Foam::combustionModels::noCombustion<ReactionThermo>::~noCombustion()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
template<class CombThermoType>
void Foam::combustionModels::noCombustion<CombThermoType>::correct()
template<class ReactionThermo>
void Foam::combustionModels::noCombustion<ReactionThermo>::correct()
{}
template<class CombThermoType>
template<class ReactionThermo>
Foam::tmp<Foam::fvScalarMatrix>
Foam::combustionModels::noCombustion<CombThermoType>::R
Foam::combustionModels::noCombustion<ReactionThermo>::R
(
volScalarField& Y
) const
@ -71,9 +71,9 @@ Foam::combustionModels::noCombustion<CombThermoType>::R
}
template<class CombThermoType>
template<class ReactionThermo>
Foam::tmp<Foam::volScalarField>
Foam::combustionModels::noCombustion<CombThermoType>::Qdot() const
Foam::combustionModels::noCombustion<ReactionThermo>::Qdot() const
{
tmp<volScalarField> tQdot
(
@ -97,10 +97,10 @@ Foam::combustionModels::noCombustion<CombThermoType>::Qdot() const
}
template<class CombThermoType>
bool Foam::combustionModels::noCombustion<CombThermoType>::read()
template<class ReactionThermo>
bool Foam::combustionModels::noCombustion<ReactionThermo>::read()
{
if (CombThermoType::read())
if (ThermoCombustion<ReactionThermo>::read())
{
return true;
}

View File

@ -35,6 +35,8 @@ SourceFiles
#ifndef noCombustion_H
#define noCombustion_H
#include "ThermoCombustion.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
@ -46,10 +48,10 @@ namespace combustionModels
Class noCombustion Declaration
\*---------------------------------------------------------------------------*/
template<class CombThermoType>
template<class ReactionThermo>
class noCombustion
:
public CombThermoType
public ThermoCombustion<ReactionThermo>
{
//- Disallow copy construct
@ -62,7 +64,7 @@ class noCombustion
public:
//- Runtime type information
TypeName("noCombustion");
TypeName("none");
// Constructors
@ -71,7 +73,7 @@ public:
noCombustion
(
const word& modelType,
typename CombThermoType::reactionThermo& thermo,
ReactionThermo& thermo,
const compressibleTurbulenceModel& turb,
const word& combustionProperties
);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -25,28 +25,15 @@ License
#include "makeCombustionTypes.H"
#include "psiCombustionModel.H"
#include "rhoCombustionModel.H"
#include "psiThermoCombustion.H"
#include "rhoThermoCombustion.H"
#include "psiReactionThermo.H"
#include "rhoReactionThermo.H"
#include "noCombustion.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makeCombustionTypes
(
noCombustion,
psiThermoCombustion,
psiCombustionModel
);
makeCombustionTypes
(
noCombustion,
rhoThermoCombustion,
rhoCombustionModel
);
makeCombustionTypes(noCombustion, psiReactionThermo);
makeCombustionTypes(noCombustion, rhoReactionThermo);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -1,111 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::psiChemistryCombustion
Description
Compressibility-based chemistry model wrapper for combustion models
SourceFiles
psiChemistryCombustion.C
\*---------------------------------------------------------------------------*/
#ifndef psiChemistryCombustion_H
#define psiChemistryCombustion_H
#include "autoPtr.H"
#include "psiCombustionModel.H"
#include "psiChemistryModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace combustionModels
{
/*---------------------------------------------------------------------------*\
class psiChemistryCombustion Declaration
\*---------------------------------------------------------------------------*/
class psiChemistryCombustion
:
public psiCombustionModel
{
// Private Member Functions
//- Construct as copy (not implemented)
psiChemistryCombustion(const psiChemistryCombustion&);
//- Disallow default bitwise assignment
void operator=(const psiChemistryCombustion&);
protected:
// Protected data
//- Pointer to chemistry model
autoPtr<psiChemistryModel> chemistryPtr_;
public:
// Constructors
//- Construct from components and thermo
psiChemistryCombustion
(
const word& modelType,
psiReactionThermo& thermo,
const compressibleTurbulenceModel& turb,
const word& combustionProperties
);
//- Destructor
virtual ~psiChemistryCombustion();
// Member Functions
//- Return access to the thermo package
virtual psiReactionThermo& thermo();
//- Return const access to the thermo package
virtual const psiReactionThermo& thermo() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace combustionModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,74 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "psiCombustionModel.H"
/* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */
namespace Foam
{
namespace combustionModels
{
defineTypeNameAndDebug(psiCombustionModel, 0);
defineRunTimeSelectionTable(psiCombustionModel, dictionary);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::combustionModels::psiCombustionModel::psiCombustionModel
(
const word& modelType,
psiReactionThermo& thermo,
const compressibleTurbulenceModel& turb,
const word& combustionProperties
)
:
combustionModel(modelType, thermo, turb, combustionProperties)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::combustionModels::psiCombustionModel::~psiCombustionModel()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
bool Foam::combustionModels::psiCombustionModel::read()
{
if (combustionModel::read())
{
return true;
}
else
{
return false;
}
}
// ************************************************************************* //

View File

@ -1,78 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "psiCombustionModel.H"
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::combustionModels::psiCombustionModel>
Foam::combustionModels::psiCombustionModel::New
(
psiReactionThermo& thermo,
const compressibleTurbulenceModel& turb,
const word& combustionProperties
)
{
const word combModelName
(
IOdictionary
(
IOobject
(
thermo.phasePropertyName(combustionProperties),
thermo.db().time().constant(),
thermo.db(),
IOobject::MUST_READ,
IOobject::NO_WRITE,
false
)
).lookup("combustionModel")
);
Info<< "Selecting combustion model " << combModelName << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(combModelName);
if (cstrIter == dictionaryConstructorTablePtr_->end())
{
FatalErrorInFunction
<< "Unknown psiCombustionModel type "
<< combModelName << endl << endl
<< "Valid combustionModels are : " << endl
<< dictionaryConstructorTablePtr_->toc()
<< exit(FatalError);
}
const word className = combModelName(0, combModelName.find('<'));
return autoPtr<psiCombustionModel>
(
cstrIter()(className, thermo, turb, combustionProperties)
);
}
// ************************************************************************* //

View File

@ -1,110 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::psiThermoCombustion
Description
Compressibility-based thermo model wrapper for combustion models
SourceFiles
psiThermoCombustion.C
\*---------------------------------------------------------------------------*/
#ifndef psiThermoCombustion_H
#define psiThermoCombustion_H
#include "autoPtr.H"
#include "psiCombustionModel.H"
#include "psiReactionThermo.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace combustionModels
{
/*---------------------------------------------------------------------------*\
class psiThermoCombustion Declaration
\*---------------------------------------------------------------------------*/
class psiThermoCombustion
:
public psiCombustionModel
{
// Private Member Functions
//- Construct as copy (not implemented)
psiThermoCombustion(const psiThermoCombustion&);
//- Disallow default bitwise assignment
void operator=(const psiThermoCombustion&);
protected:
// Protected data
//- Thermo
psiReactionThermo& thermo_;
public:
// Constructors
//- Construct from components
psiThermoCombustion
(
const word& modelType,
psiReactionThermo& thermo,
const compressibleTurbulenceModel& turb
);
//- Destructor
virtual ~psiThermoCombustion();
// Member Functions
//- Return access to the thermo package
virtual psiReactionThermo& thermo();
//- Return const access to the thermo package
virtual const psiReactionThermo& thermo() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace combustionModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,65 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "rhoChemistryCombustion.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::combustionModels::rhoChemistryCombustion::rhoChemistryCombustion
(
const word& modelType,
rhoReactionThermo& thermo,
const compressibleTurbulenceModel& turb,
const word& combustionProperties
)
:
rhoCombustionModel(modelType, thermo, turb, combustionProperties),
chemistryPtr_(rhoChemistryModel::New(thermo))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::combustionModels::rhoChemistryCombustion::~rhoChemistryCombustion()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::rhoReactionThermo&
Foam::combustionModels::rhoChemistryCombustion::thermo()
{
return chemistryPtr_->thermo();
}
const Foam::rhoReactionThermo&
Foam::combustionModels::rhoChemistryCombustion::thermo() const
{
return chemistryPtr_->thermo();
}
// ************************************************************************* //

View File

@ -1,154 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::rhoCombustionModel
Description
Combustion models for rho-based thermodynamics
SourceFiles
rhoCombustionModelI.H
rhoCombustionModel.C
rhoCombustionModelNew.C
\*---------------------------------------------------------------------------*/
#ifndef rhoCombustionModel_H
#define rhoCombustionModel_H
#include "combustionModel.H"
#include "autoPtr.H"
#include "runTimeSelectionTables.H"
#include "rhoReactionThermo.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace combustionModels
{
/*---------------------------------------------------------------------------*\
class rhoCombustionModel Declaration
\*---------------------------------------------------------------------------*/
class rhoCombustionModel
:
public combustionModel
{
// Private Member Functions
//- Construct as copy (not implemented)
rhoCombustionModel(const rhoCombustionModel&);
//- Disallow default bitwise assignment
void operator=(const rhoCombustionModel&);
public:
//- Thermo type
typedef rhoReactionThermo reactionThermo;
//- Runtime type information
TypeName("rhoCombustionModel");
//- Declare run-time constructor selection tables
declareRunTimeSelectionTable
(
autoPtr,
rhoCombustionModel,
dictionary,
(
const word& modelType,
rhoReactionThermo& thermo,
const compressibleTurbulenceModel& turb,
const word& combustionProperties
),
(modelType, thermo, turb, combustionProperties)
);
// Constructors
//- Construct from components
rhoCombustionModel
(
const word& modelType,
rhoReactionThermo& thermo,
const compressibleTurbulenceModel& turb,
const word& combustionProperties
);
//- Selector
static autoPtr<rhoCombustionModel> New
(
rhoReactionThermo& thermo,
const compressibleTurbulenceModel& turb,
const word& combustionProperties=combustionPropertiesName
);
//- Destructor
virtual ~rhoCombustionModel();
// Member Functions
// Access functions
//- Access combustion dict
inline const dictionary& coeff() const;
//- Return access to the thermo package
virtual rhoReactionThermo& thermo() = 0;
//- Return const access to the thermo package
virtual const rhoReactionThermo& thermo() const = 0;
// IO
//- Update properties from given dictionary
virtual bool read();
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace combustionModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,80 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "rhoCombustionModel.H"
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::combustionModels::rhoCombustionModel>
Foam::combustionModels::rhoCombustionModel::New
(
rhoReactionThermo& thermo,
const compressibleTurbulenceModel& turb,
const word& combustionProperties
)
{
const word combTypeName
(
IOdictionary
(
IOobject
(
thermo.phasePropertyName(combustionProperties),
thermo.db().time().constant(),
thermo.db(),
IOobject::MUST_READ,
IOobject::NO_WRITE,
false
)
).lookup("combustionModel")
);
Info<< "Selecting combustion model " << combTypeName << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(combTypeName);
if (cstrIter == dictionaryConstructorTablePtr_->end())
{
FatalErrorInFunction
<< "Unknown rhoCombustionModel type "
<< combTypeName << endl << endl
<< "Valid combustionModels are : " << endl
<< dictionaryConstructorTablePtr_->toc()
<< exit(FatalError);
}
const label tempOpen = combTypeName.find('<');
const word className = combTypeName(0, tempOpen);
return autoPtr<rhoCombustionModel>
(
cstrIter()(className, thermo, turb, combustionProperties)
);
}
// ************************************************************************* //

View File

@ -1,64 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "rhoThermoCombustion.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::combustionModels::rhoThermoCombustion::rhoThermoCombustion
(
const word& modelType,
rhoReactionThermo& thermo,
const compressibleTurbulenceModel& turb
)
:
rhoCombustionModel(modelType, thermo, turb, combustionPropertiesName),
thermo_(thermo)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::combustionModels::rhoThermoCombustion::~rhoThermoCombustion()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::rhoReactionThermo&
Foam::combustionModels::rhoThermoCombustion::thermo()
{
return thermo_;
}
const Foam::rhoReactionThermo&
Foam::combustionModels::rhoThermoCombustion::thermo() const
{
return thermo_;
}
// ************************************************************************* //

View File

@ -33,16 +33,16 @@ namespace combustionModels
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class CombThermoType, class ThermoType>
singleStepCombustion<CombThermoType, ThermoType>::singleStepCombustion
template<class ReactionThermo, class ThermoType>
singleStepCombustion<ReactionThermo, ThermoType>::singleStepCombustion
(
const word& modelType,
typename CombThermoType::reactionThermo& thermo,
ReactionThermo& thermo,
const compressibleTurbulenceModel& turb,
const word& combustionProperties
)
:
CombThermoType(modelType, thermo, turb),
ThermoCombustion<ReactionThermo>(modelType, thermo, turb),
singleMixturePtr_(nullptr),
wFuel_
(
@ -89,15 +89,15 @@ singleStepCombustion<CombThermoType, ThermoType>::singleStepCombustion
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class CombThermoType, class ThermoType>
singleStepCombustion<CombThermoType, ThermoType>::~singleStepCombustion()
template<class ReactionThermo, class ThermoType>
singleStepCombustion<ReactionThermo, ThermoType>::~singleStepCombustion()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
template<class CombThermoType, class ThermoType>
tmp<fvScalarMatrix> singleStepCombustion<CombThermoType, ThermoType>::R
template<class ReactionThermo, class ThermoType>
tmp<fvScalarMatrix> singleStepCombustion<ReactionThermo, ThermoType>::R
(
volScalarField& Y
) const
@ -125,9 +125,9 @@ tmp<fvScalarMatrix> singleStepCombustion<CombThermoType, ThermoType>::R
}
template<class CombThermoType, class ThermoType>
template<class ReactionThermo, class ThermoType>
tmp<volScalarField>
singleStepCombustion<CombThermoType, ThermoType>::Qdot() const
singleStepCombustion<ReactionThermo, ThermoType>::Qdot() const
{
const label fuelI = singleMixturePtr_->fuelIndex();
volScalarField& YFuel =
@ -137,10 +137,10 @@ singleStepCombustion<CombThermoType, ThermoType>::Qdot() const
}
template<class CombThermoType, class ThermoType>
bool singleStepCombustion<CombThermoType, ThermoType>::read()
template<class ReactionThermo, class ThermoType>
bool singleStepCombustion<ReactionThermo, ThermoType>::read()
{
if (CombThermoType::read())
if (ThermoCombustion<ReactionThermo>::read())
{
return true;
}

View File

@ -36,6 +36,7 @@ SourceFiles
#define singleStepCombustion_H
#include "singleStepReactingMixture.H"
#include "ThermoCombustion.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -48,10 +49,10 @@ namespace combustionModels
Class singleStepCombustion Declaration
\*---------------------------------------------------------------------------*/
template<class CombThermoType, class ThermoType>
template<class ReactionThermo, class ThermoType>
class singleStepCombustion
:
public CombThermoType
public ThermoCombustion<ReactionThermo>
{
// Private Member Functions
@ -84,7 +85,7 @@ public:
singleStepCombustion
(
const word& modelType,
typename CombThermoType::reactionThermo& thermo,
ReactionThermo& thermo,
const compressibleTurbulenceModel& turb,
const word& combustionProperties
);

View File

@ -27,9 +27,9 @@ License
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
template<class Type>
template<class ReactionThermo>
Foam::tmp<Foam::fvScalarMatrix>
Foam::combustionModels::zoneCombustion<Type>::filter
Foam::combustionModels::zoneCombustion<ReactionThermo>::filter
(
const tmp<fvScalarMatrix>& tR
) const
@ -72,9 +72,9 @@ Foam::combustionModels::zoneCombustion<Type>::filter
}
template<class Type>
template<class ReactionThermo>
Foam::tmp<Foam::volScalarField>
Foam::combustionModels::zoneCombustion<Type>::filter
Foam::combustionModels::zoneCombustion<ReactionThermo>::filter
(
const tmp<volScalarField>& tS
) const
@ -100,73 +100,89 @@ Foam::combustionModels::zoneCombustion<Type>::filter
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
Foam::combustionModels::zoneCombustion<Type>::zoneCombustion
template<class ReactionThermo>
Foam::combustionModels::zoneCombustion<ReactionThermo>::zoneCombustion
(
const word& modelType,
typename Type::reactionThermo& thermo,
ReactionThermo& thermo,
const compressibleTurbulenceModel& turb,
const word& combustionProperties
)
:
Type(modelType, thermo, turb, combustionProperties),
combustionModelPtr_(Type::New(thermo, turb, "zoneCombustionProperties")),
CombustionModel<ReactionThermo>
(
modelType,
thermo,
turb,
combustionProperties
),
combustionModelPtr_
(
CombustionModel<ReactionThermo>::New
(
thermo,
turb,
"zoneCombustionProperties"
)
),
zoneNames_(this->coeffs().lookup("zones"))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class Type>
Foam::combustionModels::zoneCombustion<Type>::~zoneCombustion()
template<class ReactionThermo>
Foam::combustionModels::zoneCombustion<ReactionThermo>::~zoneCombustion()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
template<class Type>
typename Type::reactionThermo&
Foam::combustionModels::zoneCombustion<Type>::thermo()
template<class ReactionThermo>
ReactionThermo& Foam::combustionModels::zoneCombustion<ReactionThermo>::thermo()
{
return combustionModelPtr_->thermo();
}
template<class Type>
const typename Type::reactionThermo&
Foam::combustionModels::zoneCombustion<Type>::thermo() const
template<class ReactionThermo>
const ReactionThermo&
Foam::combustionModels::zoneCombustion<ReactionThermo>::thermo() const
{
return combustionModelPtr_->thermo();
}
template<class Type>
void Foam::combustionModels::zoneCombustion<Type>::correct()
template<class ReactionThermo>
void Foam::combustionModels::zoneCombustion<ReactionThermo>::correct()
{
combustionModelPtr_->correct();
}
template<class Type>
template<class ReactionThermo>
Foam::tmp<Foam::fvScalarMatrix>
Foam::combustionModels::zoneCombustion<Type>::R(volScalarField& Y) const
Foam::combustionModels::zoneCombustion<ReactionThermo>::R
(
volScalarField& Y
) const
{
return filter(combustionModelPtr_->R(Y));
}
template<class Type>
template<class ReactionThermo>
Foam::tmp<Foam::volScalarField>
Foam::combustionModels::zoneCombustion<Type>::Qdot() const
Foam::combustionModels::zoneCombustion<ReactionThermo>::Qdot() const
{
return filter(combustionModelPtr_->Qdot());
}
template<class Type>
bool Foam::combustionModels::zoneCombustion<Type>::read()
template<class ReactionThermo>
bool Foam::combustionModels::zoneCombustion<ReactionThermo>::read()
{
if (Type::read())
if (CombustionModel<ReactionThermo>::read())
{
combustionModelPtr_->read();
return true;

View File

@ -38,6 +38,8 @@ SourceFiles
#ifndef zoneCombustion_H
#define zoneCombustion_H
#include "CombustionModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
@ -49,15 +51,15 @@ namespace combustionModels
Class zoneCombustion Declaration
\*---------------------------------------------------------------------------*/
template<class Type>
template<class ReactionThermo>
class zoneCombustion
:
public Type
public CombustionModel<ReactionThermo>
{
// Private data
//- The combustion model to be zone-filtered
autoPtr<Type> combustionModelPtr_;
autoPtr<CombustionModel<ReactionThermo>> combustionModelPtr_;
//- List of zone names in which the reactions are active
wordList zoneNames_;
@ -90,7 +92,7 @@ public:
zoneCombustion
(
const word& modelType,
typename Type::reactionThermo& thermo,
ReactionThermo& thermo,
const compressibleTurbulenceModel& turb,
const word& combustionProperties
);
@ -103,10 +105,10 @@ public:
// Member Functions
//- Return access to the thermo package
virtual typename Type::reactionThermo& thermo();
virtual ReactionThermo& thermo();
//- Return const access to the thermo package
virtual const typename Type::reactionThermo& thermo() const;
virtual const ReactionThermo& thermo() const;
//- Correct combustion rate
virtual void correct();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2016-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -25,13 +25,13 @@ License
#include "makeCombustionTypes.H"
#include "psiCombustionModel.H"
#include "rhoCombustionModel.H"
#include "psiReactionThermo.H"
#include "rhoReactionThermo.H"
#include "zoneCombustion.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makeCombustionTypes(zoneCombustion, psiCombustionModel, psiCombustionModel);
makeCombustionTypes(zoneCombustion, rhoCombustionModel, rhoCombustionModel);
makeCombustionTypes(zoneCombustion, psiReactionThermo);
makeCombustionTypes(zoneCombustion, rhoReactionThermo);
// ************************************************************************* //

View File

@ -251,6 +251,9 @@ public:
//- Update properties
virtual void correct() = 0;
//- Return the name of the thermo physics
virtual word thermoName() const = 0;
//- Return true if the equation of state is incompressible
// i.e. rho != f(p)
virtual bool incompressible() const = 0;

View File

@ -120,6 +120,12 @@ public:
return *this;
}
//- Return the name of the thermo physics
virtual word thermoName() const
{
return MixtureType::thermoType::typeName();
}
//- Return true if the equation of state is incompressible
// i.e. rho != f(p)
virtual bool incompressible() const

View File

@ -1,10 +1,5 @@
chemistryModel/basicChemistryModel/basicChemistryModel.C
chemistryModel/psiChemistryModel/psiChemistryModel.C
chemistryModel/psiChemistryModel/psiChemistryModels.C
chemistryModel/rhoChemistryModel/rhoChemistryModel.C
chemistryModel/rhoChemistryModel/rhoChemistryModels.C
chemistryModel/BasicChemistryModel/BasicChemistryModels.C
chemistryModel/TDACChemistryModel/reduction/makeChemistryReductionMethods.C
chemistryModel/TDACChemistryModel/tabulation/makeChemistryTabulationMethods.C

View File

@ -23,21 +23,15 @@ License
\*---------------------------------------------------------------------------*/
#include "psiChemistryModel.H"
#include "fvMesh.H"
/* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */
namespace Foam
{
defineTypeNameAndDebug(psiChemistryModel, 0);
defineRunTimeSelectionTable(psiChemistryModel, thermo);
}
#include "BasicChemistryModel.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::psiChemistryModel::psiChemistryModel(psiReactionThermo& thermo)
template<class ReactionThermo>
Foam::BasicChemistryModel<ReactionThermo>::BasicChemistryModel
(
ReactionThermo& thermo
)
:
basicChemistryModel(thermo),
thermo_(thermo)
@ -46,18 +40,21 @@ Foam::psiChemistryModel::psiChemistryModel(psiReactionThermo& thermo)
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::psiChemistryModel> Foam::psiChemistryModel::New
(
psiReactionThermo& thermo
)
template<class ReactionThermo>
Foam::autoPtr<Foam::BasicChemistryModel<ReactionThermo>>
Foam::BasicChemistryModel<ReactionThermo>::New(ReactionThermo& thermo)
{
return basicChemistryModel::New<psiChemistryModel>(thermo);
return basicChemistryModel::New<BasicChemistryModel<ReactionThermo>>
(
thermo
);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::psiChemistryModel::~psiChemistryModel()
template<class ReactionThermo>
Foam::BasicChemistryModel<ReactionThermo>::~BasicChemistryModel()
{}

View File

@ -22,25 +22,23 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::rhoChemistryModel
Foam::BasicChemistryModel
Description
Chemistry model for density-based thermodynamics
Basic chemistry model templated on thermodynamics
SourceFiles
rhoChemistryModelI.H
rhoChemistryModel.C
newChemistryModel.C
BasicChemistryModelI.H
BasicChemistryModel.C
\*---------------------------------------------------------------------------*/
#ifndef rhoChemistryModel_H
#define rhoChemistryModel_H
#ifndef BasicChemistryModel_H
#define BasicChemistryModel_H
#include "basicChemistryModel.H"
#include "autoPtr.H"
#include "runTimeSelectionTables.H"
#include "rhoReactionThermo.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -51,47 +49,39 @@ namespace Foam
class fvMesh;
/*---------------------------------------------------------------------------*\
class rhoChemistryModel Declaration
class BasicChemistryModel Declaration
\*---------------------------------------------------------------------------*/
class rhoChemistryModel
template<class ReactionThermo>
class BasicChemistryModel
:
public basicChemistryModel
{
// Private Member Functions
//- Construct as copy (not implemented)
rhoChemistryModel(const rhoChemistryModel&);
//- Disallow default bitwise assignment
void operator=(const rhoChemistryModel&);
protected:
// Protected data
//- Thermo
rhoReactionThermo& thermo_;
ReactionThermo& thermo_;
public:
//- Runtime type information
TypeName("rho");
TypeName("BasicChemistryModel");
//- Thermo type
typedef rhoReactionThermo reactionThermo;
typedef ReactionThermo reactionThermo;
//- Declare run-time constructor selection tables
declareRunTimeSelectionTable
(
autoPtr,
rhoChemistryModel,
BasicChemistryModel,
thermo,
(rhoReactionThermo& thermo),
(ReactionThermo& thermo),
(thermo)
);
@ -99,24 +89,27 @@ public:
// Constructors
//- Construct from thermo
rhoChemistryModel(rhoReactionThermo& thermo);
BasicChemistryModel(ReactionThermo& thermo);
//- Selector
static autoPtr<rhoChemistryModel> New(rhoReactionThermo& thermo);
static autoPtr<BasicChemistryModel<ReactionThermo>> New
(
ReactionThermo& thermo
);
//- Destructor
virtual ~rhoChemistryModel();
virtual ~BasicChemistryModel();
// Member Functions
//- Return access to the thermo package
inline rhoReactionThermo& thermo();
inline ReactionThermo& thermo();
//- Return const access to the thermo package
inline const rhoReactionThermo& thermo() const;
inline const ReactionThermo& thermo() const;
};
@ -126,7 +119,11 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "rhoChemistryModelI.H"
#ifdef NoRepository
#include "BasicChemistryModel.C"
#endif
#include "BasicChemistryModelI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -23,15 +23,20 @@ License
\*---------------------------------------------------------------------------*/
#include "BasicChemistryModel.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
inline Foam::psiReactionThermo& Foam::psiChemistryModel::thermo()
template<class ReactionThermo>
inline ReactionThermo& Foam::BasicChemistryModel<ReactionThermo>::thermo()
{
return thermo_;
}
inline const Foam::psiReactionThermo& Foam::psiChemistryModel::thermo() const
template<class ReactionThermo>
inline const ReactionThermo&
Foam::BasicChemistryModel<ReactionThermo>::thermo() const
{
return thermo_;
}

View File

@ -0,0 +1,339 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
InClass
Foam::psiChemistryModel
Description
Creates chemistry model instances templated on the type of thermodynamics
\*---------------------------------------------------------------------------*/
#include "makeChemistryModel.H"
#include "psiReactionThermo.H"
#include "rhoReactionThermo.H"
#include "StandardChemistryModel.H"
#include "TDACChemistryModel.H"
#include "thermoPhysicsTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Make base types
makeChemistryModel(psiReactionThermo);
makeChemistryModel(rhoReactionThermo);
// Chemistry moldels based on sensibleEnthalpy
makeChemistryModelType
(
StandardChemistryModel,
psiReactionThermo,
constGasHThermoPhysics
);
makeChemistryModelType
(
StandardChemistryModel,
psiReactionThermo,
gasHThermoPhysics
);
makeChemistryModelType
(
StandardChemistryModel,
psiReactionThermo,
constIncompressibleGasHThermoPhysics
);
makeChemistryModelType
(
StandardChemistryModel,
psiReactionThermo,
incompressibleGasHThermoPhysics
);
makeChemistryModelType
(
StandardChemistryModel,
psiReactionThermo,
icoPoly8HThermoPhysics
);
makeChemistryModelType
(
StandardChemistryModel,
rhoReactionThermo,
constGasHThermoPhysics
);
makeChemistryModelType
(
StandardChemistryModel,
rhoReactionThermo,
gasHThermoPhysics
);
makeChemistryModelType
(
StandardChemistryModel,
rhoReactionThermo,
constIncompressibleGasHThermoPhysics
);
makeChemistryModelType
(
StandardChemistryModel,
rhoReactionThermo,
incompressibleGasHThermoPhysics
);
makeChemistryModelType
(
StandardChemistryModel,
rhoReactionThermo,
icoPoly8HThermoPhysics
);
makeChemistryModelType
(
TDACChemistryModel,
psiReactionThermo,
constGasHThermoPhysics
);
makeChemistryModelType
(
TDACChemistryModel,
psiReactionThermo,
gasHThermoPhysics
);
makeChemistryModelType
(
TDACChemistryModel,
psiReactionThermo,
constIncompressibleGasHThermoPhysics
);
makeChemistryModelType
(
TDACChemistryModel,
psiReactionThermo,
incompressibleGasHThermoPhysics
);
makeChemistryModelType
(
TDACChemistryModel,
psiReactionThermo,
icoPoly8HThermoPhysics
);
makeChemistryModelType
(
TDACChemistryModel,
rhoReactionThermo,
constGasHThermoPhysics
);
makeChemistryModelType
(
TDACChemistryModel,
rhoReactionThermo,
gasHThermoPhysics
);
makeChemistryModelType
(
TDACChemistryModel,
rhoReactionThermo,
constIncompressibleGasHThermoPhysics
);
makeChemistryModelType
(
TDACChemistryModel,
rhoReactionThermo,
incompressibleGasHThermoPhysics
);
makeChemistryModelType
(
TDACChemistryModel,
rhoReactionThermo,
icoPoly8HThermoPhysics
);
// Chemistry moldels based on sensibleInternalEnergy
makeChemistryModelType
(
StandardChemistryModel,
psiReactionThermo,
constGasEThermoPhysics
);
makeChemistryModelType
(
StandardChemistryModel,
psiReactionThermo,
gasEThermoPhysics
);
makeChemistryModelType
(
StandardChemistryModel,
psiReactionThermo,
constIncompressibleGasEThermoPhysics
);
makeChemistryModelType
(
StandardChemistryModel,
psiReactionThermo,
incompressibleGasEThermoPhysics
);
makeChemistryModelType
(
StandardChemistryModel,
psiReactionThermo,
icoPoly8EThermoPhysics
);
makeChemistryModelType
(
StandardChemistryModel,
rhoReactionThermo,
constGasEThermoPhysics
);
makeChemistryModelType
(
StandardChemistryModel,
rhoReactionThermo,
gasEThermoPhysics
);
makeChemistryModelType
(
StandardChemistryModel,
rhoReactionThermo,
constIncompressibleGasEThermoPhysics
);
makeChemistryModelType
(
StandardChemistryModel,
rhoReactionThermo,
incompressibleGasEThermoPhysics
);
makeChemistryModelType
(
StandardChemistryModel,
rhoReactionThermo,
icoPoly8EThermoPhysics
);
makeChemistryModelType
(
TDACChemistryModel,
psiReactionThermo,
constGasEThermoPhysics
);
makeChemistryModelType
(
TDACChemistryModel,
psiReactionThermo,
gasEThermoPhysics
);
makeChemistryModelType
(
TDACChemistryModel,
psiReactionThermo,
constIncompressibleGasEThermoPhysics
);
makeChemistryModelType
(
TDACChemistryModel,
psiReactionThermo,
incompressibleGasEThermoPhysics
);
makeChemistryModelType
(
TDACChemistryModel,
psiReactionThermo,
icoPoly8EThermoPhysics
);
makeChemistryModelType
(
TDACChemistryModel,
rhoReactionThermo,
constGasEThermoPhysics
);
makeChemistryModelType
(
TDACChemistryModel,
rhoReactionThermo,
gasEThermoPhysics
);
makeChemistryModelType
(
TDACChemistryModel,
rhoReactionThermo,
constIncompressibleGasEThermoPhysics
);
makeChemistryModelType
(
TDACChemistryModel,
rhoReactionThermo,
incompressibleGasEThermoPhysics
);
makeChemistryModelType
(
TDACChemistryModel,
rhoReactionThermo,
icoPoly8EThermoPhysics
);
}
// ************************************************************************* //

View File

@ -23,20 +23,20 @@ License
\*---------------------------------------------------------------------------*/
#include "chemistryModel.H"
#include "StandardChemistryModel.H"
#include "reactingMixture.H"
#include "UniformField.H"
#include "extrapolatedCalculatedFvPatchFields.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class CompType, class ThermoType>
Foam::chemistryModel<CompType, ThermoType>::chemistryModel
template<class ReactionThermo, class ThermoType>
Foam::StandardChemistryModel<ReactionThermo, ThermoType>::StandardChemistryModel
(
typename CompType::reactionThermo& thermo
ReactionThermo& thermo
)
:
CompType(thermo),
BasicChemistryModel<ReactionThermo>(thermo),
ODESystem(),
Y_(this->thermo().composition().Y()),
reactions_
@ -51,7 +51,14 @@ Foam::chemistryModel<CompType, ThermoType>::chemistryModel
nSpecie_(Y_.size()),
nReaction_(reactions_.size()),
Treact_(CompType::template lookupOrDefault<scalar>("Treact", 0.0)),
Treact_
(
BasicChemistryModel<ReactionThermo>::template lookupOrDefault<scalar>
(
"Treact",
0.0
)
),
RR_(nSpecie_),
c_(nSpecie_),
dcdt_(nSpecie_)
@ -78,22 +85,23 @@ Foam::chemistryModel<CompType, ThermoType>::chemistryModel
);
}
Info<< "chemistryModel: Number of species = " << nSpecie_
Info<< "StandardChemistryModel: Number of species = " << nSpecie_
<< " and reactions = " << nReaction_ << endl;
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class CompType, class ThermoType>
Foam::chemistryModel<CompType, ThermoType>::~chemistryModel()
template<class ReactionThermo, class ThermoType>
Foam::StandardChemistryModel<ReactionThermo, ThermoType>::
~StandardChemistryModel()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class CompType, class ThermoType>
void Foam::chemistryModel<CompType, ThermoType>::omega
template<class ReactionThermo, class ThermoType>
void Foam::StandardChemistryModel<ReactionThermo, ThermoType>::omega
(
const scalarField& c,
const scalar T,
@ -132,8 +140,8 @@ void Foam::chemistryModel<CompType, ThermoType>::omega
}
template<class CompType, class ThermoType>
Foam::scalar Foam::chemistryModel<CompType, ThermoType>::omegaI
template<class ReactionThermo, class ThermoType>
Foam::scalar Foam::StandardChemistryModel<ReactionThermo, ThermoType>::omegaI
(
const label index,
const scalarField& c,
@ -153,8 +161,8 @@ Foam::scalar Foam::chemistryModel<CompType, ThermoType>::omegaI
}
template<class CompType, class ThermoType>
Foam::scalar Foam::chemistryModel<CompType, ThermoType>::omega
template<class ReactionThermo, class ThermoType>
Foam::scalar Foam::StandardChemistryModel<ReactionThermo, ThermoType>::omega
(
const Reaction<ThermoType>& R,
const scalarField& c,
@ -265,8 +273,8 @@ Foam::scalar Foam::chemistryModel<CompType, ThermoType>::omega
}
template<class CompType, class ThermoType>
void Foam::chemistryModel<CompType, ThermoType>::derivatives
template<class ReactionThermo, class ThermoType>
void Foam::StandardChemistryModel<ReactionThermo, ThermoType>::derivatives
(
const scalar time,
const scalarField& c,
@ -315,8 +323,8 @@ void Foam::chemistryModel<CompType, ThermoType>::derivatives
}
template<class CompType, class ThermoType>
void Foam::chemistryModel<CompType, ThermoType>::jacobian
template<class ReactionThermo, class ThermoType>
void Foam::StandardChemistryModel<ReactionThermo, ThermoType>::jacobian
(
const scalar t,
const scalarField& c,
@ -457,9 +465,9 @@ void Foam::chemistryModel<CompType, ThermoType>::jacobian
}
template<class CompType, class ThermoType>
template<class ReactionThermo, class ThermoType>
Foam::tmp<Foam::volScalarField>
Foam::chemistryModel<CompType, ThermoType>::tc() const
Foam::StandardChemistryModel<ReactionThermo, ThermoType>::tc() const
{
tmp<volScalarField> ttc
(
@ -531,9 +539,9 @@ Foam::chemistryModel<CompType, ThermoType>::tc() const
}
template<class CompType, class ThermoType>
template<class ReactionThermo, class ThermoType>
Foam::tmp<Foam::volScalarField>
Foam::chemistryModel<CompType, ThermoType>::Qdot() const
Foam::StandardChemistryModel<ReactionThermo, ThermoType>::Qdot() const
{
tmp<volScalarField> tQdot
(
@ -571,9 +579,9 @@ Foam::chemistryModel<CompType, ThermoType>::Qdot() const
}
template<class CompType, class ThermoType>
template<class ReactionThermo, class ThermoType>
Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh>>
Foam::chemistryModel<CompType, ThermoType>::calculateRR
Foam::StandardChemistryModel<ReactionThermo, ThermoType>::calculateRR
(
const label ri,
const label si
@ -640,8 +648,8 @@ Foam::chemistryModel<CompType, ThermoType>::calculateRR
}
template<class CompType, class ThermoType>
void Foam::chemistryModel<CompType, ThermoType>::calculate()
template<class ReactionThermo, class ThermoType>
void Foam::StandardChemistryModel<ReactionThermo, ThermoType>::calculate()
{
if (!this->chemistry_)
{
@ -676,14 +684,14 @@ void Foam::chemistryModel<CompType, ThermoType>::calculate()
}
template<class CompType, class ThermoType>
template<class ReactionThermo, class ThermoType>
template<class DeltaTType>
Foam::scalar Foam::chemistryModel<CompType, ThermoType>::solve
Foam::scalar Foam::StandardChemistryModel<ReactionThermo, ThermoType>::solve
(
const DeltaTType& deltaT
)
{
CompType::correct();
BasicChemistryModel<ReactionThermo>::correct();
scalar deltaTMin = GREAT;
@ -747,8 +755,8 @@ Foam::scalar Foam::chemistryModel<CompType, ThermoType>::solve
}
template<class CompType, class ThermoType>
Foam::scalar Foam::chemistryModel<CompType, ThermoType>::solve
template<class ReactionThermo, class ThermoType>
Foam::scalar Foam::StandardChemistryModel<ReactionThermo, ThermoType>::solve
(
const scalar deltaT
)
@ -762,8 +770,8 @@ Foam::scalar Foam::chemistryModel<CompType, ThermoType>::solve
}
template<class CompType, class ThermoType>
Foam::scalar Foam::chemistryModel<CompType, ThermoType>::solve
template<class ReactionThermo, class ThermoType>
Foam::scalar Foam::StandardChemistryModel<ReactionThermo, ThermoType>::solve
(
const scalarField& deltaT
)

View File

@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::chemistryModel
Foam::StandardChemistryModel
Description
Extends base chemistry model by adding a thermo package, and ODE functions.
@ -30,14 +30,15 @@ Description
terms.
SourceFiles
chemistryModelI.H
chemistryModel.C
StandardChemistryModelI.H
StandardChemistryModel.C
\*---------------------------------------------------------------------------*/
#ifndef chemistryModel_H
#define chemistryModel_H
#ifndef StandardChemistryModel_H
#define StandardChemistryModel_H
#include "BasicChemistryModel.H"
#include "Reaction.H"
#include "ODESystem.H"
#include "volFields.H"
@ -52,13 +53,13 @@ namespace Foam
class fvMesh;
/*---------------------------------------------------------------------------*\
Class chemistryModel Declaration
Class StandardChemistryModel Declaration
\*---------------------------------------------------------------------------*/
template<class CompType, class ThermoType>
class chemistryModel
template<class ReactionThermo, class ThermoType>
class StandardChemistryModel
:
public CompType,
public BasicChemistryModel<ReactionThermo>,
public ODESystem
{
// Private Member Functions
@ -69,10 +70,10 @@ class chemistryModel
scalar solve(const DeltaTType& deltaT);
//- Disallow copy constructor
chemistryModel(const chemistryModel&);
StandardChemistryModel(const StandardChemistryModel&);
//- Disallow default bitwise assignment
void operator=(const chemistryModel&);
void operator=(const StandardChemistryModel&);
protected:
@ -120,17 +121,17 @@ protected:
public:
//- Runtime type information
TypeName("chemistryModel");
TypeName("standard");
// Constructors
//- Construct from thermo
chemistryModel(typename CompType::reactionThermo& thermo);
StandardChemistryModel(ReactionThermo& thermo);
//- Destructor
virtual ~chemistryModel();
virtual ~StandardChemistryModel();
// Member Functions
@ -273,12 +274,12 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "chemistryModelI.H"
#include "StandardChemistryModelI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "chemistryModel.C"
#include "StandardChemistryModel.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -28,73 +28,74 @@ License
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class CompType, class ThermoType>
inline Foam::label Foam::chemistryModel<CompType, ThermoType>::nEqns() const
template<class ReactionThermo, class ThermoType>
inline Foam::label
Foam::StandardChemistryModel<ReactionThermo, ThermoType>::nEqns() const
{
// nEqns = number of species + temperature + pressure
return nSpecie_ + 2;
}
template<class CompType, class ThermoType>
template<class ReactionThermo, class ThermoType>
inline Foam::PtrList<Foam::DimensionedField<Foam::scalar, Foam::volMesh>>&
Foam::chemistryModel<CompType, ThermoType>::RR()
Foam::StandardChemistryModel<ReactionThermo, ThermoType>::RR()
{
return RR_;
}
template<class CompType, class ThermoType>
template<class ReactionThermo, class ThermoType>
inline const Foam::PtrList<Foam::Reaction<ThermoType>>&
Foam::chemistryModel<CompType, ThermoType>::reactions() const
Foam::StandardChemistryModel<ReactionThermo, ThermoType>::reactions() const
{
return reactions_;
}
template<class CompType, class ThermoType>
template<class ReactionThermo, class ThermoType>
inline const Foam::PtrList<ThermoType>&
Foam::chemistryModel<CompType, ThermoType>::specieThermo() const
Foam::StandardChemistryModel<ReactionThermo, ThermoType>::specieThermo() const
{
return specieThermo_;
}
template<class CompType, class ThermoType>
template<class ReactionThermo, class ThermoType>
inline Foam::label
Foam::chemistryModel<CompType, ThermoType>::nSpecie() const
Foam::StandardChemistryModel<ReactionThermo, ThermoType>::nSpecie() const
{
return nSpecie_;
}
template<class CompType, class ThermoType>
template<class ReactionThermo, class ThermoType>
inline Foam::label
Foam::chemistryModel<CompType, ThermoType>::nReaction() const
Foam::StandardChemistryModel<ReactionThermo, ThermoType>::nReaction() const
{
return nReaction_;
}
template<class CompType, class ThermoType>
template<class ReactionThermo, class ThermoType>
inline Foam::scalar
Foam::chemistryModel<CompType, ThermoType>::Treact() const
Foam::StandardChemistryModel<ReactionThermo, ThermoType>::Treact() const
{
return Treact_;
}
template<class CompType, class ThermoType>
template<class ReactionThermo, class ThermoType>
inline Foam::scalar&
Foam::chemistryModel<CompType, ThermoType>::Treact()
Foam::StandardChemistryModel<ReactionThermo, ThermoType>::Treact()
{
return Treact_;
}
template<class CompType, class ThermoType>
template<class ReactionThermo, class ThermoType>
inline const Foam::DimensionedField<Foam::scalar, Foam::volMesh>&
Foam::chemistryModel<CompType, ThermoType>::RR
Foam::StandardChemistryModel<ReactionThermo, ThermoType>::RR
(
const label i
) const
@ -102,9 +103,9 @@ Foam::chemistryModel<CompType, ThermoType>::RR
return RR_[i];
}
template<class CompType, class ThermoType>
template<class ReactionThermo, class ThermoType>
Foam::DimensionedField<Foam::scalar, Foam::volMesh>&
Foam::chemistryModel<CompType, ThermoType>::RR
Foam::StandardChemistryModel<ReactionThermo, ThermoType>::RR
(
const label i
)

View File

@ -30,13 +30,13 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class CompType, class ThermoType>
Foam::TDACChemistryModel<CompType, ThermoType>::TDACChemistryModel
template<class ReactionThermo, class ThermoType>
Foam::TDACChemistryModel<ReactionThermo, ThermoType>::TDACChemistryModel
(
typename CompType::reactionThermo& thermo
ReactionThermo& thermo
)
:
chemistryModel<CompType, ThermoType>(thermo),
StandardChemistryModel<ReactionThermo, ThermoType>(thermo),
variableTimeStep_
(
this->mesh().time().controlDict().lookupOrDefault
@ -81,7 +81,7 @@ Foam::TDACChemistryModel<CompType, ThermoType>::TDACChemistryModel
specieComp_[i] = specComp[this->Y()[i].member()];
}
mechRed_ = chemistryReductionMethod<CompType, ThermoType>::New
mechRed_ = chemistryReductionMethod<ReactionThermo, ThermoType>::New
(
*this,
*this
@ -111,7 +111,7 @@ Foam::TDACChemistryModel<CompType, ThermoType>::TDACChemistryModel
}
}
tabulation_ = chemistryTabulationMethod<CompType, ThermoType>::New
tabulation_ = chemistryTabulationMethod<ReactionThermo, ThermoType>::New
(
*this,
*this
@ -139,15 +139,15 @@ Foam::TDACChemistryModel<CompType, ThermoType>::TDACChemistryModel
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class CompType, class ThermoType>
Foam::TDACChemistryModel<CompType, ThermoType>::~TDACChemistryModel()
template<class ReactionThermo, class ThermoType>
Foam::TDACChemistryModel<ReactionThermo, ThermoType>::~TDACChemistryModel()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class CompType, class ThermoType>
void Foam::TDACChemistryModel<CompType, ThermoType>::omega
template<class ReactionThermo, class ThermoType>
void Foam::TDACChemistryModel<ReactionThermo, ThermoType>::omega
(
const scalarField& c, // Contains all species even when mechRed is active
const scalar T,
@ -200,8 +200,8 @@ void Foam::TDACChemistryModel<CompType, ThermoType>::omega
}
template<class CompType, class ThermoType>
Foam::scalar Foam::TDACChemistryModel<CompType, ThermoType>::omega
template<class ReactionThermo, class ThermoType>
Foam::scalar Foam::TDACChemistryModel<ReactionThermo, ThermoType>::omega
(
const Reaction<ThermoType>& R,
const scalarField& c, // Contains all species even when mechRed is active
@ -309,8 +309,8 @@ Foam::scalar Foam::TDACChemistryModel<CompType, ThermoType>::omega
}
template<class CompType, class ThermoType>
void Foam::TDACChemistryModel<CompType, ThermoType>::derivatives
template<class ReactionThermo, class ThermoType>
void Foam::TDACChemistryModel<ReactionThermo, ThermoType>::derivatives
(
const scalar time,
const scalarField& c,
@ -393,8 +393,8 @@ void Foam::TDACChemistryModel<CompType, ThermoType>::derivatives
}
template<class CompType, class ThermoType>
void Foam::TDACChemistryModel<CompType, ThermoType>::jacobian
template<class ReactionThermo, class ThermoType>
void Foam::TDACChemistryModel<ReactionThermo, ThermoType>::jacobian
(
const scalar t,
const scalarField& c,
@ -577,8 +577,8 @@ void Foam::TDACChemistryModel<CompType, ThermoType>::jacobian
}
template<class CompType, class ThermoType>
void Foam::TDACChemistryModel<CompType, ThermoType>::jacobian
template<class ReactionThermo, class ThermoType>
void Foam::TDACChemistryModel<ReactionThermo, ThermoType>::jacobian
(
const scalar t,
const scalarField& c,
@ -596,9 +596,9 @@ void Foam::TDACChemistryModel<CompType, ThermoType>::jacobian
}
template<class CompType, class ThermoType>
template<class ReactionThermo, class ThermoType>
template<class DeltaTType>
Foam::scalar Foam::TDACChemistryModel<CompType, ThermoType>::solve
Foam::scalar Foam::TDACChemistryModel<ReactionThermo, ThermoType>::solve
(
const DeltaTType& deltaT
)
@ -627,7 +627,7 @@ Foam::scalar Foam::TDACChemistryModel<CompType, ThermoType>::solve
scalar nActiveSpecies = 0;
scalar nAvg = 0;
CompType::correct();
BasicChemistryModel<ReactionThermo>::correct();
scalar deltaTMin = GREAT;
@ -880,8 +880,8 @@ Foam::scalar Foam::TDACChemistryModel<CompType, ThermoType>::solve
}
template<class CompType, class ThermoType>
Foam::scalar Foam::TDACChemistryModel<CompType, ThermoType>::solve
template<class ReactionThermo, class ThermoType>
Foam::scalar Foam::TDACChemistryModel<ReactionThermo, ThermoType>::solve
(
const scalar deltaT
)
@ -895,8 +895,8 @@ Foam::scalar Foam::TDACChemistryModel<CompType, ThermoType>::solve
}
template<class CompType, class ThermoType>
Foam::scalar Foam::TDACChemistryModel<CompType, ThermoType>::solve
template<class ReactionThermo, class ThermoType>
Foam::scalar Foam::TDACChemistryModel<ReactionThermo, ThermoType>::solve
(
const scalarField& deltaT
)
@ -905,8 +905,9 @@ Foam::scalar Foam::TDACChemistryModel<CompType, ThermoType>::solve
}
template<class CompType, class ThermoType>
void Foam::TDACChemistryModel<CompType, ThermoType>::setTabulationResultsAdd
template<class ReactionThermo, class ThermoType>
void Foam::TDACChemistryModel<ReactionThermo, ThermoType>::
setTabulationResultsAdd
(
const label celli
)
@ -915,18 +916,16 @@ void Foam::TDACChemistryModel<CompType, ThermoType>::setTabulationResultsAdd
}
template<class CompType, class ThermoType>
void Foam::TDACChemistryModel<CompType, ThermoType>::setTabulationResultsGrow
(
const label celli
)
template<class ReactionThermo, class ThermoType>
void Foam::TDACChemistryModel<ReactionThermo, ThermoType>::
setTabulationResultsGrow(const label celli)
{
tabulationResults_[celli] = 1.0;
}
template<class CompType, class ThermoType>
void Foam::TDACChemistryModel<CompType, ThermoType>::
template<class ReactionThermo, class ThermoType>
void Foam::TDACChemistryModel<ReactionThermo, ThermoType>::
setTabulationResultsRetrieve
(
const label celli

View File

@ -25,7 +25,7 @@ Class
Foam::TDACChemistryModel
Description
Extends chemistryModel by adding the TDAC method.
Extends StandardChemistryModel by adding the TDAC method.
References:
\verbatim
@ -64,7 +64,7 @@ SourceFiles
#ifndef TDACChemistryModel_H
#define TDACChemistryModel_H
#include "chemistryModel.H"
#include "StandardChemistryModel.H"
#include "chemistryReductionMethod.H"
#include "chemistryTabulationMethod.H"
#include "OFstream.H"
@ -78,10 +78,10 @@ namespace Foam
Class TDACChemistryModel Declaration
\*---------------------------------------------------------------------------*/
template<class CompType, class ThermoType>
template<class ReactionThermo, class ThermoType>
class TDACChemistryModel
:
public chemistryModel<CompType, ThermoType>
public StandardChemistryModel<ReactionThermo, ThermoType>
{
// Private member data
@ -97,10 +97,12 @@ class TDACChemistryModel
List<List<specieElement>> specieComp_;
Field<label> completeToSimplifiedIndex_;
DynamicList<label> simplifiedToCompleteIndex_;
autoPtr<chemistryReductionMethod<CompType, ThermoType>> mechRed_;
autoPtr<chemistryReductionMethod<ReactionThermo, ThermoType>>
mechRed_;
// Tabulation
autoPtr<chemistryTabulationMethod<CompType, ThermoType>> tabulation_;
autoPtr<chemistryTabulationMethod<ReactionThermo, ThermoType>>
tabulation_;
// Log file for the average time spent reducing the chemistry
autoPtr<OFstream> cpuReduceFile_;
@ -145,13 +147,13 @@ class TDACChemistryModel
public:
//- Runtime type information
TypeName("TDACChemistryModel");
TypeName("TDAC");
// Constructors
//- Construct from thermo
TDACChemistryModel(typename CompType::reactionThermo& thermo);
TDACChemistryModel(ReactionThermo& thermo);
//- Destructor
@ -198,7 +200,7 @@ public:
// Chemistry model functions (overriding functions in
// chemistryModel to use the private solve function)
// StandardChemistryModel to use the private solve function)
//- Solve the reaction system for the given time step
// and return the characteristic time
@ -209,8 +211,8 @@ public:
virtual scalar solve(const scalarField& deltaT);
// ODE functions (overriding functions in chemistryModel to take into
// account the variable number of species)
// ODE functions (overriding functions in StandardChemistryModel to take
// into account the variable number of species)
virtual void derivatives
(
@ -269,7 +271,8 @@ public:
inline List<List<specieElement>>& specieComp();
inline autoPtr<chemistryReductionMethod<CompType, ThermoType>>&
inline
autoPtr<chemistryReductionMethod<ReactionThermo, ThermoType>>&
mechRed();
tmp<volScalarField> tabulationResults() const

View File

@ -25,25 +25,26 @@ License
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class CompType, class ThermoType>
template<class ReactionThermo, class ThermoType>
inline bool
Foam::TDACChemistryModel<CompType, ThermoType>::variableTimeStep() const
Foam::TDACChemistryModel<ReactionThermo, ThermoType>::variableTimeStep() const
{
return variableTimeStep_;
}
template<class CompType, class ThermoType>
template<class ReactionThermo, class ThermoType>
inline Foam::label
Foam::TDACChemistryModel<CompType, ThermoType>::timeSteps() const
Foam::TDACChemistryModel<ReactionThermo, ThermoType>::timeSteps() const
{
return timeSteps_;
}
template<class CompType, class ThermoType>
template<class ReactionThermo, class ThermoType>
inline Foam::autoPtr<Foam::OFstream>
Foam::TDACChemistryModel<CompType, ThermoType>::logFile(const word& name) const
Foam::TDACChemistryModel<ReactionThermo, ThermoType>::
logFile(const word& name) const
{
mkDir(this->mesh().time().path()/"TDAC"/this->group());
return autoPtr<OFstream>
@ -56,24 +57,25 @@ Foam::TDACChemistryModel<CompType, ThermoType>::logFile(const word& name) const
}
template<class CompType, class ThermoType>
template<class ReactionThermo, class ThermoType>
inline Foam::PtrList<Foam::volScalarField>&
Foam::TDACChemistryModel<CompType, ThermoType>::Y()
Foam::TDACChemistryModel<ReactionThermo, ThermoType>::Y()
{
return this->Y_;
}
template<class CompType, class ThermoType>
inline Foam::autoPtr<Foam::chemistryReductionMethod<CompType, ThermoType>>&
Foam::TDACChemistryModel<CompType, ThermoType>::mechRed()
template<class ReactionThermo, class ThermoType>
inline
Foam::autoPtr<Foam::chemistryReductionMethod<ReactionThermo, ThermoType>>&
Foam::TDACChemistryModel<ReactionThermo, ThermoType>::mechRed()
{
return mechRed_;
}
template<class CompType, class ThermoType>
inline void Foam::TDACChemistryModel<CompType, ThermoType>::setActive
template<class ReactionThermo, class ThermoType>
inline void Foam::TDACChemistryModel<ReactionThermo, ThermoType>::setActive
(
const label i
)
@ -82,8 +84,8 @@ inline void Foam::TDACChemistryModel<CompType, ThermoType>::setActive
}
template<class CompType, class ThermoType>
inline bool Foam::TDACChemistryModel<CompType, ThermoType>::active
template<class ReactionThermo, class ThermoType>
inline bool Foam::TDACChemistryModel<ReactionThermo, ThermoType>::active
(
const label i
) const
@ -92,81 +94,84 @@ inline bool Foam::TDACChemistryModel<CompType, ThermoType>::active
}
template<class CompType, class ThermoType>
inline void
Foam::TDACChemistryModel<CompType, ThermoType>::setNsDAC(const label newNsDAC)
template<class ReactionThermo, class ThermoType>
inline void Foam::TDACChemistryModel<ReactionThermo, ThermoType>::
setNsDAC(const label newNsDAC)
{
NsDAC_ = newNsDAC;
}
template<class CompType, class ThermoType>
inline void
Foam::TDACChemistryModel<CompType, ThermoType>::setNSpecie(const label newNs)
template<class ReactionThermo, class ThermoType>
inline void Foam::TDACChemistryModel<ReactionThermo, ThermoType>::
setNSpecie(const label newNs)
{
this->nSpecie_ = newNs;
}
template<class CompType, class ThermoType>
template<class ReactionThermo, class ThermoType>
inline Foam::DynamicList<Foam::label>&
Foam::TDACChemistryModel<CompType, ThermoType>::simplifiedToCompleteIndex()
Foam::TDACChemistryModel<ReactionThermo, ThermoType>::
simplifiedToCompleteIndex()
{
return simplifiedToCompleteIndex_;
}
template<class CompType, class ThermoType>
template<class ReactionThermo, class ThermoType>
inline Foam::Field<Foam::label>&
Foam::TDACChemistryModel<CompType, ThermoType>::completeToSimplifiedIndex()
Foam::TDACChemistryModel<ReactionThermo, ThermoType>::
completeToSimplifiedIndex()
{
return completeToSimplifiedIndex_;
}
template<class CompType, class ThermoType>
template<class ReactionThermo, class ThermoType>
inline const Foam::Field<Foam::label>&
Foam::TDACChemistryModel<CompType, ThermoType>::
Foam::TDACChemistryModel<ReactionThermo, ThermoType>::
completeToSimplifiedIndex() const
{
return completeToSimplifiedIndex_;
}
template<class CompType, class ThermoType>
template<class ReactionThermo, class ThermoType>
inline Foam::Field<bool>&
Foam::TDACChemistryModel<CompType, ThermoType>::reactionsDisabled()
Foam::TDACChemistryModel<ReactionThermo, ThermoType>::reactionsDisabled()
{
return reactionsDisabled_;
}
template<class CompType, class ThermoType>
template<class ReactionThermo, class ThermoType>
inline Foam::scalarField&
Foam::TDACChemistryModel<CompType, ThermoType>::completeC()
Foam::TDACChemistryModel<ReactionThermo, ThermoType>::completeC()
{
return completeC_;
}
template<class CompType, class ThermoType>
template<class ReactionThermo, class ThermoType>
inline Foam::scalarField&
Foam::TDACChemistryModel<CompType, ThermoType>::simplifiedC()
Foam::TDACChemistryModel<ReactionThermo, ThermoType>::simplifiedC()
{
return simplifiedC_;
}
template<class CompType, class ThermoType>
template<class ReactionThermo, class ThermoType>
inline Foam::List<Foam::List<Foam::specieElement>>&
Foam::TDACChemistryModel<CompType, ThermoType>::specieComp()
Foam::TDACChemistryModel<ReactionThermo, ThermoType>::specieComp()
{
return specieComp_;
}
template<class CompType, class ThermoType>
void Foam::TDACChemistryModel<CompType, ThermoType>::resetTabulationResults()
template<class ReactionThermo, class ThermoType>
void Foam::TDACChemistryModel<ReactionThermo, ThermoType>::
resetTabulationResults()
{
forAll(tabulationResults_, tabi)
{

View File

@ -36,57 +36,76 @@ Foam::chemistryReductionMethod<CompType, ThermoType>::New
TDACChemistryModel<CompType, ThermoType>& chemistry
)
{
IOdictionary thermoDict
(
IOobject
(
IOobject::groupName("thermophysicalProperties",dict.group()),
dict.db().time().constant(),
dict.db(),
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE,
false
)
);
const dictionary& reductionDict(dict.subDict("reduction"));
word thermoTypeName;
const word methodName(reductionDict.lookup("method"));
if (thermoDict.isDict("thermoType"))
{
const dictionary& thermoTypeDict(thermoDict.subDict("thermoType"));
thermoTypeName =
word(thermoTypeDict.lookup("transport")) + '<'
+ word(thermoTypeDict.lookup("thermo")) + '<'
+ word(thermoTypeDict.lookup("equationOfState")) + '<'
+ word(thermoTypeDict.lookup("specie")) + ">>,"
+ word(thermoTypeDict.lookup("energy")) + ">";
}
else
{
FatalIOErrorInFunction(thermoDict)
<< "thermoType is in the old format and must be upgraded"
<< exit(FatalIOError);
}
Info<< "Selecting chemistry reduction method " << methodName << endl;
dictionary MRdict(dict.subDict("reduction"));
word chemistryReductionMethodTypeName =
word(MRdict.lookup("method")) + '<'
+ word(dict.subDict("chemistryType").lookup("chemistryThermo")) + ','
+ thermoTypeName + '>';
const word methodTypeName =
methodName
+ '<' + CompType::typeName + ',' + ThermoType::typeName() + '>';
typename dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(chemistryReductionMethodTypeName);
dictionaryConstructorTablePtr_->find(methodTypeName);
if (cstrIter == dictionaryConstructorTablePtr_->end())
{
FatalErrorInFunction
<< "Unknown chemistryReductionMethodType type "
<< chemistryReductionMethodTypeName
<< endl << endl
<< "Valid chemistryReductionMethodType types are :" << endl
<< dictionaryConstructorTablePtr_->toc()
<< exit(FatalError);
<< "Unknown " << typeName_() << " type " << methodName << endl
<< endl;
const wordList names(dictionaryConstructorTablePtr_->toc());
wordList thisCmpts;
thisCmpts.append(word::null);
thisCmpts.append(CompType::typeName);
thisCmpts.append
(
basicThermo::splitThermoName(ThermoType::typeName(), 5)
);
wordList validNames;
forAll(names, i)
{
const wordList cmpts(basicThermo::splitThermoName(names[i], 7));
bool isValid = true;
for (label i = 1; i < cmpts.size() && isValid; ++ i)
{
isValid = isValid && cmpts[i] == thisCmpts[i];
}
if (isValid)
{
validNames.append(cmpts[0]);
}
}
FatalErrorInFunction
<< "Valid " << typeName_() << " types for this thermodynamic model "
<< "are:" << endl << validNames << endl;
List<wordList> validCmpts;
validCmpts.append(wordList(7, word::null));
validCmpts[0][0] = typeName_();
validCmpts[0][1] = "reactionThermo";
validCmpts[0][2] = "transport";
validCmpts[0][3] = "thermo";
validCmpts[0][4] = "equationOfState";
validCmpts[0][5] = "specie";
validCmpts[0][6] = "energy";
forAll(names, i)
{
validCmpts.append(basicThermo::splitThermoName(names[i], 7));
}
FatalErrorInFunction
<< "All " << validCmpts[0][0] << '/' << validCmpts[0][1]
<< "/thermoPhysics combinations are:" << endl << endl;
printTable(validCmpts, FatalErrorInFunction);
FatalErrorInFunction << exit(FatalError);
}
return autoPtr<chemistryReductionMethod<CompType, ThermoType>>

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2016-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -27,71 +27,71 @@ License
#include "thermoPhysicsTypes.H"
#include "psiChemistryModel.H"
#include "rhoChemistryModel.H"
#include "psiReactionThermo.H"
#include "rhoReactionThermo.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Chemistry solvers based on sensibleEnthalpy
makeChemistryReductionMethods(psiChemistryModel, constGasHThermoPhysics);
makeChemistryReductionMethods(psiChemistryModel, gasHThermoPhysics);
makeChemistryReductionMethods(psiReactionThermo, constGasHThermoPhysics);
makeChemistryReductionMethods(psiReactionThermo, gasHThermoPhysics);
makeChemistryReductionMethods
(
psiChemistryModel,
psiReactionThermo,
constIncompressibleGasHThermoPhysics
);
makeChemistryReductionMethods
(
psiChemistryModel,
psiReactionThermo,
incompressibleGasHThermoPhysics
);
makeChemistryReductionMethods(psiChemistryModel, icoPoly8HThermoPhysics);
makeChemistryReductionMethods(psiReactionThermo, icoPoly8HThermoPhysics);
makeChemistryReductionMethods(rhoChemistryModel, constGasHThermoPhysics);
makeChemistryReductionMethods(rhoChemistryModel, gasHThermoPhysics);
makeChemistryReductionMethods(rhoReactionThermo, constGasHThermoPhysics);
makeChemistryReductionMethods(rhoReactionThermo, gasHThermoPhysics);
makeChemistryReductionMethods
(
rhoChemistryModel,
rhoReactionThermo,
constIncompressibleGasHThermoPhysics
);
makeChemistryReductionMethods
(
rhoChemistryModel,
rhoReactionThermo,
incompressibleGasHThermoPhysics
);
makeChemistryReductionMethods(rhoChemistryModel, icoPoly8HThermoPhysics);
makeChemistryReductionMethods(rhoReactionThermo, icoPoly8HThermoPhysics);
// Chemistry solvers based on sensibleInternalEnergy
makeChemistryReductionMethods(psiChemistryModel, constGasEThermoPhysics);
makeChemistryReductionMethods(psiChemistryModel, gasEThermoPhysics);
makeChemistryReductionMethods(psiReactionThermo, constGasEThermoPhysics);
makeChemistryReductionMethods(psiReactionThermo, gasEThermoPhysics);
makeChemistryReductionMethods
(
psiChemistryModel,
psiReactionThermo,
constIncompressibleGasEThermoPhysics
);
makeChemistryReductionMethods
(
psiChemistryModel,
psiReactionThermo,
incompressibleGasEThermoPhysics
);
makeChemistryReductionMethods(psiChemistryModel, icoPoly8EThermoPhysics);
makeChemistryReductionMethods(psiReactionThermo, icoPoly8EThermoPhysics);
makeChemistryReductionMethods(rhoChemistryModel, constGasEThermoPhysics);
makeChemistryReductionMethods(rhoChemistryModel, gasEThermoPhysics);
makeChemistryReductionMethods(rhoReactionThermo, constGasEThermoPhysics);
makeChemistryReductionMethods(rhoReactionThermo, gasEThermoPhysics);
makeChemistryReductionMethods
(
rhoChemistryModel,
rhoReactionThermo,
constIncompressibleGasEThermoPhysics
);
makeChemistryReductionMethods
(
rhoChemistryModel,
rhoReactionThermo,
incompressibleGasEThermoPhysics
);
makeChemistryReductionMethods(rhoChemistryModel, icoPoly8EThermoPhysics);
makeChemistryReductionMethods(rhoReactionThermo, icoPoly8EThermoPhysics);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2016-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -54,7 +54,7 @@ License
add##chemistryReductionMethods##SS##Comp##Thermo##ConstructorToTable_;
#define makeChemistryReductionMethods(CompChemModel, Thermo) \
#define makeChemistryReductionMethods(CompChemModel, Thermo) \
\
typedef chemistryReductionMethod<CompChemModel, Thermo> \
chemistryReductionMethod##CompChemModel##Thermo; \
@ -62,7 +62,9 @@ License
defineTemplateTypeNameAndDebugWithName \
( \
chemistryReductionMethod##CompChemModel##Thermo, \
"chemistryReductionMethod<"#CompChemModel","#Thermo">", \
(word(chemistryReductionMethod##CompChemModel##Thermo::typeName_()) + \
'<' + word(CompChemModel::typeName_()) + "," + Thermo::typeName() + '>'\
).c_str(), \
0 \
); \
\

View File

@ -36,63 +36,83 @@ Foam::chemistryTabulationMethod<CompType, ThermoType>::New
TDACChemistryModel<CompType, ThermoType>& chemistry
)
{
IOdictionary thermoDict
(
IOobject
(
IOobject::groupName("thermophysicalProperties",dict.group()),
dict.db().time().constant(),
dict.db(),
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE,
false
)
);
const dictionary& tabulationDict(dict.subDict("tabulation"));
word thermoTypeName;
const word methodName(tabulationDict.lookup("method"));
if (thermoDict.isDict("thermoType"))
{
const dictionary& thermoTypeDict(thermoDict.subDict("thermoType"));
thermoTypeName =
word(thermoTypeDict.lookup("transport")) + '<'
+ word(thermoTypeDict.lookup("thermo")) + '<'
+ word(thermoTypeDict.lookup("equationOfState")) + '<'
+ word(thermoTypeDict.lookup("specie")) + ">>,"
+ word(thermoTypeDict.lookup("energy")) + ">";
}
else
{
FatalIOErrorInFunction(thermoDict)
<< "thermoType is in the old format and must be upgraded"
<< exit(FatalIOError);
}
Info<< "Selecting chemistry tabulation method " << methodName << endl;
dictionary tabdict(dict.subDict("tabulation"));
word chemistryTabulationMethodName =
word(tabdict.lookup("method")) + '<'
+ word(dict.subDict("chemistryType").lookup("chemistryThermo")) + ','
+ thermoTypeName + '>';
const word methodTypeName =
methodName + '<' + CompType::typeName + ',' + ThermoType::typeName()
+ '>';
typename dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(chemistryTabulationMethodName);
dictionaryConstructorTablePtr_->find(methodTypeName);
if (cstrIter == dictionaryConstructorTablePtr_->end())
{
FatalErrorInFunction
<< "Unknown chemistryTabulationMethodType type "
<< chemistryTabulationMethodName
<< endl << endl
<< "Valid chemistryTabulationMethodType types are :" << endl
<< dictionaryConstructorTablePtr_->toc()
<< exit(FatalError);
<< "Unknown " << typeName_() << " type " << methodName << endl
<< endl;
const wordList names(dictionaryConstructorTablePtr_->toc());
wordList thisCmpts;
thisCmpts.append(word::null);
thisCmpts.append(CompType::typeName);
thisCmpts.append
(
basicThermo::splitThermoName(ThermoType::typeName(), 5)
);
wordList validNames;
forAll(names, i)
{
const wordList cmpts(basicThermo::splitThermoName(names[i], 7));
bool isValid = true;
for (label i = 1; i < cmpts.size() && isValid; ++ i)
{
isValid = isValid && cmpts[i] == thisCmpts[i];
}
if (isValid)
{
validNames.append(cmpts[0]);
}
}
FatalErrorInFunction
<< "Valid " << typeName_() << " types for this thermodynamic model "
<< "are:" << endl << validNames << endl;
List<wordList> validCmpts;
validCmpts.append(wordList(7, word::null));
validCmpts[0][0] = typeName_();
validCmpts[0][1] = "reactionThermo";
validCmpts[0][2] = "transport";
validCmpts[0][3] = "thermo";
validCmpts[0][4] = "equationOfState";
validCmpts[0][5] = "specie";
validCmpts[0][6] = "energy";
forAll(names, i)
{
validCmpts.append(basicThermo::splitThermoName(names[i], 7));
}
FatalErrorInFunction
<< "All " << validCmpts[0][0] << '/' << validCmpts[0][1]
<< "/thermoPhysics combinations are:" << endl << endl;
printTable(validCmpts, FatalErrorInFunction);
FatalErrorInFunction << exit(FatalError);
}
return autoPtr<chemistryTabulationMethod<CompType, ThermoType>>
(
cstrIter()(dict, chemistry)
);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2016-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -27,74 +27,74 @@ License
#include "thermoPhysicsTypes.H"
#include "psiChemistryModel.H"
#include "rhoChemistryModel.H"
#include "psiReactionThermo.H"
#include "rhoReactionThermo.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Chemistry solvers based on sensibleEnthalpy
makeChemistryTabulationMethods(psiChemistryModel, constGasHThermoPhysics);
makeChemistryTabulationMethods(psiChemistryModel, gasHThermoPhysics);
makeChemistryTabulationMethods(psiReactionThermo, constGasHThermoPhysics);
makeChemistryTabulationMethods(psiReactionThermo, gasHThermoPhysics);
makeChemistryTabulationMethods
(
psiChemistryModel,
psiReactionThermo,
constIncompressibleGasHThermoPhysics
);
makeChemistryTabulationMethods
(
psiChemistryModel,
psiReactionThermo,
incompressibleGasHThermoPhysics
);
makeChemistryTabulationMethods(psiChemistryModel, icoPoly8HThermoPhysics);
makeChemistryTabulationMethods(psiReactionThermo, icoPoly8HThermoPhysics);
makeChemistryTabulationMethods(rhoChemistryModel, constGasHThermoPhysics);
makeChemistryTabulationMethods(rhoReactionThermo, constGasHThermoPhysics);
makeChemistryTabulationMethods(rhoChemistryModel, gasHThermoPhysics);
makeChemistryTabulationMethods(rhoReactionThermo, gasHThermoPhysics);
makeChemistryTabulationMethods
(
rhoChemistryModel,
rhoReactionThermo,
constIncompressibleGasHThermoPhysics
);
makeChemistryTabulationMethods
(
rhoChemistryModel,
rhoReactionThermo,
incompressibleGasHThermoPhysics
);
makeChemistryTabulationMethods(rhoChemistryModel, icoPoly8HThermoPhysics);
makeChemistryTabulationMethods(rhoReactionThermo, icoPoly8HThermoPhysics);
// Chemistry solvers based on sensibleInternalEnergy
makeChemistryTabulationMethods(psiChemistryModel, constGasEThermoPhysics);
makeChemistryTabulationMethods(psiReactionThermo, constGasEThermoPhysics);
makeChemistryTabulationMethods(psiChemistryModel, gasEThermoPhysics);
makeChemistryTabulationMethods(psiReactionThermo, gasEThermoPhysics);
makeChemistryTabulationMethods
(
psiChemistryModel,
psiReactionThermo,
constIncompressibleGasEThermoPhysics
);
makeChemistryTabulationMethods
(
psiChemistryModel,
psiReactionThermo,
incompressibleGasEThermoPhysics
);
makeChemistryTabulationMethods(psiChemistryModel, icoPoly8EThermoPhysics);
makeChemistryTabulationMethods(psiReactionThermo, icoPoly8EThermoPhysics);
makeChemistryTabulationMethods(rhoChemistryModel, constGasEThermoPhysics);
makeChemistryTabulationMethods(rhoReactionThermo, constGasEThermoPhysics);
makeChemistryTabulationMethods(rhoChemistryModel, gasEThermoPhysics);
makeChemistryTabulationMethods(rhoReactionThermo, gasEThermoPhysics);
makeChemistryTabulationMethods
(
rhoChemistryModel,
rhoReactionThermo,
constIncompressibleGasEThermoPhysics
);
makeChemistryTabulationMethods
(
rhoChemistryModel,
rhoReactionThermo,
incompressibleGasEThermoPhysics
);
makeChemistryTabulationMethods(rhoChemistryModel, icoPoly8EThermoPhysics);
makeChemistryTabulationMethods(rhoReactionThermo, icoPoly8EThermoPhysics);
}

View File

@ -57,7 +57,9 @@ License
defineTemplateTypeNameAndDebugWithName \
( \
chemistryTabulationMethod##CompChemModel##Thermo, \
"chemistryTabulationMethod<"#CompChemModel","#Thermo">", \
(word(chemistryTabulationMethod##CompChemModel##Thermo::typeName_()) + \
'<' + word(CompChemModel::typeName_()) + "," + Thermo::typeName() + '>'\
).c_str(), \
0 \
); \
\

View File

@ -47,153 +47,127 @@ Foam::autoPtr<ChemistryModel> Foam::basicChemistryModel::New
)
);
word chemistryTypeName;
if (chemistryDict.isDict("chemistryType"))
if (!chemistryDict.isDict("chemistryType"))
{
const dictionary& chemistryTypeDict
FatalErrorInFunction
<< "Template paramater based chemistry solver selection is no "
<< "longer supported. Please create a chemistryType dictionary"
<< "instead." << endl << endl << "For example, the entry:" << endl
<< " chemistrySolver ode<StandardChemistryModel<"
<< "rhoChemistryModel,sutherlandspecie<janaf<perfectGas>,"
<< "sensibleInternalEnergy>>" << endl << endl << "becomes:" << endl
<< " chemistryType" << endl << " {" << endl
<< " solver ode;" << endl << " method standard;"
<< endl << " }" << exit(FatalError);
}
const dictionary& chemistryTypeDict =
chemistryDict.subDict("chemistryType");
const word& solverName
(
chemistryTypeDict.found("solver")
? chemistryTypeDict.lookup("solver")
: chemistryTypeDict.found("chemistrySolver")
? chemistryTypeDict.lookup("chemistrySolver")
: chemistryTypeDict.lookup("solver") // error if neither entry is found
);
const word& methodName
(
chemistryTypeDict.lookupOrDefault<word>
(
chemistryDict.subDict("chemistryType")
);
"method",
chemistryTypeDict.lookupOrDefault<bool>("TDAC", false)
? "TDAC"
: "standard"
)
);
Info<< "Selecting chemistry type " << chemistryTypeDict << endl;
dictionary chemistryTypeDictNew;
chemistryTypeDictNew.add("solver", solverName);
chemistryTypeDictNew.add("method", methodName);
const int nCmpt = 8;
const char* cmptNames[nCmpt] =
Info<< "Selecting chemistry solver " << chemistryTypeDictNew << endl;
typedef typename ChemistryModel::thermoConstructorTable cstrTableType;
cstrTableType* cstrTable = ChemistryModel::thermoConstructorTablePtr_;
const word chemSolverCompThermoName =
solverName + '<' + methodName + '<'
+ ChemistryModel::reactionThermo::typeName + ','
+ thermo.thermoName() + ">>";
typename cstrTableType::iterator cstrIter =
cstrTable->find(chemSolverCompThermoName);
if (cstrIter == cstrTable->end())
{
FatalErrorInFunction
<< "Unknown " << typeName_() << " type " << solverName << endl
<< endl;
const wordList names(cstrTable->toc());
wordList thisCmpts;
thisCmpts.append(word::null);
thisCmpts.append(word::null);
thisCmpts.append(ChemistryModel::reactionThermo::typeName);
thisCmpts.append(basicThermo::splitThermoName(thermo.thermoName(), 5));
List<wordList> validNames;
validNames.append(wordList(2, word::null));
validNames[0][0] = "solver";
validNames[0][1] = "method";
forAll(names, i)
{
"chemistrySolver",
"chemistryModel",
"chemistryThermo",
"transport",
"thermo",
"equationOfState",
"specie",
"energy"
};
const wordList cmpts(basicThermo::splitThermoName(names[i], 8));
IOdictionary thermoDict
(
IOobject
(
thermo.phasePropertyName(basicThermo::dictName),
thermo.db().time().constant(),
thermo.db(),
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE,
false
)
);
word thermoTypeName;
if (thermoDict.isDict("thermoType"))
{
const dictionary& thermoTypeDict(thermoDict.subDict("thermoType"));
thermoTypeName =
word(thermoTypeDict.lookup("transport")) + '<'
+ word(thermoTypeDict.lookup("thermo")) + '<'
+ word(thermoTypeDict.lookup("equationOfState")) + '<'
+ word(thermoTypeDict.lookup("specie")) + ">>,"
+ word(thermoTypeDict.lookup("energy")) + ">";
}
else
{
FatalIOErrorInFunction(thermoDict)
<< "thermoType is in the old format and must be upgraded"
<< exit(FatalIOError);
}
Switch isTDAC(chemistryTypeDict.lookupOrDefault("TDAC", false));
// Construct the name of the chemistry type from the components
if (isTDAC)
{
chemistryTypeName =
word(chemistryTypeDict.lookup("chemistrySolver")) + '<'
+ "TDACChemistryModel<"
+ word(chemistryTypeDict.lookup("chemistryThermo")) + ','
+ thermoTypeName + ">>";
}
else
{
chemistryTypeName =
word(chemistryTypeDict.lookup("chemistrySolver")) + '<'
+ "chemistryModel<"
+ word(chemistryTypeDict.lookup("chemistryThermo")) + ','
+ thermoTypeName + ">>";
}
typename ChemistryModel::thermoConstructorTable::iterator cstrIter =
ChemistryModel::thermoConstructorTablePtr_->find(chemistryTypeName);
if (cstrIter == ChemistryModel::thermoConstructorTablePtr_->end())
{
FatalErrorInFunction
<< "Unknown " << ChemistryModel::typeName << " type " << nl
<< "chemistryType" << chemistryTypeDict << nl << nl
<< "Valid " << ChemistryModel::typeName << " types are:"
<< nl << nl;
// Get the list of all the suitable chemistry packages available
wordList validChemistryTypeNames
(
ChemistryModel::thermoConstructorTablePtr_->sortedToc()
);
// Build a table of the thermo packages constituent parts
// Note: row-0 contains the names of constituent parts
List<wordList> validChemistryTypeNameCmpts
(
validChemistryTypeNames.size() + 1
);
validChemistryTypeNameCmpts[0].setSize(nCmpt);
forAll(validChemistryTypeNameCmpts[0], j)
bool isValid = true;
for (label i = 2; i < cmpts.size() && isValid; ++ i)
{
validChemistryTypeNameCmpts[0][j] = cmptNames[j];
isValid = isValid && cmpts[i] == thisCmpts[i];
}
// Split the thermo package names into their constituent parts
forAll(validChemistryTypeNames, i)
if (isValid)
{
validChemistryTypeNameCmpts[i+1] = basicThermo::splitThermoName
(
validChemistryTypeNames[i],
nCmpt
);
validNames.append(SubList<word>(cmpts, 2));
}
// Print the table of available packages
// in terms of their constituent parts
printTable(validChemistryTypeNameCmpts, FatalError);
FatalError<< exit(FatalError);
}
return autoPtr<ChemistryModel>(cstrIter()(thermo));
}
else
{
chemistryTypeName =
word(chemistryDict.lookup("chemistryType"));
FatalErrorInFunction
<< "All " << validNames[0][0] << '/' << validNames[0][1]
<< "combinations for this thermodynamic model are:"
<< endl << endl;
printTable(validNames, FatalErrorInFunction);
Info<< "Selecting chemistry type " << chemistryTypeName << endl;
FatalErrorInFunction << endl;
typename ChemistryModel::thermoConstructorTable::iterator cstrIter =
ChemistryModel::thermoConstructorTablePtr_->find(chemistryTypeName);
if (cstrIter == ChemistryModel::thermoConstructorTablePtr_->end())
List<wordList> validCmpts;
validCmpts.append(wordList(8, word::null));
validCmpts[0][0] = "solver";
validCmpts[0][1] = "method";
validCmpts[0][2] = "reactionThermo";
validCmpts[0][3] = "transport";
validCmpts[0][4] = "thermo";
validCmpts[0][5] = "equationOfState";
validCmpts[0][6] = "specie";
validCmpts[0][7] = "energy";
forAll(names, i)
{
FatalErrorInFunction
<< "Unknown " << ChemistryModel::typeName << " type "
<< chemistryTypeName << nl << nl
<< "Valid ChemistryModel types are:" << nl
<< ChemistryModel::thermoConstructorTablePtr_->sortedToc() << nl
<< exit(FatalError);
validCmpts.append(basicThermo::splitThermoName(names[i], 8));
}
return autoPtr<ChemistryModel>(cstrIter()(thermo));
FatalErrorInFunction
<< "All " << validCmpts[0][0] << '/' << validCmpts[0][1] << '/'
<< validCmpts[0][2] << "/thermoPhysics combinations are:"
<< endl << endl;
printTable(validCmpts, FatalErrorInFunction);
FatalErrorInFunction << exit(FatalError);
}
return autoPtr<ChemistryModel>(cstrIter()(thermo));
}
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -39,7 +39,25 @@ namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define makeChemistryModel(SS, Comp, Thermo) \
#define makeChemistryModel(Comp) \
\
typedef BasicChemistryModel<Comp> BasicChemistryModel##Comp; \
\
defineTemplateTypeNameAndDebugWithName \
( \
BasicChemistryModel##Comp, \
"BasicChemistryModel<"#Comp">", \
0 \
); \
\
defineTemplateRunTimeSelectionTable \
( \
BasicChemistryModel##Comp, \
thermo \
);
#define makeChemistryModelType(SS, Comp, Thermo) \
\
typedef SS<Comp, Thermo> SS##Comp##Thermo; \
\

View File

@ -1,135 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::psiChemistryModel
Description
Chemistry model for compressibility-based thermodynamics
SourceFiles
psiChemistryModelI.H
psiChemistryModel.C
newChemistryModel.C
\*---------------------------------------------------------------------------*/
#ifndef psiChemistryModel_H
#define psiChemistryModel_H
#include "basicChemistryModel.H"
#include "autoPtr.H"
#include "runTimeSelectionTables.H"
#include "psiReactionThermo.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward declaration of classes
class fvMesh;
/*---------------------------------------------------------------------------*\
class psiChemistryModel Declaration
\*---------------------------------------------------------------------------*/
class psiChemistryModel
:
public basicChemistryModel
{
// Private Member Functions
//- Construct as copy (not implemented)
psiChemistryModel(const psiChemistryModel&);
//- Disallow default bitwise assignment
void operator=(const psiChemistryModel&);
protected:
// Protected data
//- Thermo
psiReactionThermo& thermo_;
public:
//- Runtime type information
TypeName("psi");
//- Thermo type
typedef psiReactionThermo reactionThermo;
//- Declare run-time constructor selection tables
declareRunTimeSelectionTable
(
autoPtr,
psiChemistryModel,
thermo,
(psiReactionThermo& thermo),
(thermo)
);
// Constructors
//- Construct from thermo
psiChemistryModel(psiReactionThermo& thermo);
//- Selector
static autoPtr<psiChemistryModel> New(psiReactionThermo& thermo);
//- Destructor
virtual ~psiChemistryModel();
// Member Functions
//- Return access to the thermo package
inline psiReactionThermo& thermo();
//- Return const access to the thermo package
inline const psiReactionThermo& thermo() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "psiChemistryModelI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,189 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
InClass
Foam::psiChemistryModel
Description
Creates chemistry model instances templated on the type of thermodynamics
\*---------------------------------------------------------------------------*/
#include "makeChemistryModel.H"
#include "psiChemistryModel.H"
#include "chemistryModel.H"
#include "TDACChemistryModel.H"
#include "thermoPhysicsTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Chemistry moldels based on sensibleEnthalpy
makeChemistryModel
(
chemistryModel,
psiChemistryModel,
constGasHThermoPhysics
);
makeChemistryModel
(
chemistryModel,
psiChemistryModel,
gasHThermoPhysics
);
makeChemistryModel
(
chemistryModel,
psiChemistryModel,
constIncompressibleGasHThermoPhysics
);
makeChemistryModel
(
chemistryModel,
psiChemistryModel,
incompressibleGasHThermoPhysics
);
makeChemistryModel
(
chemistryModel,
psiChemistryModel,
icoPoly8HThermoPhysics
);
makeChemistryModel
(
TDACChemistryModel,
psiChemistryModel,
constGasHThermoPhysics
);
makeChemistryModel
(
TDACChemistryModel,
psiChemistryModel,
gasHThermoPhysics
);
makeChemistryModel
(
TDACChemistryModel,
psiChemistryModel,
constIncompressibleGasHThermoPhysics
);
makeChemistryModel
(
TDACChemistryModel,
psiChemistryModel,
incompressibleGasHThermoPhysics
);
makeChemistryModel
(
TDACChemistryModel,
psiChemistryModel,
icoPoly8HThermoPhysics
);
// Chemistry moldels based on sensibleInternalEnergy
makeChemistryModel
(
chemistryModel,
psiChemistryModel,
constGasEThermoPhysics
);
makeChemistryModel
(
chemistryModel,
psiChemistryModel,
gasEThermoPhysics
);
makeChemistryModel
(
chemistryModel,
psiChemistryModel,
constIncompressibleGasEThermoPhysics
);
makeChemistryModel
(
chemistryModel,
psiChemistryModel,
incompressibleGasEThermoPhysics
);
makeChemistryModel
(
chemistryModel,
psiChemistryModel,
icoPoly8EThermoPhysics
);
makeChemistryModel
(
TDACChemistryModel,
psiChemistryModel,
constGasEThermoPhysics
);
makeChemistryModel
(
TDACChemistryModel,
psiChemistryModel,
gasEThermoPhysics
);
makeChemistryModel
(
TDACChemistryModel,
psiChemistryModel,
constIncompressibleGasEThermoPhysics
);
makeChemistryModel
(
TDACChemistryModel,
psiChemistryModel,
incompressibleGasEThermoPhysics
);
makeChemistryModel
(
TDACChemistryModel,
psiChemistryModel,
icoPoly8EThermoPhysics
);
}
// ************************************************************************* //

View File

@ -1,64 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "rhoChemistryModel.H"
#include "fvMesh.H"
/* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */
namespace Foam
{
defineTypeNameAndDebug(rhoChemistryModel, 0);
defineRunTimeSelectionTable(rhoChemistryModel, thermo);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::rhoChemistryModel::rhoChemistryModel(rhoReactionThermo& thermo)
:
basicChemistryModel(thermo),
thermo_(thermo)
{}
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::rhoChemistryModel> Foam::rhoChemistryModel::New
(
rhoReactionThermo& thermo
)
{
return basicChemistryModel::New<rhoChemistryModel>(thermo);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::rhoChemistryModel::~rhoChemistryModel()
{}
// ************************************************************************* //

View File

@ -1,189 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
InClass
Foam::rhoChemistryModel
Description
Creates chemistry model instances templated on the type of thermodynamics
\*---------------------------------------------------------------------------*/
#include "makeChemistryModel.H"
#include "rhoChemistryModel.H"
#include "chemistryModel.H"
#include "TDACChemistryModel.H"
#include "thermoPhysicsTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Chemistry moldels based on sensibleEnthalpy
makeChemistryModel
(
chemistryModel,
rhoChemistryModel,
constGasHThermoPhysics
);
makeChemistryModel
(
chemistryModel,
rhoChemistryModel,
gasHThermoPhysics
);
makeChemistryModel
(
chemistryModel,
rhoChemistryModel,
constIncompressibleGasHThermoPhysics
);
makeChemistryModel
(
chemistryModel,
rhoChemistryModel,
incompressibleGasHThermoPhysics
);
makeChemistryModel
(
chemistryModel,
rhoChemistryModel,
icoPoly8HThermoPhysics
);
makeChemistryModel
(
TDACChemistryModel,
rhoChemistryModel,
constGasHThermoPhysics
);
makeChemistryModel
(
TDACChemistryModel,
rhoChemistryModel,
gasHThermoPhysics
);
makeChemistryModel
(
TDACChemistryModel,
rhoChemistryModel,
constIncompressibleGasHThermoPhysics
);
makeChemistryModel
(
TDACChemistryModel,
rhoChemistryModel,
incompressibleGasHThermoPhysics
);
makeChemistryModel
(
TDACChemistryModel,
rhoChemistryModel,
icoPoly8HThermoPhysics
);
// Chemistry moldels based on sensibleInternalEnergy
makeChemistryModel
(
chemistryModel,
rhoChemistryModel,
constGasEThermoPhysics
);
makeChemistryModel
(
chemistryModel,
rhoChemistryModel,
gasEThermoPhysics
);
makeChemistryModel
(
chemistryModel,
rhoChemistryModel,
constIncompressibleGasEThermoPhysics
);
makeChemistryModel
(
chemistryModel,
rhoChemistryModel,
incompressibleGasEThermoPhysics
);
makeChemistryModel
(
chemistryModel,
rhoChemistryModel,
icoPoly8EThermoPhysics
);
makeChemistryModel
(
TDACChemistryModel,
rhoChemistryModel,
constGasEThermoPhysics
);
makeChemistryModel
(
TDACChemistryModel,
rhoChemistryModel,
gasEThermoPhysics
);
makeChemistryModel
(
TDACChemistryModel,
rhoChemistryModel,
constIncompressibleGasEThermoPhysics
);
makeChemistryModel
(
TDACChemistryModel,
rhoChemistryModel,
incompressibleGasEThermoPhysics
);
makeChemistryModel
(
TDACChemistryModel,
rhoChemistryModel,
icoPoly8EThermoPhysics
);
}
// ************************************************************************* //

View File

@ -26,6 +26,7 @@ License
#include "EulerImplicit.H"
#include "addToRunTimeSelectionTable.H"
#include "simpleMatrix.H"
#include "Reaction.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -36,12 +36,16 @@ SourceFiles
#define EulerImplicit_H
#include "chemistrySolver.H"
#include "Switch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
template <class Type>
class simpleMatrix;
/*---------------------------------------------------------------------------*\
Class EulerImplicit Declaration
\*---------------------------------------------------------------------------*/

View File

@ -35,7 +35,6 @@ SourceFiles
#ifndef chemistrySolver_H
#define chemistrySolver_H
#include "chemistryModel.H"
#include "IOdictionary.H"
#include "scalarField.H"

View File

@ -28,7 +28,7 @@ License
#include "chemistrySolver.H"
#include "chemistryModel.H"
#include "StandardChemistryModel.H"
#include "TDACChemistryModel.H"
#include "noChemistrySolver.H"
@ -39,60 +39,57 @@ License
#define makeChemistrySolverType(SS, Comp, Thermo) \
\
typedef SS<chemistryModel<Comp, Thermo>> SS##Comp##Thermo; \
typedef SS<StandardChemistryModel<Comp, Thermo>> SS##Comp##Thermo; \
\
defineTemplateTypeNameAndDebugWithName \
( \
SS##Comp##Thermo, \
(#SS"<" + word(StandardChemistryModel<Comp, Thermo>::typeName_()) + "<"\
+ word(Comp::typeName_()) + "," + Thermo::typeName() + ">>").c_str(), \
0 \
); \
\
BasicChemistryModel<Comp>:: \
add##thermo##ConstructorToTable<SS##Comp##Thermo> \
add##SS##Comp##Thermo##thermo##ConstructorTo##BasicChemistryModel##Comp\
##Table_; \
\
typedef SS<TDACChemistryModel<Comp, Thermo>> TDAC##SS##Comp##Thermo; \
\
defineTemplateTypeNameAndDebugWithName \
( \
SS##Comp##Thermo, \
(#SS"<chemistryModel<" + word(Comp::typeName_()) \
+ "," + Thermo::typeName() + ">>").c_str(), \
TDAC##SS##Comp##Thermo, \
(#SS"<" + word(TDACChemistryModel<Comp, Thermo>::typeName_()) + "<" \
+ word(Comp::typeName_()) + "," + Thermo::typeName() + ">>").c_str(), \
0 \
); \
\
addToRunTimeSelectionTable \
( \
Comp, \
SS##Comp##Thermo, \
thermo \
); \
\
defineTemplateTypeNameAndDebugWithName \
( \
TDAC##SS##Comp##Thermo, \
(#SS"<TDACChemistryModel<" + word(Comp::typeName_()) \
+ "," + Thermo::typeName() + ">>").c_str(), \
0 \
); \
\
addToRunTimeSelectionTable \
( \
Comp, \
TDAC##SS##Comp##Thermo, \
thermo \
);
BasicChemistryModel<Comp>:: \
add##thermo##ConstructorToTable<TDAC##SS##Comp##Thermo> \
add##TDAC##SS##Comp##Thermo##thermo##ConstructorTo##BasicChemistryModel\
##Comp##Table_;
#define makeChemistrySolverTypes(CompChemModel,Thermo) \
#define makeChemistrySolverTypes(Comp, Thermo) \
\
makeChemistrySolverType \
( \
noChemistrySolver, \
CompChemModel, \
Comp, \
Thermo \
); \
\
makeChemistrySolverType \
( \
EulerImplicit, \
CompChemModel, \
Comp, \
Thermo \
); \
\
makeChemistrySolverType \
( \
ode, \
CompChemModel, \
Comp, \
Thermo \
); \

Some files were not shown because too many files have changed in this diff Show More