Thermodyamics: Add support for multiphase

Pass the phase-name through hierarchy
Add phase-name to variables
Split basicCombustionMixture
Update applications accordingly
This commit is contained in:
Henry
2015-02-18 21:21:22 +00:00
parent f86da34506
commit eeedf5a051
69 changed files with 851 additions and 453 deletions

View File

@ -10,7 +10,7 @@
SLGThermo slgThermo(mesh, thermo); SLGThermo slgThermo(mesh, thermo);
basicMultiComponentMixture& composition = thermo.composition(); basicSpecieMixture& composition = thermo.composition();
PtrList<volScalarField>& Y = composition.Y(); PtrList<volScalarField>& Y = composition.Y();
const word inertSpecie(thermo.lookup("inertSpecie")); const word inertSpecie(thermo.lookup("inertSpecie"));

View File

@ -10,7 +10,7 @@
SLGThermo slgThermo(mesh, thermo); SLGThermo slgThermo(mesh, thermo);
basicMultiComponentMixture& composition = thermo.composition(); basicSpecieMixture& composition = thermo.composition();
PtrList<volScalarField>& Y = composition.Y(); PtrList<volScalarField>& Y = composition.Y();
const word inertSpecie(thermo.lookup("inertSpecie")); const word inertSpecie(thermo.lookup("inertSpecie"));

View File

@ -10,7 +10,7 @@
SLGThermo slgThermo(mesh, thermo); SLGThermo slgThermo(mesh, thermo);
basicMultiComponentMixture& composition = thermo.composition(); basicSpecieMixture& composition = thermo.composition();
PtrList<volScalarField>& Y = composition.Y(); PtrList<volScalarField>& Y = composition.Y();
const word inertSpecie(thermo.lookup("inertSpecie")); const word inertSpecie(thermo.lookup("inertSpecie"));

View File

@ -10,7 +10,7 @@
SLGThermo slgThermo(mesh, thermo); SLGThermo slgThermo(mesh, thermo);
basicMultiComponentMixture& composition = thermo.composition(); basicSpecieMixture& composition = thermo.composition();
PtrList<volScalarField>& Y = composition.Y(); PtrList<volScalarField>& Y = composition.Y();
const word inertSpecie(thermo.lookup("inertSpecie")); const word inertSpecie(thermo.lookup("inertSpecie"));

View File

@ -10,7 +10,7 @@
SLGThermo slgThermo(mesh, thermo); SLGThermo slgThermo(mesh, thermo);
basicMultiComponentMixture& composition = thermo.composition(); basicSpecieMixture& composition = thermo.composition();
PtrList<volScalarField>& Y = composition.Y(); PtrList<volScalarField>& Y = composition.Y();
const word inertSpecie(thermo.lookup("inertSpecie")); const word inertSpecie(thermo.lookup("inertSpecie"));

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -85,7 +85,7 @@ const Foam::SLGThermo& Foam::CompositionModel<CloudType>::thermo() const
template<class CloudType> template<class CloudType>
const Foam::basicMultiComponentMixture& const Foam::basicSpecieMixture&
Foam::CompositionModel<CloudType>::carrier() const Foam::CompositionModel<CloudType>::carrier() const
{ {
return thermo_.carrier(); return thermo_.carrier();
@ -713,4 +713,3 @@ Foam::scalar Foam::CompositionModel<CloudType>::L
#include "CompositionModelNew.C" #include "CompositionModelNew.C"
// ************************************************************************* // // ************************************************************************* //

View File

@ -138,7 +138,7 @@ public:
// Composition lists // Composition lists
//- Return the carrier components (wrapper function) //- Return the carrier components (wrapper function)
const basicMultiComponentMixture& carrier() const; const basicSpecieMixture& carrier() const;
//- Return the global (additional) liquids //- Return the global (additional) liquids
const liquidMixtureProperties& liquids() const; const liquidMixtureProperties& liquids() const;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -53,10 +53,10 @@ Foam::SLGThermo::SLGThermo(const fvMesh& mesh, fluidThermo& thermo)
{ {
Info<< "Creating component thermo properties:" << endl; Info<< "Creating component thermo properties:" << endl;
if (isA<basicMultiComponentMixture>(thermo)) if (isA<basicSpecieMixture>(thermo))
{ {
basicMultiComponentMixture& mcThermo = basicSpecieMixture& mcThermo =
dynamic_cast<basicMultiComponentMixture&>(thermo); dynamic_cast<basicSpecieMixture&>(thermo);
carrier_ = &mcThermo; carrier_ = &mcThermo;
Info<< " multi-component carrier - " << mcThermo.species().size() Info<< " multi-component carrier - " << mcThermo.species().size()
@ -105,13 +105,13 @@ const Foam::fluidThermo& Foam::SLGThermo::thermo() const
} }
const Foam::basicMultiComponentMixture& Foam::SLGThermo::carrier() const const Foam::basicSpecieMixture& Foam::SLGThermo::carrier() const
{ {
if (carrier_ == NULL) if (carrier_ == NULL)
{ {
FatalErrorIn FatalErrorIn
( (
"const Foam::basicMultiComponentMixture& " "const Foam::basicSpecieMixture& "
"Foam::SLGThermo::carrier() const" "Foam::SLGThermo::carrier() const"
) << "carrier requested, but object is not allocated" ) << "carrier requested, but object is not allocated"
<< abort(FatalError); << abort(FatalError);

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -47,7 +47,7 @@ SourceFiles
#include "regIOobject.H" #include "regIOobject.H"
#include "fluidThermo.H" #include "fluidThermo.H"
#include "basicMultiComponentMixture.H" #include "basicSpecieMixture.H"
#include "liquidMixtureProperties.H" #include "liquidMixtureProperties.H"
#include "solidMixtureProperties.H" #include "solidMixtureProperties.H"
@ -70,7 +70,7 @@ class SLGThermo
fluidThermo& thermo_; fluidThermo& thermo_;
//- Reference to the multi-component carrier phase thermo //- Reference to the multi-component carrier phase thermo
basicMultiComponentMixture* carrier_; basicSpecieMixture* carrier_;
//- Additional liquid properties data //- Additional liquid properties data
autoPtr<liquidMixtureProperties> liquids_; autoPtr<liquidMixtureProperties> liquids_;
@ -102,7 +102,7 @@ public:
const fluidThermo& thermo() const; const fluidThermo& thermo() const;
//- Return reference to the gaseous components //- Return reference to the gaseous components
const basicMultiComponentMixture& carrier() const; const basicSpecieMixture& carrier() const;
//- Return reference to the global (additional) liquids //- Return reference to the global (additional) liquids
const liquidMixtureProperties& liquids() const; const liquidMixtureProperties& liquids() const;

View File

@ -89,7 +89,7 @@ Foam::heThermo<BasicThermo, MixtureType>::heThermo
) )
: :
BasicThermo(mesh, phaseName), BasicThermo(mesh, phaseName),
MixtureType(*this, mesh), MixtureType(*this, mesh, phaseName),
he_ he_
( (
@ -123,7 +123,7 @@ Foam::heThermo<BasicThermo, MixtureType>::heThermo
) )
: :
BasicThermo(mesh, dict, phaseName), BasicThermo(mesh, dict, phaseName),
MixtureType(*this, mesh), MixtureType(*this, mesh, phaseName),
he_ he_
( (

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -58,8 +58,8 @@ public:
// Constructors // Constructors
//- Construct from dictionary and mesh //- Construct from dictionary, mesh and phase name
basicMixture(const dictionary&, const fvMesh&) basicMixture(const dictionary&, const fvMesh&, const word&)
{} {}
}; };

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -26,21 +26,17 @@ License
#include "pureMixture.H" #include "pureMixture.H"
#include "fvMesh.H" #include "fvMesh.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class ThermoType> template<class ThermoType>
pureMixture<ThermoType>::pureMixture Foam::pureMixture<ThermoType>::pureMixture
( (
const dictionary& thermoDict, const dictionary& thermoDict,
const fvMesh& mesh const fvMesh& mesh,
const word& phaseName
) )
: :
basicMixture(thermoDict, mesh), basicMixture(thermoDict, mesh, phaseName),
mixture_(thermoDict.subDict("mixture")) mixture_(thermoDict.subDict("mixture"))
{} {}
@ -48,14 +44,10 @@ pureMixture<ThermoType>::pureMixture
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class ThermoType> template<class ThermoType>
void pureMixture<ThermoType>::read(const dictionary& thermoDict) void Foam::pureMixture<ThermoType>::read(const dictionary& thermoDict)
{ {
mixture_ = ThermoType(thermoDict.subDict("mixture")); mixture_ = ThermoType(thermoDict.subDict("mixture"));
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* // // ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -67,8 +67,8 @@ public:
// Constructors // Constructors
//- Construct from dictionary and mesh //- Construct from dictionary, mesh and phase name
pureMixture(const dictionary&, const fvMesh&); pureMixture(const dictionary&, const fvMesh&, const word&);
// Member functions // Member functions

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -44,13 +44,17 @@ void Foam::basicChemistryModel::correct()
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::basicChemistryModel::basicChemistryModel(const fvMesh& mesh) Foam::basicChemistryModel::basicChemistryModel
(
const fvMesh& mesh,
const word& phaseName
)
: :
IOdictionary IOdictionary
( (
IOobject IOobject
( (
"chemistryProperties", IOobject::groupName("chemistryProperties", phaseName),
mesh.time().constant(), mesh.time().constant(),
mesh, mesh,
IOobject::MUST_READ_IF_MODIFIED, IOobject::MUST_READ_IF_MODIFIED,
@ -64,7 +68,7 @@ Foam::basicChemistryModel::basicChemistryModel(const fvMesh& mesh)
( (
IOobject IOobject
( (
"deltaTChem", IOobject::groupName("deltaTChem", phaseName),
mesh.time().constant(), mesh.time().constant(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -104,14 +104,14 @@ public:
// Constructors // Constructors
//- Construct from mesh //- Construct from mesh
basicChemistryModel(const fvMesh& mesh); basicChemistryModel(const fvMesh& mesh, const word& phaseName);
// Selectors // Selectors
//- Generic New for each of the related chemistry model //- Generic New for each of the related chemistry model
template<class Thermo> template<class Thermo>
static autoPtr<Thermo> New(const fvMesh&); static autoPtr<Thermo> New(const fvMesh& mesh, const word& phaseName);
//- Destructor //- Destructor
@ -146,11 +146,11 @@ public:
const label i const label i
) = 0; ) = 0;
//- Return reaction rate of the specieI in reactionI //- Return reaction rate of the speciei in reactioni
virtual tmp<DimensionedField<scalar, volMesh> > calculateRR virtual tmp<DimensionedField<scalar, volMesh> > calculateRR
( (
const label reactionI, const label reactioni,
const label specieI const label speciei
) const = 0; ) const = 0;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -31,14 +31,15 @@ License
template<class ChemistryModel> template<class ChemistryModel>
Foam::autoPtr<ChemistryModel> Foam::basicChemistryModel::New Foam::autoPtr<ChemistryModel> Foam::basicChemistryModel::New
( (
const fvMesh& mesh const fvMesh& mesh,
const word& phaseName
) )
{ {
IOdictionary chemistryDict IOdictionary chemistryDict
( (
IOobject IOobject
( (
"chemistryProperties", IOobject::groupName("chemistryProperties", phaseName),
mesh.time().constant(), mesh.time().constant(),
mesh, mesh,
IOobject::MUST_READ, IOobject::MUST_READ,
@ -74,7 +75,7 @@ Foam::autoPtr<ChemistryModel> Foam::basicChemistryModel::New
( (
IOobject IOobject
( (
"thermophysicalProperties", IOobject::groupName("thermophysicalProperties", phaseName),
mesh.time().constant(), mesh.time().constant(),
mesh, mesh,
IOobject::MUST_READ_IF_MODIFIED, IOobject::MUST_READ_IF_MODIFIED,
@ -158,7 +159,7 @@ Foam::autoPtr<ChemistryModel> Foam::basicChemistryModel::New
FatalError<< exit(FatalError); FatalError<< exit(FatalError);
} }
return autoPtr<ChemistryModel>(cstrIter()(mesh)); return autoPtr<ChemistryModel>(cstrIter()(mesh, phaseName));
} }
else else
{ {
@ -180,7 +181,7 @@ Foam::autoPtr<ChemistryModel> Foam::basicChemistryModel::New
<< exit(FatalError); << exit(FatalError);
} }
return autoPtr<ChemistryModel>(cstrIter()(mesh)); return autoPtr<ChemistryModel>(cstrIter()(mesh, phaseName));
} }
} }

View File

@ -32,10 +32,11 @@ License
template<class CompType, class ThermoType> template<class CompType, class ThermoType>
Foam::chemistryModel<CompType, ThermoType>::chemistryModel Foam::chemistryModel<CompType, ThermoType>::chemistryModel
( (
const fvMesh& mesh const fvMesh& mesh,
const word& phaseName
) )
: :
CompType(mesh), CompType(mesh, phaseName),
ODESystem(), ODESystem(),
Y_(this->thermo().composition().Y()), Y_(this->thermo().composition().Y()),
reactions_ reactions_
@ -632,7 +633,7 @@ Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh> >
Foam::chemistryModel<CompType, ThermoType>::calculateRR Foam::chemistryModel<CompType, ThermoType>::calculateRR
( (
const label reactionI, const label reactionI,
const label specieI const label speciei
) const ) const
{ {
scalar pf, cf, pr, cr; scalar pf, cf, pr, cr;
@ -701,7 +702,7 @@ Foam::chemistryModel<CompType, ThermoType>::calculateRR
rRef rRef
); );
RR[celli] = w*specieThermo_[specieI].W(); RR[celli] = w*specieThermo_[speciei].W();
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -117,7 +117,7 @@ public:
// Constructors // Constructors
//- Construct from mesh //- Construct from mesh
chemistryModel(const fvMesh& mesh); chemistryModel(const fvMesh& mesh, const word& phaseName);
//- Destructor //- Destructor
@ -198,11 +198,11 @@ public:
const label i const label i
); );
//- Return reaction rate of the specieI in reactionI //- Return reaction rate of the speciei in reactionI
virtual tmp<DimensionedField<scalar, volMesh> > calculateRR virtual tmp<DimensionedField<scalar, volMesh> > calculateRR
( (
const label reactionI, const label reactionI,
const label specieI const label speciei
) const; ) const;
//- Solve the reaction system for the given time step //- Solve the reaction system for the given time step

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -39,11 +39,12 @@ namespace Foam
Foam::psiChemistryModel::psiChemistryModel Foam::psiChemistryModel::psiChemistryModel
( (
const fvMesh& mesh const fvMesh& mesh,
const word& phaseName
) )
: :
basicChemistryModel(mesh), basicChemistryModel(mesh, phaseName),
thermo_(psiReactionThermo::New(mesh)) thermo_(psiReactionThermo::New(mesh, phaseName))
{} {}
@ -51,10 +52,11 @@ Foam::psiChemistryModel::psiChemistryModel
Foam::autoPtr<Foam::psiChemistryModel> Foam::psiChemistryModel::New Foam::autoPtr<Foam::psiChemistryModel> Foam::psiChemistryModel::New
( (
const fvMesh& mesh const fvMesh& mesh,
const word& phaseName
) )
{ {
return basicChemistryModel::New<psiChemistryModel>(mesh); return basicChemistryModel::New<psiChemistryModel>(mesh, phaseName);
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -87,19 +87,23 @@ public:
autoPtr, autoPtr,
psiChemistryModel, psiChemistryModel,
fvMesh, fvMesh,
(const fvMesh& mesh), (const fvMesh& mesh, const word& phaseName),
(mesh) (mesh, phaseName)
); );
// Constructors // Constructors
//- Construct from mesh //- Construct from mesh and phase name
psiChemistryModel(const fvMesh& mesh); psiChemistryModel(const fvMesh& mesh, const word& phaseName);
//- Selector //- Selector
static autoPtr<psiChemistryModel> New(const fvMesh& mesh); static autoPtr<psiChemistryModel> New
(
const fvMesh& mesh,
const word& phaseName=word::null
);
//- Destructor //- Destructor

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -39,11 +39,12 @@ namespace Foam
Foam::rhoChemistryModel::rhoChemistryModel Foam::rhoChemistryModel::rhoChemistryModel
( (
const fvMesh& mesh const fvMesh& mesh,
const word& phaseName
) )
: :
basicChemistryModel(mesh), basicChemistryModel(mesh, phaseName),
thermo_(rhoReactionThermo::New(mesh)) thermo_(rhoReactionThermo::New(mesh, phaseName))
{} {}
@ -51,10 +52,11 @@ Foam::rhoChemistryModel::rhoChemistryModel
Foam::autoPtr<Foam::rhoChemistryModel> Foam::rhoChemistryModel::New Foam::autoPtr<Foam::rhoChemistryModel> Foam::rhoChemistryModel::New
( (
const fvMesh& mesh const fvMesh& mesh,
const word& phaseName
) )
{ {
return basicChemistryModel::New<rhoChemistryModel>(mesh); return basicChemistryModel::New<rhoChemistryModel>(mesh, phaseName);
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -87,21 +87,23 @@ public:
autoPtr, autoPtr,
rhoChemistryModel, rhoChemistryModel,
fvMesh, fvMesh,
( (const fvMesh& mesh, const word& phaseName),
const fvMesh& mesh (mesh, phaseName)
),
(mesh)
); );
// Constructors // Constructors
//- Construct from mesh //- Construct from mesh and phase name
rhoChemistryModel(const fvMesh& mesh); rhoChemistryModel(const fvMesh& mesh, const word& phaseName);
//- Selector //- Selector
static autoPtr<rhoChemistryModel> New(const fvMesh& mesh); static autoPtr<rhoChemistryModel> New
(
const fvMesh& mesh,
const word& phaseName=word::null
);
//- Destructor //- Destructor

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -32,10 +32,11 @@ License
template<class ChemistryModel> template<class ChemistryModel>
Foam::EulerImplicit<ChemistryModel>::EulerImplicit Foam::EulerImplicit<ChemistryModel>::EulerImplicit
( (
const fvMesh& mesh const fvMesh& mesh,
const word& phaseName
) )
: :
chemistrySolver<ChemistryModel>(mesh), chemistrySolver<ChemistryModel>(mesh, phaseName),
coeffsDict_(this->subDict("EulerImplicitCoeffs")), coeffsDict_(this->subDict("EulerImplicitCoeffs")),
cTauChem_(readScalar(coeffsDict_.lookup("cTauChem"))), cTauChem_(readScalar(coeffsDict_.lookup("cTauChem"))),
eqRateLimiter_(coeffsDict_.lookup("equilibriumRateLimiter")), eqRateLimiter_(coeffsDict_.lookup("equilibriumRateLimiter")),

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -77,8 +77,8 @@ public:
// Constructors // Constructors
//- Construct from mesh //- Construct from mesh and phase name
EulerImplicit(const fvMesh& mesh); EulerImplicit(const fvMesh& mesh, const word& phaseName);
//- Destructor //- Destructor

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -30,10 +30,11 @@ License
template<class ChemistryModel> template<class ChemistryModel>
Foam::chemistrySolver<ChemistryModel>::chemistrySolver Foam::chemistrySolver<ChemistryModel>::chemistrySolver
( (
const fvMesh& mesh const fvMesh& mesh,
const word& phaseName
) )
: :
ChemistryModel(mesh) ChemistryModel(mesh, phaseName)
{} {}

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -58,8 +58,8 @@ public:
// Constructors // Constructors
//- Construct from components //- Construct from components and phase name
chemistrySolver(const fvMesh& mesh); chemistrySolver(const fvMesh& mesh, const word& phaseName);
//- Destructor //- Destructor

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -31,10 +31,11 @@ License
template<class ChemistryModel> template<class ChemistryModel>
Foam::noChemistrySolver<ChemistryModel>::noChemistrySolver Foam::noChemistrySolver<ChemistryModel>::noChemistrySolver
( (
const fvMesh& mesh const fvMesh& mesh,
const word& phaseName
) )
: :
chemistrySolver<ChemistryModel>(mesh) chemistrySolver<ChemistryModel>(mesh, phaseName)
{} {}

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -61,8 +61,8 @@ public:
// Constructors // Constructors
//- Construct from components //- Construct from mesh and phase name
noChemistrySolver(const fvMesh& mesh); noChemistrySolver(const fvMesh& mesh, const word& phaseName);
//- Destructor //- Destructor

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -31,10 +31,11 @@ License
template<class ChemistryModel> template<class ChemistryModel>
Foam::ode<ChemistryModel>::ode Foam::ode<ChemistryModel>::ode
( (
const fvMesh& mesh const fvMesh& mesh,
const word& phaseName
) )
: :
chemistrySolver<ChemistryModel>(mesh), chemistrySolver<ChemistryModel>(mesh, phaseName),
coeffsDict_(this->subDict("odeCoeffs")), coeffsDict_(this->subDict("odeCoeffs")),
odeSolver_(ODESolver::New(*this, coeffsDict_)), odeSolver_(ODESolver::New(*this, coeffsDict_)),
cTp_(this->nEqns()) cTp_(this->nEqns())

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -69,8 +69,8 @@ public:
// Constructors // Constructors
//- Construct from mesh //- Construct from mesh and phase name
ode(const fvMesh& mesh); ode(const fvMesh& mesh, const word& phaseName);
//- Destructor //- Destructor

View File

@ -27,7 +27,7 @@ License
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "unitConversion.H" #include "unitConversion.H"
#include "zeroGradientFvPatchFields.H" #include "zeroGradientFvPatchFields.H"
#include "basicMultiComponentMixture.H" #include "basicSpecieMixture.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -64,7 +64,7 @@ Foam::radiation::greyMeanAbsorptionEmission::greyMeanAbsorptionEmission
EhrrCoeff_(readScalar(coeffsDict_.lookup("EhrrCoeff"))), EhrrCoeff_(readScalar(coeffsDict_.lookup("EhrrCoeff"))),
Yj_(nSpecies_) Yj_(nSpecies_)
{ {
if (!isA<basicMultiComponentMixture>(thermo_)) if (!isA<basicSpecieMixture>(thermo_))
{ {
FatalErrorIn FatalErrorIn
( (
@ -203,8 +203,8 @@ Foam::radiation::greyMeanAbsorptionEmission::~greyMeanAbsorptionEmission()
Foam::tmp<Foam::volScalarField> Foam::tmp<Foam::volScalarField>
Foam::radiation::greyMeanAbsorptionEmission::aCont(const label bandI) const Foam::radiation::greyMeanAbsorptionEmission::aCont(const label bandI) const
{ {
const basicMultiComponentMixture& mixture = const basicSpecieMixture& mixture =
dynamic_cast<const basicMultiComponentMixture&>(thermo_); dynamic_cast<const basicSpecieMixture&>(thermo_);
const volScalarField& T = thermo_.T(); const volScalarField& T = thermo_.T();
const volScalarField& p = thermo_.p(); const volScalarField& p = thermo_.p();

View File

@ -93,10 +93,10 @@ greyMeanSolidAbsorptionEmission
coeffsDict_((dict.subDict(typeName + "Coeffs"))), coeffsDict_((dict.subDict(typeName + "Coeffs"))),
thermo_(mesh.lookupObject<solidThermo>("thermophysicalProperties")), thermo_(mesh.lookupObject<solidThermo>("thermophysicalProperties")),
speciesNames_(0), speciesNames_(0),
mixture_(dynamic_cast<const basicMultiComponentMixture&>(thermo_)), mixture_(dynamic_cast<const basicSpecieMixture&>(thermo_)),
solidData_(mixture_.Y().size()) solidData_(mixture_.Y().size())
{ {
if (!isA<basicMultiComponentMixture>(thermo_)) if (!isA<basicSpecieMixture>(thermo_))
{ {
FatalErrorIn FatalErrorIn
( (

View File

@ -51,7 +51,7 @@ SourceFiles
#include "absorptionEmissionModel.H" #include "absorptionEmissionModel.H"
#include "solidThermo.H" #include "solidThermo.H"
#include "basicMultiComponentMixture.H" #include "basicSpecieMixture.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -90,7 +90,7 @@ private:
HashTable<label> speciesNames_; HashTable<label> speciesNames_;
//- Basic multicomponent mixture //- Basic multicomponent mixture
const basicMultiComponentMixture& mixture_; const basicSpecieMixture& mixture_;
//- List of solid species data //- List of solid species data
List<FixedList<scalar, 2> > solidData_; List<FixedList<scalar, 2> > solidData_;

View File

@ -109,8 +109,8 @@ Foam::radiation::mixtureFractionSoot<ThermoType>::mixtureFractionSoot
scalar totalMol = 0.0; scalar totalMol = 0.0;
forAll(reaction.rhs(), i) forAll(reaction.rhs(), i)
{ {
label specieI = reaction.rhs()[i].index; label speciei = reaction.rhs()[i].index;
totalMol += mag(specieStoichCoeffs[specieI]); totalMol += mag(specieStoichCoeffs[speciei]);
} }
totalMol += nuSoot_; totalMol += nuSoot_;
@ -120,9 +120,9 @@ Foam::radiation::mixtureFractionSoot<ThermoType>::mixtureFractionSoot
scalar Wm = 0.0; scalar Wm = 0.0;
forAll(reaction.rhs(), i) forAll(reaction.rhs(), i)
{ {
const label specieI = reaction.rhs()[i].index; const label speciei = reaction.rhs()[i].index;
Xi[i] = mag(specieStoichCoeffs[specieI])/totalMol; Xi[i] = mag(specieStoichCoeffs[speciei])/totalMol;
Wm += Xi[i]*mixture_.speciesData()[specieI].W(); Wm += Xi[i]*mixture_.speciesData()[speciei].W();
} }
const scalar XSoot = nuSoot_/totalMol; const scalar XSoot = nuSoot_/totalMol;

View File

@ -3,6 +3,8 @@ chemistryReaders/chemkinReader/chemkinLexer.L
chemistryReaders/chemistryReader/makeChemistryReaders.C chemistryReaders/chemistryReader/makeChemistryReaders.C
mixtures/basicMultiComponentMixture/basicMultiComponentMixture.C mixtures/basicMultiComponentMixture/basicMultiComponentMixture.C
mixtures/basicSpecieMixture/basicSpecieMixture.C
mixtures/basicCombustionMixture/basicCombustionMixture.C
psiReactionThermo/psiReactionThermo.C psiReactionThermo/psiReactionThermo.C
psiReactionThermo/psiReactionThermos.C psiReactionThermo/psiReactionThermos.C

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -26,19 +26,22 @@ License
#include "SpecieMixture.H" #include "SpecieMixture.H"
#include "fvMesh.H" #include "fvMesh.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class MixtureType> template<class MixtureType>
Foam::SpecieMixture<MixtureType>::SpecieMixture Foam::SpecieMixture<MixtureType>::SpecieMixture
( (
const dictionary& thermoDict, const dictionary& thermoDict,
const fvMesh& mesh const fvMesh& mesh,
const word& phaseName
) )
: :
MixtureType MixtureType
( (
thermoDict, thermoDict,
mesh mesh,
phaseName
) )
{} {}

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -61,8 +61,8 @@ public:
// Constructors // Constructors
//- Construct from dictionary and mesh //- Construct from dictionary, mesh and phase name
SpecieMixture(const dictionary&, const fvMesh&); SpecieMixture(const dictionary&, const fvMesh&, const word& phaseName);
//- Destructor //- Destructor
@ -74,10 +74,10 @@ public:
// Per specie properties // Per specie properties
//- Number of moles [] //- Number of moles of the given specie []
virtual scalar nMoles(const label speciei) const; virtual scalar nMoles(const label speciei) const;
//- Molecular weight [kg/kmol] //- Molecular weight of the given specie [kg/kmol]
virtual scalar W(const label speciei) const; virtual scalar W(const label speciei) const;
@ -180,7 +180,7 @@ public:
//- Density [kg/m3] //- Density [kg/m3]
virtual scalar rho virtual scalar rho
( (
const label specieI, const label speciei,
const scalar p, const scalar p,
const scalar T const scalar T
) const; ) const;

View File

@ -0,0 +1,50 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014-2015 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 "basicCombustionMixture.H"
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(basicCombustionMixture, 0);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::basicCombustionMixture::basicCombustionMixture
(
const dictionary& thermoDict,
const wordList& specieNames,
const fvMesh& mesh,
const word& phaseName
)
:
basicSpecieMixture(thermoDict, specieNames, mesh, phaseName)
{}
// ************************************************************************* //

View File

@ -0,0 +1,105 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014-2015 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::basicCombustionMixture
Description
Specialization of the basicSpecieMixture for combustion.
SourceFiles
basicCombustionMixture.C
\*---------------------------------------------------------------------------*/
#ifndef basicCombustionMixture_H
#define basicCombustionMixture_H
#include "basicSpecieMixture.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class basicCombustionMixture Declaration
\*---------------------------------------------------------------------------*/
class basicCombustionMixture
:
public basicSpecieMixture
{
public:
//- Run time type information
TypeName("basicCombustionMixture");
//- The base class of the mixture
typedef basicCombustionMixture basicMixtureType;
// Constructors
//- Construct from dictionary, specie names, mesh and phase name
basicCombustionMixture
(
const dictionary&,
const wordList& specieNames,
const fvMesh&,
const word&
);
//- Destructor
virtual ~basicCombustionMixture()
{}
// Member functions
inline scalar fres(const scalar ft, const scalar stoicRatio) const;
inline tmp<volScalarField> fres
(
const volScalarField& ft,
const dimensionedScalar& stoicRatio
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "basicCombustionMixtureI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -23,15 +23,24 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "basicMixture.H" inline Foam::scalar Foam::basicCombustionMixture::fres
(
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // const scalar ft,
const scalar stoicRatio
namespace Foam ) const
{ {
return max(ft - (scalar(1) - ft)/stoicRatio, scalar(0));
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam inline Foam::tmp<Foam::volScalarField> Foam::basicCombustionMixture::fres
(
const volScalarField& ft,
const dimensionedScalar& stoicRatio
) const
{
return max(ft - (scalar(1) - ft)/stoicRatio.value(), scalar(0));
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -25,13 +25,22 @@ License
#include "basicMultiComponentMixture.H" #include "basicMultiComponentMixture.H"
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(basicMultiComponentMixture, 0);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::basicMultiComponentMixture::basicMultiComponentMixture Foam::basicMultiComponentMixture::basicMultiComponentMixture
( (
const dictionary& thermoDict, const dictionary& thermoDict,
const wordList& specieNames, const wordList& specieNames,
const fvMesh& mesh const fvMesh& mesh,
const word& phaseName
) )
: :
species_(specieNames), species_(specieNames),
@ -41,13 +50,13 @@ Foam::basicMultiComponentMixture::basicMultiComponentMixture
{ {
IOobject header IOobject header
( (
species_[i], IOobject::groupName(species_[i], phaseName),
mesh.time().timeName(), mesh.time().timeName(),
mesh, mesh,
IOobject::NO_READ IOobject::NO_READ
); );
// check if field exists and can be read // Check if field exists and can be read
if (header.headerOk()) if (header.headerOk())
{ {
Y_.set Y_.set
@ -57,7 +66,7 @@ Foam::basicMultiComponentMixture::basicMultiComponentMixture
( (
IOobject IOobject
( (
species_[i], IOobject::groupName(species_[i], phaseName),
mesh.time().timeName(), mesh.time().timeName(),
mesh, mesh,
IOobject::MUST_READ, IOobject::MUST_READ,
@ -89,7 +98,7 @@ Foam::basicMultiComponentMixture::basicMultiComponentMixture
( (
IOobject IOobject
( (
species_[i], IOobject::groupName(species_[i], phaseName),
mesh.time().timeName(), mesh.time().timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -25,8 +25,10 @@ Class
Foam::basicMultiComponentMixture Foam::basicMultiComponentMixture
Description Description
Multi-component mixture. Provides a list of mass fraction fields and helper Multi-component mixture.
functions to query mixture composition.
Provides a list of mass fraction fields and helper functions to
query mixture composition.
SourceFiles SourceFiles
basicMultiComponentMixture.C basicMultiComponentMixture.C
@ -39,6 +41,7 @@ SourceFiles
#include "volFields.H" #include "volFields.H"
#include "PtrList.H" #include "PtrList.H"
#include "speciesTable.H" #include "speciesTable.H"
#include "typeInfo.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -65,18 +68,23 @@ protected:
public: public:
//- Run time type information
TypeName("basicMultiComponentMixture");
//- The base class of the mixture //- The base class of the mixture
typedef basicMultiComponentMixture basicMixtureType; typedef basicMultiComponentMixture basicMixtureType;
// Constructors // Constructors
//- Construct from dictionary and mesh //- Construct from dictionary, species names, mesh and phase name
basicMultiComponentMixture basicMultiComponentMixture
( (
const dictionary&, const dictionary&,
const wordList& specieNames, const wordList& specieNames,
const fvMesh& const fvMesh&,
const word&
); );
@ -88,10 +96,7 @@ public:
// Member functions // Member functions
//- Return the table of species //- Return the table of species
const speciesTable& species() const inline const speciesTable& species() const;
{
return species_;
}
//- Return the mass-fraction fields //- Return the mass-fraction fields
inline PtrList<volScalarField>& Y(); inline PtrList<volScalarField>& Y();
@ -113,128 +118,6 @@ public:
//- Does the mixture include this specie? //- Does the mixture include this specie?
inline bool contains(const word& specieName) const; inline bool contains(const word& specieName) const;
inline scalar fres(const scalar ft, const scalar stoicRatio) const;
inline tmp<volScalarField> fres
(
const volScalarField& ft,
const dimensionedScalar& stoicRatio
) const;
// Per specie properties
//- Number of moles []
virtual scalar nMoles(const label specieI) const = 0;
//- Molecular weight [kg/kmol]
virtual scalar W(const label specieI) const = 0;
// Per specie thermo properties
//- Heat capacity at constant pressure [J/(kg K)]
virtual scalar Cp
(
const label specieI,
const scalar p,
const scalar T
) const = 0;
//- Heat capacity at constant volume [J/(kg K)]
virtual scalar Cv
(
const label specieI,
const scalar p,
const scalar T
) const = 0;
//- Absolute enthalpy [J/kg]
virtual scalar Ha
(
const label specieI,
const scalar p,
const scalar T
) const = 0;
//- Sensible enthalpy [J/kg]
virtual scalar Hs
(
const label specieI,
const scalar p,
const scalar T
) const = 0;
//- Chemical enthalpy [J/kg]
virtual scalar Hc(const label specieI) const = 0;
//- Entropy [J/(kg K)]
virtual scalar S
(
const label specieI,
const scalar p,
const scalar T
) const = 0;
//- Sensible internal energy [J/kg]
virtual scalar Es
(
const label specieI,
const scalar p,
const scalar T
) const = 0;
//- Gibbs free energy [J/kg]
virtual scalar G
(
const label specieI,
const scalar p,
const scalar T
) const = 0;
//- Helmholtz free energy [J/kg]
virtual scalar A
(
const label specieI,
const scalar p,
const scalar T
) const = 0;
// Per specie transport properties
//- Dynamic viscosity [kg/m/s]
virtual scalar mu
(
const label specieI,
const scalar p,
const scalar T
) const = 0;
//- Thermal conductivity [W/m/K]
virtual scalar kappa
(
const label specieI,
const scalar p,
const scalar T
) const = 0;
//- Thermal diffusivity of enthalpy [kg/m/s]
virtual scalar alphah
(
const label specieI,
const scalar p,
const scalar T
) const = 0;
//- Density [kg/m3]
virtual scalar rho
(
const label specieI,
const scalar p,
const scalar T
) const = 0;
}; };

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -23,6 +23,13 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
inline const Foam::speciesTable&
Foam::basicMultiComponentMixture::species() const
{
return species_;
}
inline Foam::PtrList<Foam::volScalarField>& inline Foam::PtrList<Foam::volScalarField>&
Foam::basicMultiComponentMixture::Y() Foam::basicMultiComponentMixture::Y()
{ {
@ -79,24 +86,4 @@ inline bool Foam::basicMultiComponentMixture::contains
} }
inline Foam::scalar Foam::basicMultiComponentMixture::fres
(
const scalar ft,
const scalar stoicRatio
) const
{
return max(ft - (1.0 - ft)/stoicRatio, 0.0);
}
inline Foam::tmp<Foam::volScalarField> Foam::basicMultiComponentMixture::fres
(
const volScalarField& ft,
const dimensionedScalar& stoicRatio
) const
{
return max(ft - (scalar(1) - ft)/stoicRatio.value(), scalar(0));
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -0,0 +1,84 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014-2015 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 "basicSpecieMixture.H"
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(basicSpecieMixture, 0);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::basicSpecieMixture::basicSpecieMixture
(
const dictionary& thermoDict,
const wordList& specieNames,
const fvMesh& mesh,
const word& phaseName
)
:
basicMultiComponentMixture(thermoDict, specieNames, mesh, phaseName)
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::basicSpecieMixture::W() const
{
const PtrList<volScalarField>& Y(basicMultiComponentMixture::Y());
tmp<volScalarField> trW
(
new volScalarField
(
IOobject
(
IOobject::groupName("W", Y[0].group()),
Y[0].time().timeName(),
Y[0].mesh()
),
Y[0].mesh(),
dimensionedScalar("zero", dimless, 0)
)
);
volScalarField& rW = trW();
forAll(Y, i)
{
rW += Y[i]/W(i);
}
rW = 1.0/rW;
return trW;
}
// ************************************************************************* //

View File

@ -0,0 +1,209 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014-2015 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::basicSpecieMixture
Description
Specialization of basicMultiComponentMixture for a mixture consisting
of a number for molecular species.
SourceFiles
basicSpecieMixture.C
\*---------------------------------------------------------------------------*/
#ifndef basicSpecieMixture_H
#define basicSpecieMixture_H
#include "basicMultiComponentMixture.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class basicSpecieMixture Declaration
\*---------------------------------------------------------------------------*/
class basicSpecieMixture
:
public basicMultiComponentMixture
{
public:
//- Run time type information
TypeName("basicSpecieMixture");
//- The base class of the mixture
typedef basicSpecieMixture basicMixtureType;
// Constructors
//- Construct from dictionary, species names, mesh and phase name
basicSpecieMixture
(
const dictionary&,
const wordList& specieNames,
const fvMesh&,
const word&
);
//- Destructor
virtual ~basicSpecieMixture()
{}
// Member functions
// Per specie properties
//- Number of moles of the given specie []
virtual scalar nMoles(const label speciei) const = 0;
//- Molecular weight of the given specie [kg/kmol]
virtual scalar W(const label speciei) const = 0;
//- Molecular weight of the mixture [kg/kmol]
tmp<volScalarField> W() const;
// Per specie thermo properties
//- Heat capacity at constant pressure [J/(kg K)]
virtual scalar Cp
(
const label speciei,
const scalar p,
const scalar T
) const = 0;
//- Heat capacity at constant volume [J/(kg K)]
virtual scalar Cv
(
const label speciei,
const scalar p,
const scalar T
) const = 0;
//- Absolute enthalpy [J/kg]
virtual scalar Ha
(
const label speciei,
const scalar p,
const scalar T
) const = 0;
//- Sensible enthalpy [J/kg]
virtual scalar Hs
(
const label speciei,
const scalar p,
const scalar T
) const = 0;
//- Chemical enthalpy [J/kg]
virtual scalar Hc(const label speciei) const = 0;
//- Entropy [J/(kg K)]
virtual scalar S
(
const label speciei,
const scalar p,
const scalar T
) const = 0;
//- Sensible internal energy [J/kg]
virtual scalar Es
(
const label speciei,
const scalar p,
const scalar T
) const = 0;
//- Gibbs free energy [J/kg]
virtual scalar G
(
const label speciei,
const scalar p,
const scalar T
) const = 0;
//- Helmholtz free energy [J/kg]
virtual scalar A
(
const label speciei,
const scalar p,
const scalar T
) const = 0;
// Per specie transport properties
//- Dynamic viscosity [kg/m/s]
virtual scalar mu
(
const label speciei,
const scalar p,
const scalar T
) const = 0;
//- Thermal conductivity [W/m/K]
virtual scalar kappa
(
const label speciei,
const scalar p,
const scalar T
) const = 0;
//- Thermal diffusivity of enthalpy [kg/m/s]
virtual scalar alphah
(
const label speciei,
const scalar p,
const scalar T
) const = 0;
//- Density [kg/m3]
virtual scalar rho
(
const label speciei,
const scalar p,
const scalar T
) const = 0;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -38,14 +38,16 @@ template<class ThermoType>
Foam::egrMixture<ThermoType>::egrMixture Foam::egrMixture<ThermoType>::egrMixture
( (
const dictionary& thermoDict, const dictionary& thermoDict,
const fvMesh& mesh const fvMesh& mesh,
const word& phaseName
) )
: :
basicMultiComponentMixture basicCombustionMixture
( (
thermoDict, thermoDict,
speciesTable(nSpecies_, specieNames_), speciesTable(nSpecies_, specieNames_),
mesh mesh,
phaseName
), ),
stoicRatio_(thermoDict.lookup("stoichiometricAirFuelMassRatio")), stoicRatio_(thermoDict.lookup("stoichiometricAirFuelMassRatio")),
@ -110,18 +112,18 @@ void Foam::egrMixture<ThermoType>::read(const dictionary& thermoDict)
template<class ThermoType> template<class ThermoType>
const ThermoType& Foam::egrMixture<ThermoType>::getLocalThermo const ThermoType& Foam::egrMixture<ThermoType>::getLocalThermo
( (
const label specieI const label speciei
) const ) const
{ {
if (specieI == 0) if (speciei == 0)
{ {
return fuel_; return fuel_;
} }
else if (specieI == 1) else if (speciei == 1)
{ {
return oxidant_; return oxidant_;
} }
else if (specieI == 2) else if (speciei == 2)
{ {
return products_; return products_;
} }
@ -133,7 +135,7 @@ const ThermoType& Foam::egrMixture<ThermoType>::getLocalThermo
"(" "("
"const label " "const label "
") const" ") const"
) << "Unknown specie index " << specieI << ". Valid indices are 0..2" ) << "Unknown specie index " << speciei << ". Valid indices are 0..2"
<< abort(FatalError); << abort(FatalError);
return fuel_; return fuel_;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -35,7 +35,7 @@ SourceFiles
#ifndef egrMixture_H #ifndef egrMixture_H
#define egrMixture_H #define egrMixture_H
#include "basicMultiComponentMixture.H" #include "basicCombustionMixture.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -49,7 +49,7 @@ namespace Foam
template<class ThermoType> template<class ThermoType>
class egrMixture class egrMixture
: :
public basicMultiComponentMixture public basicCombustionMixture
{ {
// Private data // Private data
@ -85,8 +85,8 @@ public:
// Constructors // Constructors
//- Construct from dictionary and mesh //- Construct from dictionary, mesh and phaseName
egrMixture(const dictionary&, const fvMesh&); egrMixture(const dictionary&, const fvMesh&, const word&);
//- Destructor //- Destructor
@ -169,7 +169,7 @@ public:
void read(const dictionary&); void read(const dictionary&);
//- Return thermo based on index //- Return thermo based on index
const ThermoType& getLocalThermo(const label specieI) const; const ThermoType& getLocalThermo(const label speciei) const;
}; };

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -38,14 +38,16 @@ template<class ThermoType>
Foam::homogeneousMixture<ThermoType>::homogeneousMixture Foam::homogeneousMixture<ThermoType>::homogeneousMixture
( (
const dictionary& thermoDict, const dictionary& thermoDict,
const fvMesh& mesh const fvMesh& mesh,
const word& phaseName
) )
: :
basicMultiComponentMixture basicCombustionMixture
( (
thermoDict, thermoDict,
speciesTable(nSpecies_, specieNames_), speciesTable(nSpecies_, specieNames_),
mesh mesh,
phaseName
), ),
reactants_(thermoDict.subDict("reactants")), reactants_(thermoDict.subDict("reactants")),
@ -92,14 +94,14 @@ void Foam::homogeneousMixture<ThermoType>::read(const dictionary& thermoDict)
template<class ThermoType> template<class ThermoType>
const ThermoType& Foam::homogeneousMixture<ThermoType>::getLocalThermo const ThermoType& Foam::homogeneousMixture<ThermoType>::getLocalThermo
( (
const label specieI const label speciei
) const ) const
{ {
if (specieI == 0) if (speciei == 0)
{ {
return reactants_; return reactants_;
} }
else if (specieI == 1) else if (speciei == 1)
{ {
return products_; return products_;
} }
@ -112,7 +114,7 @@ const ThermoType& Foam::homogeneousMixture<ThermoType>::getLocalThermo
"(" "("
"const label " "const label "
") const" ") const"
) << "Unknown specie index " << specieI << ". Valid indices are 0..1" ) << "Unknown specie index " << speciei << ". Valid indices are 0..1"
<< abort(FatalError); << abort(FatalError);
return reactants_; return reactants_;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -35,7 +35,7 @@ SourceFiles
#ifndef homogeneousMixture_H #ifndef homogeneousMixture_H
#define homogeneousMixture_H #define homogeneousMixture_H
#include "basicMultiComponentMixture.H" #include "basicCombustionMixture.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -49,7 +49,7 @@ namespace Foam
template<class ThermoType> template<class ThermoType>
class homogeneousMixture class homogeneousMixture
: :
public basicMultiComponentMixture public basicCombustionMixture
{ {
// Private data // Private data
@ -76,8 +76,8 @@ public:
// Constructors // Constructors
//- Construct from dictionary and mesh //- Construct from dictionary, mesh and phase name
homogeneousMixture(const dictionary&, const fvMesh&); homogeneousMixture(const dictionary&, const fvMesh&, const word&);
//- Destructor //- Destructor
@ -127,7 +127,7 @@ public:
void read(const dictionary&); void read(const dictionary&);
//- Return thermo based on index //- Return thermo based on index
const ThermoType& getLocalThermo(const label specieI) const; const ThermoType& getLocalThermo(const label speciei) const;
}; };

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -30,7 +30,10 @@ License
template<class ThermoType> template<class ThermoType>
const char* Foam::inhomogeneousMixture<ThermoType>::specieNames_[2] = const char* Foam::inhomogeneousMixture<ThermoType>::specieNames_[2] =
{"ft", "b"}; {
"ft",
"b"
};
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -39,14 +42,16 @@ template<class ThermoType>
Foam::inhomogeneousMixture<ThermoType>::inhomogeneousMixture Foam::inhomogeneousMixture<ThermoType>::inhomogeneousMixture
( (
const dictionary& thermoDict, const dictionary& thermoDict,
const fvMesh& mesh const fvMesh& mesh,
const word& phaseName
) )
: :
basicMultiComponentMixture basicCombustionMixture
( (
thermoDict, thermoDict,
speciesTable(nSpecies_, specieNames_), speciesTable(nSpecies_, specieNames_),
mesh mesh,
phaseName
), ),
stoicRatio_(thermoDict.lookup("stoichiometricAirFuelMassRatio")), stoicRatio_(thermoDict.lookup("stoichiometricAirFuelMassRatio")),
@ -104,18 +109,18 @@ void Foam::inhomogeneousMixture<ThermoType>::read(const dictionary& thermoDict)
template<class ThermoType> template<class ThermoType>
const ThermoType& Foam::inhomogeneousMixture<ThermoType>::getLocalThermo const ThermoType& Foam::inhomogeneousMixture<ThermoType>::getLocalThermo
( (
const label specieI const label speciei
) const ) const
{ {
if (specieI == 0) if (speciei == 0)
{ {
return fuel_; return fuel_;
} }
else if (specieI == 1) else if (speciei == 1)
{ {
return oxidant_; return oxidant_;
} }
else if (specieI == 2) else if (speciei == 2)
{ {
return products_; return products_;
} }
@ -128,7 +133,7 @@ const ThermoType& Foam::inhomogeneousMixture<ThermoType>::getLocalThermo
"(" "("
"const label " "const label "
") const" ") const"
) << "Unknown specie index " << specieI << ". Valid indices are 0..2" ) << "Unknown specie index " << speciei << ". Valid indices are 0..2"
<< abort(FatalError); << abort(FatalError);
return fuel_; return fuel_;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -35,7 +35,7 @@ SourceFiles
#ifndef inhomogeneousMixture_H #ifndef inhomogeneousMixture_H
#define inhomogeneousMixture_H #define inhomogeneousMixture_H
#include "basicMultiComponentMixture.H" #include "basicCombustionMixture.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -49,7 +49,7 @@ namespace Foam
template<class ThermoType> template<class ThermoType>
class inhomogeneousMixture class inhomogeneousMixture
: :
public basicMultiComponentMixture public basicCombustionMixture
{ {
// Private data // Private data
@ -82,8 +82,8 @@ public:
// Constructors // Constructors
//- Construct from dictionary and mesh //- Construct from dictionary, mesh and phase name
inhomogeneousMixture(const dictionary&, const fvMesh&); inhomogeneousMixture(const dictionary&, const fvMesh&, const word&);
//- Destructor //- Destructor
@ -158,7 +158,7 @@ public:
void read(const dictionary&); void read(const dictionary&);
//- Return thermo based on index //- Return thermo based on index
const ThermoType& getLocalThermo(const label specieI) const; const ThermoType& getLocalThermo(const label speciei) const;
}; };

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -83,10 +83,11 @@ Foam::multiComponentMixture<ThermoType>::multiComponentMixture
const dictionary& thermoDict, const dictionary& thermoDict,
const wordList& specieNames, const wordList& specieNames,
const HashPtrTable<ThermoType>& thermoData, const HashPtrTable<ThermoType>& thermoData,
const fvMesh& mesh const fvMesh& mesh,
const word& phaseName
) )
: :
basicMultiComponentMixture(thermoDict, specieNames, mesh), basicSpecieMixture(thermoDict, specieNames, mesh, phaseName),
speciesData_(species_.size()), speciesData_(species_.size()),
mixture_("mixture", *thermoData[specieNames[0]]), mixture_("mixture", *thermoData[specieNames[0]]),
mixtureVol_("volMixture", *thermoData[specieNames[0]]) mixtureVol_("volMixture", *thermoData[specieNames[0]])
@ -108,10 +109,17 @@ template<class ThermoType>
Foam::multiComponentMixture<ThermoType>::multiComponentMixture Foam::multiComponentMixture<ThermoType>::multiComponentMixture
( (
const dictionary& thermoDict, const dictionary& thermoDict,
const fvMesh& mesh const fvMesh& mesh,
const word& phaseName
) )
: :
basicMultiComponentMixture(thermoDict, thermoDict.lookup("species"), mesh), basicSpecieMixture
(
thermoDict,
thermoDict.lookup("species"),
mesh,
phaseName
),
speciesData_(species_.size()), speciesData_(species_.size()),
mixture_("mixture", constructSpeciesData(thermoDict)), mixture_("mixture", constructSpeciesData(thermoDict)),
mixtureVol_("volMixture", speciesData_[0]) mixtureVol_("volMixture", speciesData_[0])

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -35,7 +35,7 @@ SourceFiles
#ifndef multiComponentMixture_H #ifndef multiComponentMixture_H
#define multiComponentMixture_H #define multiComponentMixture_H
#include "basicMultiComponentMixture.H" #include "basicSpecieMixture.H"
#include "HashPtrTable.H" #include "HashPtrTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -50,7 +50,7 @@ namespace Foam
template<class ThermoType> template<class ThermoType>
class multiComponentMixture class multiComponentMixture
: :
public basicMultiComponentMixture public basicSpecieMixture
{ {
// Private data // Private data
@ -86,17 +86,19 @@ public:
// Constructors // Constructors
//- Construct from dictionary, specie names, thermo database and mesh //- Construct from dictionary, specie names, thermo database,
// mesh and phase name
multiComponentMixture multiComponentMixture
( (
const dictionary&, const dictionary&,
const wordList& specieNames, const wordList& specieNames,
const HashPtrTable<ThermoType>& thermoData, const HashPtrTable<ThermoType>& thermoData,
const fvMesh& const fvMesh&,
const word&
); );
//- Construct from dictionary and mesh //- Construct from dictionary, mesh and phase name
multiComponentMixture(const dictionary&, const fvMesh&); multiComponentMixture(const dictionary&, const fvMesh&, const word&);
//- Destructor //- Destructor

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -32,7 +32,8 @@ template<class ThermoType>
Foam::reactingMixture<ThermoType>::reactingMixture Foam::reactingMixture<ThermoType>::reactingMixture
( (
const dictionary& thermoDict, const dictionary& thermoDict,
const fvMesh& mesh const fvMesh& mesh,
const word& phaseName
) )
: :
speciesTable(), speciesTable(),
@ -45,7 +46,8 @@ Foam::reactingMixture<ThermoType>::reactingMixture
thermoDict, thermoDict,
*this, *this,
autoPtr<chemistryReader<ThermoType> >::operator()().speciesThermo(), autoPtr<chemistryReader<ThermoType> >::operator()().speciesThermo(),
mesh mesh,
phaseName
), ),
PtrList<Reaction<ThermoType> > PtrList<Reaction<ThermoType> >
( (

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -73,8 +73,8 @@ public:
// Constructors // Constructors
//- Construct from dictionary and mesh //- Construct from dictionary, mesh and phase name
reactingMixture(const dictionary&, const fvMesh&); reactingMixture(const dictionary&, const fvMesh&, const word&);
//- Destructor //- Destructor

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -36,19 +36,19 @@ void Foam::singleStepReactingMixture<ThermoType>::calculateqFuel()
forAll(reaction.lhs(), i) forAll(reaction.lhs(), i)
{ {
const label specieI = reaction.lhs()[i].index; const label speciei = reaction.lhs()[i].index;
const scalar stoichCoeff = reaction.lhs()[i].stoichCoeff; const scalar stoichCoeff = reaction.lhs()[i].stoichCoeff;
specieStoichCoeffs_[specieI] = -stoichCoeff; specieStoichCoeffs_[speciei] = -stoichCoeff;
qFuel_.value() += this->speciesData()[specieI].hc()*stoichCoeff/Wu; qFuel_.value() += this->speciesData()[speciei].hc()*stoichCoeff/Wu;
} }
forAll(reaction.rhs(), i) forAll(reaction.rhs(), i)
{ {
const label specieI = reaction.rhs()[i].index; const label speciei = reaction.rhs()[i].index;
const scalar stoichCoeff = reaction.rhs()[i].stoichCoeff; const scalar stoichCoeff = reaction.rhs()[i].stoichCoeff;
specieStoichCoeffs_[specieI] = stoichCoeff; specieStoichCoeffs_[speciei] = stoichCoeff;
qFuel_.value() -= this->speciesData()[specieI].hc()*stoichCoeff/Wu; qFuel_.value() -= this->speciesData()[speciei].hc()*stoichCoeff/Wu;
specieProd_[specieI] = -1; specieProd_[speciei] = -1;
} }
Info << "Fuel heat of combustion :" << qFuel_.value() << endl; Info << "Fuel heat of combustion :" << qFuel_.value() << endl;
@ -88,24 +88,24 @@ void Foam::singleStepReactingMixture<ThermoType>::calculateMaxProducts()
scalar totalMol = 0.0; scalar totalMol = 0.0;
forAll(reaction.rhs(), i) forAll(reaction.rhs(), i)
{ {
label specieI = reaction.rhs()[i].index; label speciei = reaction.rhs()[i].index;
totalMol += mag(specieStoichCoeffs_[specieI]); totalMol += mag(specieStoichCoeffs_[speciei]);
} }
scalarList Xi(reaction.rhs().size()); scalarList Xi(reaction.rhs().size());
forAll(reaction.rhs(), i) forAll(reaction.rhs(), i)
{ {
const label specieI = reaction.rhs()[i].index; const label speciei = reaction.rhs()[i].index;
Xi[i] = mag(specieStoichCoeffs_[specieI])/totalMol; Xi[i] = mag(specieStoichCoeffs_[speciei])/totalMol;
Wm += Xi[i]*this->speciesData()[specieI].W(); Wm += Xi[i]*this->speciesData()[speciei].W();
} }
forAll(reaction.rhs(), i) forAll(reaction.rhs(), i)
{ {
const label specieI = reaction.rhs()[i].index; const label speciei = reaction.rhs()[i].index;
Yprod0_[specieI] = this->speciesData()[specieI].W()/Wm*Xi[i]; Yprod0_[speciei] = this->speciesData()[speciei].W()/Wm*Xi[i];
} }
Info << "Maximum products mass concentrations:" << nl; Info << "Maximum products mass concentrations:" << nl;
@ -141,14 +141,14 @@ void Foam::singleStepReactingMixture<ThermoType>::fresCorrect()
// reactants // reactants
forAll(reaction.lhs(), i) forAll(reaction.lhs(), i)
{ {
const label specieI = reaction.lhs()[i].index; const label speciei = reaction.lhs()[i].index;
if (specieI == fuelIndex_) if (speciei == fuelIndex_)
{ {
fres_[specieI] = max(YFuel - YO2/s_, scalar(0.0)); fres_[speciei] = max(YFuel - YO2/s_, scalar(0.0));
} }
else if (specieI == O2Index) else if (speciei == O2Index)
{ {
fres_[specieI] = max(YO2 - YFuel*s_, scalar(0.0)); fres_[speciei] = max(YO2 - YFuel*s_, scalar(0.0));
} }
} }
@ -156,23 +156,23 @@ void Foam::singleStepReactingMixture<ThermoType>::fresCorrect()
// products // products
forAll(reaction.rhs(), i) forAll(reaction.rhs(), i)
{ {
const label specieI = reaction.rhs()[i].index; const label speciei = reaction.rhs()[i].index;
if (specieI != inertIndex_) if (speciei != inertIndex_)
{ {
forAll(fres_[specieI], cellI) forAll(fres_[speciei], cellI)
{ {
if (fres_[fuelIndex_][cellI] > 0.0) if (fres_[fuelIndex_][cellI] > 0.0)
{ {
// rich mixture // rich mixture
fres_[specieI][cellI] = fres_[speciei][cellI] =
Yprod0_[specieI] Yprod0_[speciei]
* (1.0 + YO2[cellI]/s_.value() - YFuel[cellI]); * (1.0 + YO2[cellI]/s_.value() - YFuel[cellI]);
} }
else else
{ {
// lean mixture // lean mixture
fres_[specieI][cellI] = fres_[speciei][cellI] =
Yprod0_[specieI] Yprod0_[speciei]
* ( * (
1.0 1.0
- YO2[cellI]/s_.value()*stoicRatio_.value() - YO2[cellI]/s_.value()*stoicRatio_.value()
@ -191,10 +191,11 @@ template<class ThermoType>
Foam::singleStepReactingMixture<ThermoType>::singleStepReactingMixture Foam::singleStepReactingMixture<ThermoType>::singleStepReactingMixture
( (
const dictionary& thermoDict, const dictionary& thermoDict,
const fvMesh& mesh const fvMesh& mesh,
const word& phaseName
) )
: :
reactingMixture<ThermoType>(thermoDict, mesh), reactingMixture<ThermoType>(thermoDict, mesh, phaseName),
stoicRatio_(dimensionedScalar("stoicRatio", dimless, 0.0)), stoicRatio_(dimensionedScalar("stoicRatio", dimless, 0.0)),
s_(dimensionedScalar("s", dimless, 0.0)), s_(dimensionedScalar("s", dimless, 0.0)),
qFuel_(dimensionedScalar("qFuel", sqr(dimVelocity), 0.0)), qFuel_(dimensionedScalar("qFuel", sqr(dimVelocity), 0.0)),

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -111,8 +111,13 @@ public:
// Constructors // Constructors
//- Construct from dictionary and mesh //- Construct from dictionary, mesh and phase name
singleStepReactingMixture(const dictionary&, const fvMesh&); singleStepReactingMixture
(
const dictionary&,
const fvMesh&,
const word&
);
//- Destructor //- Destructor

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -30,7 +30,11 @@ License
template<class ThermoType> template<class ThermoType>
const char* Foam::veryInhomogeneousMixture<ThermoType>::specieNames_[3] = const char* Foam::veryInhomogeneousMixture<ThermoType>::specieNames_[3] =
{"ft", "fu", "b"}; {
"ft",
"fu",
"b"
};
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -39,14 +43,16 @@ template<class ThermoType>
Foam::veryInhomogeneousMixture<ThermoType>::veryInhomogeneousMixture Foam::veryInhomogeneousMixture<ThermoType>::veryInhomogeneousMixture
( (
const dictionary& thermoDict, const dictionary& thermoDict,
const fvMesh& mesh const fvMesh& mesh,
const word& phaseName
) )
: :
basicMultiComponentMixture basicCombustionMixture
( (
thermoDict, thermoDict,
speciesTable(nSpecies_, specieNames_), speciesTable(nSpecies_, specieNames_),
mesh mesh,
phaseName
), ),
stoicRatio_(thermoDict.lookup("stoichiometricAirFuelMassRatio")), stoicRatio_(thermoDict.lookup("stoichiometricAirFuelMassRatio")),
@ -105,18 +111,18 @@ void Foam::veryInhomogeneousMixture<ThermoType>::read
template<class ThermoType> template<class ThermoType>
const ThermoType& Foam::veryInhomogeneousMixture<ThermoType>::getLocalThermo const ThermoType& Foam::veryInhomogeneousMixture<ThermoType>::getLocalThermo
( (
const label specieI const label speciei
) const ) const
{ {
if (specieI == 0) if (speciei == 0)
{ {
return fuel_; return fuel_;
} }
else if (specieI == 1) else if (speciei == 1)
{ {
return oxidant_; return oxidant_;
} }
else if (specieI == 2) else if (speciei == 2)
{ {
return products_; return products_;
} }
@ -129,7 +135,7 @@ const ThermoType& Foam::veryInhomogeneousMixture<ThermoType>::getLocalThermo
"(" "("
"const label " "const label "
") const" ") const"
) << "Unknown specie index " << specieI << ". Valid indices are 0..2" ) << "Unknown specie index " << speciei << ". Valid indices are 0..2"
<< abort(FatalError); << abort(FatalError);
return fuel_; return fuel_;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -35,7 +35,7 @@ SourceFiles
#ifndef veryInhomogeneousMixture_H #ifndef veryInhomogeneousMixture_H
#define veryInhomogeneousMixture_H #define veryInhomogeneousMixture_H
#include "basicMultiComponentMixture.H" #include "basicCombustionMixture.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -49,7 +49,7 @@ namespace Foam
template<class ThermoType> template<class ThermoType>
class veryInhomogeneousMixture class veryInhomogeneousMixture
: :
public basicMultiComponentMixture public basicCombustionMixture
{ {
// Private data // Private data
@ -85,8 +85,13 @@ public:
// Constructors // Constructors
//- Construct from dictionary and mesh //- Construct from dictionary, mesh and phase name
veryInhomogeneousMixture(const dictionary&, const fvMesh&); veryInhomogeneousMixture
(
const dictionary&,
const fvMesh&,
const word&
);
//- Destructor //- Destructor
@ -159,7 +164,7 @@ public:
void read(const dictionary&); void read(const dictionary&);
//- Return thermo based on index //- Return thermo based on index
const ThermoType& getLocalThermo(const label specieI) const; const ThermoType& getLocalThermo(const label speciei) const;
}; };

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -36,7 +36,7 @@ SourceFiles
#define psiReactionThermo_H #define psiReactionThermo_H
#include "psiThermo.H" #include "psiThermo.H"
#include "basicMultiComponentMixture.H" #include "basicSpecieMixture.H"
#include "autoPtr.H" #include "autoPtr.H"
#include "runTimeSelectionTables.H" #include "runTimeSelectionTables.H"
@ -98,10 +98,10 @@ public:
// Member functions // Member functions
//- Return the composition of the multi-component mixture //- Return the composition of the multi-component mixture
virtual basicMultiComponentMixture& composition() = 0; virtual basicSpecieMixture& composition() = 0;
//- Return the composition of the multi-component mixture //- Return the composition of the multi-component mixture
virtual const basicMultiComponentMixture& composition() const = 0; virtual const basicSpecieMixture& composition() const = 0;
}; };

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -36,7 +36,7 @@ SourceFiles
#define rhoReactionThermo_H #define rhoReactionThermo_H
#include "rhoThermo.H" #include "rhoThermo.H"
#include "basicMultiComponentMixture.H" #include "basicSpecieMixture.H"
#include "autoPtr.H" #include "autoPtr.H"
#include "runTimeSelectionTables.H" #include "runTimeSelectionTables.H"
@ -98,10 +98,10 @@ public:
// Member functions // Member functions
//- Return the composition of the multi-component mixture //- Return the composition of the multi-component mixture
virtual basicMultiComponentMixture& composition() = 0; virtual basicSpecieMixture& composition() = 0;
//- Return the composition of the multi-component mixture //- Return the composition of the multi-component mixture
virtual const basicMultiComponentMixture& composition() const = 0; virtual const basicSpecieMixture& composition() const = 0;
}; };

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -39,11 +39,12 @@ namespace Foam
Foam::basicSolidChemistryModel::basicSolidChemistryModel Foam::basicSolidChemistryModel::basicSolidChemistryModel
( (
const fvMesh& mesh const fvMesh& mesh,
const word& phaseName
) )
: :
basicChemistryModel(mesh), basicChemistryModel(mesh, phaseName),
solidThermo_(solidReactionThermo::New(mesh)) solidThermo_(solidReactionThermo::New(mesh, phaseName))
{} {}
@ -88,7 +89,7 @@ Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh> >
Foam::basicSolidChemistryModel::calculateRR Foam::basicSolidChemistryModel::calculateRR
( (
const label reactionI, const label reactionI,
const label specieI const label speciei
) const ) const
{ {
notImplemented notImplemented

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -88,19 +88,23 @@ public:
autoPtr, autoPtr,
basicSolidChemistryModel, basicSolidChemistryModel,
fvMesh, fvMesh,
(const fvMesh& mesh), (const fvMesh& mesh, const word& phaseName),
(mesh) (mesh, phaseName)
); );
// Constructors // Constructors
//- Construct from mesh //- Construct from mesh
basicSolidChemistryModel(const fvMesh& mesh); basicSolidChemistryModel(const fvMesh& mesh, const word& phaseName);
//- Selector //- Selector
static autoPtr<basicSolidChemistryModel> New(const fvMesh& mesh); static autoPtr<basicSolidChemistryModel> New
(
const fvMesh& mesh,
const word& phaseName=word::null
);
//- Destructor //- Destructor
@ -133,11 +137,11 @@ public:
const label i const label i
) const = 0; ) const = 0;
//- Returns the reaction rate of the specieI in reactionI //- Returns the reaction rate of the speciei in reactionI
virtual tmp<DimensionedField<scalar, volMesh> > calculateRR virtual tmp<DimensionedField<scalar, volMesh> > calculateRR
( (
const label reactionI, const label reactionI,
const label specieI const label speciei
) const; ) const;
//- Return sensible enthalpy for gas i [J/Kg] //- Return sensible enthalpy for gas i [J/Kg]

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -30,14 +30,15 @@ License
Foam::autoPtr<Foam::basicSolidChemistryModel> Foam::basicSolidChemistryModel:: Foam::autoPtr<Foam::basicSolidChemistryModel> Foam::basicSolidChemistryModel::
New New
( (
const fvMesh& mesh const fvMesh& mesh,
const word& phaseName
) )
{ {
IOdictionary chemistryDict IOdictionary chemistryDict
( (
IOobject IOobject
( (
"chemistryProperties", IOobject::groupName("chemistryProperties", phaseName),
mesh.time().constant(), mesh.time().constant(),
mesh, mesh,
IOobject::MUST_READ, IOobject::MUST_READ,
@ -163,7 +164,7 @@ New
FatalError<< exit(FatalError); FatalError<< exit(FatalError);
} }
return autoPtr<basicSolidChemistryModel>(cstrIter()(mesh)); return autoPtr<basicSolidChemistryModel>(cstrIter()(mesh, phaseName));
} }

View File

@ -32,10 +32,11 @@ template<class CompType, class SolidThermo, class GasThermo>
Foam::pyrolysisChemistryModel<CompType, SolidThermo, GasThermo>:: Foam::pyrolysisChemistryModel<CompType, SolidThermo, GasThermo>::
pyrolysisChemistryModel pyrolysisChemistryModel
( (
const fvMesh& mesh const fvMesh& mesh,
const word& phaseName
) )
: :
solidChemistryModel<CompType, SolidThermo>(mesh), solidChemistryModel<CompType, SolidThermo>(mesh, phaseName),
pyrolisisGases_(this->reactions_[0].gasSpecies()), pyrolisisGases_(this->reactions_[0].gasSpecies()),
gasThermo_(pyrolisisGases_.size()), gasThermo_(pyrolisisGases_.size()),
nGases_(pyrolisisGases_.size()), nGases_(pyrolisisGases_.size()),

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -105,8 +105,8 @@ public:
// Constructors // Constructors
//- Construct from mesh //- Construct from mesh and phase name
pyrolysisChemistryModel(const fvMesh& mesh); pyrolysisChemistryModel(const fvMesh& mesh, const word& phaseName);
//- Destructor //- Destructor

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -33,10 +33,11 @@ template<class CompType, class SolidThermo>
Foam::solidChemistryModel<CompType, SolidThermo>:: Foam::solidChemistryModel<CompType, SolidThermo>::
solidChemistryModel solidChemistryModel
( (
const fvMesh& mesh const fvMesh& mesh,
const word& phaseName
) )
: :
CompType(mesh), CompType(mesh, phaseName),
ODESystem(), ODESystem(),
Ys_(this->solidThermo().composition().Y()), Ys_(this->solidThermo().composition().Y()),
reactions_ reactions_

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -113,8 +113,8 @@ public:
// Constructors // Constructors
//- Construct from mesh //- Construct from mesh and phase name
solidChemistryModel(const fvMesh& mesh); solidChemistryModel(const fvMesh& mesh, const word& phaseName);
//- Destructor //- Destructor

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -35,7 +35,7 @@ SourceFiles
#ifndef solidReactionThermo_H #ifndef solidReactionThermo_H
#define solidReactionThermo_H #define solidReactionThermo_H
#include "basicMultiComponentMixture.H" #include "basicSpecieMixture.H"
#include "solidThermo.H" #include "solidThermo.H"
#include "autoPtr.H" #include "autoPtr.H"
#include "runTimeSelectionTables.H" #include "runTimeSelectionTables.H"
@ -124,10 +124,10 @@ public:
// Member functions // Member functions
//- Return the composition of the multi-component mixture //- Return the composition of the multi-component mixture
virtual basicMultiComponentMixture& composition() = 0; virtual basicSpecieMixture& composition() = 0;
//- Return the composition of the multi-component mixture //- Return the composition of the multi-component mixture
virtual const basicMultiComponentMixture& composition() const = 0; virtual const basicSpecieMixture& composition() const = 0;
}; };