mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
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:
@ -10,7 +10,7 @@
|
||||
|
||||
SLGThermo slgThermo(mesh, thermo);
|
||||
|
||||
basicMultiComponentMixture& composition = thermo.composition();
|
||||
basicSpecieMixture& composition = thermo.composition();
|
||||
PtrList<volScalarField>& Y = composition.Y();
|
||||
|
||||
const word inertSpecie(thermo.lookup("inertSpecie"));
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
|
||||
SLGThermo slgThermo(mesh, thermo);
|
||||
|
||||
basicMultiComponentMixture& composition = thermo.composition();
|
||||
basicSpecieMixture& composition = thermo.composition();
|
||||
PtrList<volScalarField>& Y = composition.Y();
|
||||
|
||||
const word inertSpecie(thermo.lookup("inertSpecie"));
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
|
||||
SLGThermo slgThermo(mesh, thermo);
|
||||
|
||||
basicMultiComponentMixture& composition = thermo.composition();
|
||||
basicSpecieMixture& composition = thermo.composition();
|
||||
PtrList<volScalarField>& Y = composition.Y();
|
||||
|
||||
const word inertSpecie(thermo.lookup("inertSpecie"));
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
|
||||
SLGThermo slgThermo(mesh, thermo);
|
||||
|
||||
basicMultiComponentMixture& composition = thermo.composition();
|
||||
basicSpecieMixture& composition = thermo.composition();
|
||||
PtrList<volScalarField>& Y = composition.Y();
|
||||
|
||||
const word inertSpecie(thermo.lookup("inertSpecie"));
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
|
||||
SLGThermo slgThermo(mesh, thermo);
|
||||
|
||||
basicMultiComponentMixture& composition = thermo.composition();
|
||||
basicSpecieMixture& composition = thermo.composition();
|
||||
PtrList<volScalarField>& Y = composition.Y();
|
||||
|
||||
const word inertSpecie(thermo.lookup("inertSpecie"));
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -85,7 +85,7 @@ const Foam::SLGThermo& Foam::CompositionModel<CloudType>::thermo() const
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
const Foam::basicMultiComponentMixture&
|
||||
const Foam::basicSpecieMixture&
|
||||
Foam::CompositionModel<CloudType>::carrier() const
|
||||
{
|
||||
return thermo_.carrier();
|
||||
@ -713,4 +713,3 @@ Foam::scalar Foam::CompositionModel<CloudType>::L
|
||||
#include "CompositionModelNew.C"
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
|
||||
@ -138,7 +138,7 @@ public:
|
||||
// Composition lists
|
||||
|
||||
//- Return the carrier components (wrapper function)
|
||||
const basicMultiComponentMixture& carrier() const;
|
||||
const basicSpecieMixture& carrier() const;
|
||||
|
||||
//- Return the global (additional) liquids
|
||||
const liquidMixtureProperties& liquids() const;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -53,10 +53,10 @@ Foam::SLGThermo::SLGThermo(const fvMesh& mesh, fluidThermo& thermo)
|
||||
{
|
||||
Info<< "Creating component thermo properties:" << endl;
|
||||
|
||||
if (isA<basicMultiComponentMixture>(thermo))
|
||||
if (isA<basicSpecieMixture>(thermo))
|
||||
{
|
||||
basicMultiComponentMixture& mcThermo =
|
||||
dynamic_cast<basicMultiComponentMixture&>(thermo);
|
||||
basicSpecieMixture& mcThermo =
|
||||
dynamic_cast<basicSpecieMixture&>(thermo);
|
||||
carrier_ = &mcThermo;
|
||||
|
||||
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)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"const Foam::basicMultiComponentMixture& "
|
||||
"const Foam::basicSpecieMixture& "
|
||||
"Foam::SLGThermo::carrier() const"
|
||||
) << "carrier requested, but object is not allocated"
|
||||
<< abort(FatalError);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -47,7 +47,7 @@ SourceFiles
|
||||
|
||||
#include "regIOobject.H"
|
||||
#include "fluidThermo.H"
|
||||
#include "basicMultiComponentMixture.H"
|
||||
#include "basicSpecieMixture.H"
|
||||
#include "liquidMixtureProperties.H"
|
||||
#include "solidMixtureProperties.H"
|
||||
|
||||
@ -70,7 +70,7 @@ class SLGThermo
|
||||
fluidThermo& thermo_;
|
||||
|
||||
//- Reference to the multi-component carrier phase thermo
|
||||
basicMultiComponentMixture* carrier_;
|
||||
basicSpecieMixture* carrier_;
|
||||
|
||||
//- Additional liquid properties data
|
||||
autoPtr<liquidMixtureProperties> liquids_;
|
||||
@ -102,7 +102,7 @@ public:
|
||||
const fluidThermo& thermo() const;
|
||||
|
||||
//- Return reference to the gaseous components
|
||||
const basicMultiComponentMixture& carrier() const;
|
||||
const basicSpecieMixture& carrier() const;
|
||||
|
||||
//- Return reference to the global (additional) liquids
|
||||
const liquidMixtureProperties& liquids() const;
|
||||
|
||||
@ -89,7 +89,7 @@ Foam::heThermo<BasicThermo, MixtureType>::heThermo
|
||||
)
|
||||
:
|
||||
BasicThermo(mesh, phaseName),
|
||||
MixtureType(*this, mesh),
|
||||
MixtureType(*this, mesh, phaseName),
|
||||
|
||||
he_
|
||||
(
|
||||
@ -123,7 +123,7 @@ Foam::heThermo<BasicThermo, MixtureType>::heThermo
|
||||
)
|
||||
:
|
||||
BasicThermo(mesh, dict, phaseName),
|
||||
MixtureType(*this, mesh),
|
||||
MixtureType(*this, mesh, phaseName),
|
||||
|
||||
he_
|
||||
(
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -58,8 +58,8 @@ public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from dictionary and mesh
|
||||
basicMixture(const dictionary&, const fvMesh&)
|
||||
//- Construct from dictionary, mesh and phase name
|
||||
basicMixture(const dictionary&, const fvMesh&, const word&)
|
||||
{}
|
||||
};
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -26,21 +26,17 @@ License
|
||||
#include "pureMixture.H"
|
||||
#include "fvMesh.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class ThermoType>
|
||||
pureMixture<ThermoType>::pureMixture
|
||||
Foam::pureMixture<ThermoType>::pureMixture
|
||||
(
|
||||
const dictionary& thermoDict,
|
||||
const fvMesh& mesh
|
||||
const fvMesh& mesh,
|
||||
const word& phaseName
|
||||
)
|
||||
:
|
||||
basicMixture(thermoDict, mesh),
|
||||
basicMixture(thermoDict, mesh, phaseName),
|
||||
mixture_(thermoDict.subDict("mixture"))
|
||||
{}
|
||||
|
||||
@ -48,14 +44,10 @@ pureMixture<ThermoType>::pureMixture
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class ThermoType>
|
||||
void pureMixture<ThermoType>::read(const dictionary& thermoDict)
|
||||
void Foam::pureMixture<ThermoType>::read(const dictionary& thermoDict)
|
||||
{
|
||||
mixture_ = ThermoType(thermoDict.subDict("mixture"));
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -67,8 +67,8 @@ public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from dictionary and mesh
|
||||
pureMixture(const dictionary&, const fvMesh&);
|
||||
//- Construct from dictionary, mesh and phase name
|
||||
pureMixture(const dictionary&, const fvMesh&, const word&);
|
||||
|
||||
|
||||
// Member functions
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -44,13 +44,17 @@ void Foam::basicChemistryModel::correct()
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::basicChemistryModel::basicChemistryModel(const fvMesh& mesh)
|
||||
Foam::basicChemistryModel::basicChemistryModel
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const word& phaseName
|
||||
)
|
||||
:
|
||||
IOdictionary
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"chemistryProperties",
|
||||
IOobject::groupName("chemistryProperties", phaseName),
|
||||
mesh.time().constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
@ -64,7 +68,7 @@ Foam::basicChemistryModel::basicChemistryModel(const fvMesh& mesh)
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"deltaTChem",
|
||||
IOobject::groupName("deltaTChem", phaseName),
|
||||
mesh.time().constant(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -104,14 +104,14 @@ public:
|
||||
// Constructors
|
||||
|
||||
//- Construct from mesh
|
||||
basicChemistryModel(const fvMesh& mesh);
|
||||
basicChemistryModel(const fvMesh& mesh, const word& phaseName);
|
||||
|
||||
|
||||
// Selectors
|
||||
|
||||
//- Generic New for each of the related chemistry model
|
||||
template<class Thermo>
|
||||
static autoPtr<Thermo> New(const fvMesh&);
|
||||
static autoPtr<Thermo> New(const fvMesh& mesh, const word& phaseName);
|
||||
|
||||
|
||||
//- Destructor
|
||||
@ -146,11 +146,11 @@ public:
|
||||
const label i
|
||||
) = 0;
|
||||
|
||||
//- Return reaction rate of the specieI in reactionI
|
||||
//- Return reaction rate of the speciei in reactioni
|
||||
virtual tmp<DimensionedField<scalar, volMesh> > calculateRR
|
||||
(
|
||||
const label reactionI,
|
||||
const label specieI
|
||||
const label reactioni,
|
||||
const label speciei
|
||||
) const = 0;
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -31,14 +31,15 @@ License
|
||||
template<class ChemistryModel>
|
||||
Foam::autoPtr<ChemistryModel> Foam::basicChemistryModel::New
|
||||
(
|
||||
const fvMesh& mesh
|
||||
const fvMesh& mesh,
|
||||
const word& phaseName
|
||||
)
|
||||
{
|
||||
IOdictionary chemistryDict
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"chemistryProperties",
|
||||
IOobject::groupName("chemistryProperties", phaseName),
|
||||
mesh.time().constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
@ -74,7 +75,7 @@ Foam::autoPtr<ChemistryModel> Foam::basicChemistryModel::New
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"thermophysicalProperties",
|
||||
IOobject::groupName("thermophysicalProperties", phaseName),
|
||||
mesh.time().constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
@ -158,7 +159,7 @@ Foam::autoPtr<ChemistryModel> Foam::basicChemistryModel::New
|
||||
FatalError<< exit(FatalError);
|
||||
}
|
||||
|
||||
return autoPtr<ChemistryModel>(cstrIter()(mesh));
|
||||
return autoPtr<ChemistryModel>(cstrIter()(mesh, phaseName));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -180,7 +181,7 @@ Foam::autoPtr<ChemistryModel> Foam::basicChemistryModel::New
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
return autoPtr<ChemistryModel>(cstrIter()(mesh));
|
||||
return autoPtr<ChemistryModel>(cstrIter()(mesh, phaseName));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -32,10 +32,11 @@ License
|
||||
template<class CompType, class ThermoType>
|
||||
Foam::chemistryModel<CompType, ThermoType>::chemistryModel
|
||||
(
|
||||
const fvMesh& mesh
|
||||
const fvMesh& mesh,
|
||||
const word& phaseName
|
||||
)
|
||||
:
|
||||
CompType(mesh),
|
||||
CompType(mesh, phaseName),
|
||||
ODESystem(),
|
||||
Y_(this->thermo().composition().Y()),
|
||||
reactions_
|
||||
@ -632,7 +633,7 @@ Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh> >
|
||||
Foam::chemistryModel<CompType, ThermoType>::calculateRR
|
||||
(
|
||||
const label reactionI,
|
||||
const label specieI
|
||||
const label speciei
|
||||
) const
|
||||
{
|
||||
scalar pf, cf, pr, cr;
|
||||
@ -701,7 +702,7 @@ Foam::chemistryModel<CompType, ThermoType>::calculateRR
|
||||
rRef
|
||||
);
|
||||
|
||||
RR[celli] = w*specieThermo_[specieI].W();
|
||||
RR[celli] = w*specieThermo_[speciei].W();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -117,7 +117,7 @@ public:
|
||||
// Constructors
|
||||
|
||||
//- Construct from mesh
|
||||
chemistryModel(const fvMesh& mesh);
|
||||
chemistryModel(const fvMesh& mesh, const word& phaseName);
|
||||
|
||||
|
||||
//- Destructor
|
||||
@ -198,11 +198,11 @@ public:
|
||||
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
|
||||
(
|
||||
const label reactionI,
|
||||
const label specieI
|
||||
const label speciei
|
||||
) const;
|
||||
|
||||
//- Solve the reaction system for the given time step
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -39,11 +39,12 @@ namespace Foam
|
||||
|
||||
Foam::psiChemistryModel::psiChemistryModel
|
||||
(
|
||||
const fvMesh& mesh
|
||||
const fvMesh& mesh,
|
||||
const word& phaseName
|
||||
)
|
||||
:
|
||||
basicChemistryModel(mesh),
|
||||
thermo_(psiReactionThermo::New(mesh))
|
||||
basicChemistryModel(mesh, phaseName),
|
||||
thermo_(psiReactionThermo::New(mesh, phaseName))
|
||||
{}
|
||||
|
||||
|
||||
@ -51,10 +52,11 @@ Foam::psiChemistryModel::psiChemistryModel
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -87,19 +87,23 @@ public:
|
||||
autoPtr,
|
||||
psiChemistryModel,
|
||||
fvMesh,
|
||||
(const fvMesh& mesh),
|
||||
(mesh)
|
||||
(const fvMesh& mesh, const word& phaseName),
|
||||
(mesh, phaseName)
|
||||
);
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from mesh
|
||||
psiChemistryModel(const fvMesh& mesh);
|
||||
//- Construct from mesh and phase name
|
||||
psiChemistryModel(const fvMesh& mesh, const word& phaseName);
|
||||
|
||||
|
||||
//- Selector
|
||||
static autoPtr<psiChemistryModel> New(const fvMesh& mesh);
|
||||
static autoPtr<psiChemistryModel> New
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const word& phaseName=word::null
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -39,11 +39,12 @@ namespace Foam
|
||||
|
||||
Foam::rhoChemistryModel::rhoChemistryModel
|
||||
(
|
||||
const fvMesh& mesh
|
||||
const fvMesh& mesh,
|
||||
const word& phaseName
|
||||
)
|
||||
:
|
||||
basicChemistryModel(mesh),
|
||||
thermo_(rhoReactionThermo::New(mesh))
|
||||
basicChemistryModel(mesh, phaseName),
|
||||
thermo_(rhoReactionThermo::New(mesh, phaseName))
|
||||
{}
|
||||
|
||||
|
||||
@ -51,10 +52,11 @@ Foam::rhoChemistryModel::rhoChemistryModel
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -87,21 +87,23 @@ public:
|
||||
autoPtr,
|
||||
rhoChemistryModel,
|
||||
fvMesh,
|
||||
(
|
||||
const fvMesh& mesh
|
||||
),
|
||||
(mesh)
|
||||
(const fvMesh& mesh, const word& phaseName),
|
||||
(mesh, phaseName)
|
||||
);
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from mesh
|
||||
rhoChemistryModel(const fvMesh& mesh);
|
||||
//- Construct from mesh and phase name
|
||||
rhoChemistryModel(const fvMesh& mesh, const word& phaseName);
|
||||
|
||||
|
||||
//- Selector
|
||||
static autoPtr<rhoChemistryModel> New(const fvMesh& mesh);
|
||||
static autoPtr<rhoChemistryModel> New
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const word& phaseName=word::null
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -32,10 +32,11 @@ License
|
||||
template<class ChemistryModel>
|
||||
Foam::EulerImplicit<ChemistryModel>::EulerImplicit
|
||||
(
|
||||
const fvMesh& mesh
|
||||
const fvMesh& mesh,
|
||||
const word& phaseName
|
||||
)
|
||||
:
|
||||
chemistrySolver<ChemistryModel>(mesh),
|
||||
chemistrySolver<ChemistryModel>(mesh, phaseName),
|
||||
coeffsDict_(this->subDict("EulerImplicitCoeffs")),
|
||||
cTauChem_(readScalar(coeffsDict_.lookup("cTauChem"))),
|
||||
eqRateLimiter_(coeffsDict_.lookup("equilibriumRateLimiter")),
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -77,8 +77,8 @@ public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from mesh
|
||||
EulerImplicit(const fvMesh& mesh);
|
||||
//- Construct from mesh and phase name
|
||||
EulerImplicit(const fvMesh& mesh, const word& phaseName);
|
||||
|
||||
|
||||
//- Destructor
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -30,10 +30,11 @@ License
|
||||
template<class ChemistryModel>
|
||||
Foam::chemistrySolver<ChemistryModel>::chemistrySolver
|
||||
(
|
||||
const fvMesh& mesh
|
||||
const fvMesh& mesh,
|
||||
const word& phaseName
|
||||
)
|
||||
:
|
||||
ChemistryModel(mesh)
|
||||
ChemistryModel(mesh, phaseName)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -58,8 +58,8 @@ public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
chemistrySolver(const fvMesh& mesh);
|
||||
//- Construct from components and phase name
|
||||
chemistrySolver(const fvMesh& mesh, const word& phaseName);
|
||||
|
||||
|
||||
//- Destructor
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -31,10 +31,11 @@ License
|
||||
template<class ChemistryModel>
|
||||
Foam::noChemistrySolver<ChemistryModel>::noChemistrySolver
|
||||
(
|
||||
const fvMesh& mesh
|
||||
const fvMesh& mesh,
|
||||
const word& phaseName
|
||||
)
|
||||
:
|
||||
chemistrySolver<ChemistryModel>(mesh)
|
||||
chemistrySolver<ChemistryModel>(mesh, phaseName)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -61,8 +61,8 @@ public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
noChemistrySolver(const fvMesh& mesh);
|
||||
//- Construct from mesh and phase name
|
||||
noChemistrySolver(const fvMesh& mesh, const word& phaseName);
|
||||
|
||||
|
||||
//- Destructor
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -31,10 +31,11 @@ License
|
||||
template<class ChemistryModel>
|
||||
Foam::ode<ChemistryModel>::ode
|
||||
(
|
||||
const fvMesh& mesh
|
||||
const fvMesh& mesh,
|
||||
const word& phaseName
|
||||
)
|
||||
:
|
||||
chemistrySolver<ChemistryModel>(mesh),
|
||||
chemistrySolver<ChemistryModel>(mesh, phaseName),
|
||||
coeffsDict_(this->subDict("odeCoeffs")),
|
||||
odeSolver_(ODESolver::New(*this, coeffsDict_)),
|
||||
cTp_(this->nEqns())
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -69,8 +69,8 @@ public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from mesh
|
||||
ode(const fvMesh& mesh);
|
||||
//- Construct from mesh and phase name
|
||||
ode(const fvMesh& mesh, const word& phaseName);
|
||||
|
||||
|
||||
//- Destructor
|
||||
|
||||
@ -27,7 +27,7 @@ License
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "unitConversion.H"
|
||||
#include "zeroGradientFvPatchFields.H"
|
||||
#include "basicMultiComponentMixture.H"
|
||||
#include "basicSpecieMixture.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
@ -64,7 +64,7 @@ Foam::radiation::greyMeanAbsorptionEmission::greyMeanAbsorptionEmission
|
||||
EhrrCoeff_(readScalar(coeffsDict_.lookup("EhrrCoeff"))),
|
||||
Yj_(nSpecies_)
|
||||
{
|
||||
if (!isA<basicMultiComponentMixture>(thermo_))
|
||||
if (!isA<basicSpecieMixture>(thermo_))
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
@ -203,8 +203,8 @@ Foam::radiation::greyMeanAbsorptionEmission::~greyMeanAbsorptionEmission()
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::radiation::greyMeanAbsorptionEmission::aCont(const label bandI) const
|
||||
{
|
||||
const basicMultiComponentMixture& mixture =
|
||||
dynamic_cast<const basicMultiComponentMixture&>(thermo_);
|
||||
const basicSpecieMixture& mixture =
|
||||
dynamic_cast<const basicSpecieMixture&>(thermo_);
|
||||
|
||||
const volScalarField& T = thermo_.T();
|
||||
const volScalarField& p = thermo_.p();
|
||||
|
||||
@ -93,10 +93,10 @@ greyMeanSolidAbsorptionEmission
|
||||
coeffsDict_((dict.subDict(typeName + "Coeffs"))),
|
||||
thermo_(mesh.lookupObject<solidThermo>("thermophysicalProperties")),
|
||||
speciesNames_(0),
|
||||
mixture_(dynamic_cast<const basicMultiComponentMixture&>(thermo_)),
|
||||
mixture_(dynamic_cast<const basicSpecieMixture&>(thermo_)),
|
||||
solidData_(mixture_.Y().size())
|
||||
{
|
||||
if (!isA<basicMultiComponentMixture>(thermo_))
|
||||
if (!isA<basicSpecieMixture>(thermo_))
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
|
||||
@ -51,7 +51,7 @@ SourceFiles
|
||||
|
||||
#include "absorptionEmissionModel.H"
|
||||
#include "solidThermo.H"
|
||||
#include "basicMultiComponentMixture.H"
|
||||
#include "basicSpecieMixture.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -90,7 +90,7 @@ private:
|
||||
HashTable<label> speciesNames_;
|
||||
|
||||
//- Basic multicomponent mixture
|
||||
const basicMultiComponentMixture& mixture_;
|
||||
const basicSpecieMixture& mixture_;
|
||||
|
||||
//- List of solid species data
|
||||
List<FixedList<scalar, 2> > solidData_;
|
||||
|
||||
@ -109,8 +109,8 @@ Foam::radiation::mixtureFractionSoot<ThermoType>::mixtureFractionSoot
|
||||
scalar totalMol = 0.0;
|
||||
forAll(reaction.rhs(), i)
|
||||
{
|
||||
label specieI = reaction.rhs()[i].index;
|
||||
totalMol += mag(specieStoichCoeffs[specieI]);
|
||||
label speciei = reaction.rhs()[i].index;
|
||||
totalMol += mag(specieStoichCoeffs[speciei]);
|
||||
}
|
||||
|
||||
totalMol += nuSoot_;
|
||||
@ -120,9 +120,9 @@ Foam::radiation::mixtureFractionSoot<ThermoType>::mixtureFractionSoot
|
||||
scalar Wm = 0.0;
|
||||
forAll(reaction.rhs(), i)
|
||||
{
|
||||
const label specieI = reaction.rhs()[i].index;
|
||||
Xi[i] = mag(specieStoichCoeffs[specieI])/totalMol;
|
||||
Wm += Xi[i]*mixture_.speciesData()[specieI].W();
|
||||
const label speciei = reaction.rhs()[i].index;
|
||||
Xi[i] = mag(specieStoichCoeffs[speciei])/totalMol;
|
||||
Wm += Xi[i]*mixture_.speciesData()[speciei].W();
|
||||
}
|
||||
|
||||
const scalar XSoot = nuSoot_/totalMol;
|
||||
|
||||
@ -3,6 +3,8 @@ chemistryReaders/chemkinReader/chemkinLexer.L
|
||||
chemistryReaders/chemistryReader/makeChemistryReaders.C
|
||||
|
||||
mixtures/basicMultiComponentMixture/basicMultiComponentMixture.C
|
||||
mixtures/basicSpecieMixture/basicSpecieMixture.C
|
||||
mixtures/basicCombustionMixture/basicCombustionMixture.C
|
||||
|
||||
psiReactionThermo/psiReactionThermo.C
|
||||
psiReactionThermo/psiReactionThermos.C
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -26,19 +26,22 @@ License
|
||||
#include "SpecieMixture.H"
|
||||
#include "fvMesh.H"
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class MixtureType>
|
||||
Foam::SpecieMixture<MixtureType>::SpecieMixture
|
||||
(
|
||||
const dictionary& thermoDict,
|
||||
const fvMesh& mesh
|
||||
const fvMesh& mesh,
|
||||
const word& phaseName
|
||||
)
|
||||
:
|
||||
MixtureType
|
||||
(
|
||||
thermoDict,
|
||||
mesh
|
||||
mesh,
|
||||
phaseName
|
||||
)
|
||||
{}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -61,8 +61,8 @@ public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from dictionary and mesh
|
||||
SpecieMixture(const dictionary&, const fvMesh&);
|
||||
//- Construct from dictionary, mesh and phase name
|
||||
SpecieMixture(const dictionary&, const fvMesh&, const word& phaseName);
|
||||
|
||||
|
||||
//- Destructor
|
||||
@ -74,10 +74,10 @@ public:
|
||||
|
||||
// Per specie properties
|
||||
|
||||
//- Number of moles []
|
||||
//- Number of moles of the given specie []
|
||||
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;
|
||||
|
||||
|
||||
@ -180,7 +180,7 @@ public:
|
||||
//- Density [kg/m3]
|
||||
virtual scalar rho
|
||||
(
|
||||
const label specieI,
|
||||
const label speciei,
|
||||
const scalar p,
|
||||
const scalar T
|
||||
) const;
|
||||
|
||||
@ -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)
|
||||
{}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -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
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -23,15 +23,24 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "basicMixture.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
inline Foam::scalar Foam::basicCombustionMixture::fres
|
||||
(
|
||||
const scalar ft,
|
||||
const scalar stoicRatio
|
||||
) 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));
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -25,13 +25,22 @@ License
|
||||
|
||||
#include "basicMultiComponentMixture.H"
|
||||
|
||||
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(basicMultiComponentMixture, 0);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::basicMultiComponentMixture::basicMultiComponentMixture
|
||||
(
|
||||
const dictionary& thermoDict,
|
||||
const wordList& specieNames,
|
||||
const fvMesh& mesh
|
||||
const fvMesh& mesh,
|
||||
const word& phaseName
|
||||
)
|
||||
:
|
||||
species_(specieNames),
|
||||
@ -41,13 +50,13 @@ Foam::basicMultiComponentMixture::basicMultiComponentMixture
|
||||
{
|
||||
IOobject header
|
||||
(
|
||||
species_[i],
|
||||
IOobject::groupName(species_[i], phaseName),
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ
|
||||
);
|
||||
|
||||
// check if field exists and can be read
|
||||
// Check if field exists and can be read
|
||||
if (header.headerOk())
|
||||
{
|
||||
Y_.set
|
||||
@ -57,7 +66,7 @@ Foam::basicMultiComponentMixture::basicMultiComponentMixture
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
species_[i],
|
||||
IOobject::groupName(species_[i], phaseName),
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
@ -89,7 +98,7 @@ Foam::basicMultiComponentMixture::basicMultiComponentMixture
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
species_[i],
|
||||
IOobject::groupName(species_[i], phaseName),
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -25,8 +25,10 @@ Class
|
||||
Foam::basicMultiComponentMixture
|
||||
|
||||
Description
|
||||
Multi-component mixture. Provides a list of mass fraction fields and helper
|
||||
functions to query mixture composition.
|
||||
Multi-component mixture.
|
||||
|
||||
Provides a list of mass fraction fields and helper functions to
|
||||
query mixture composition.
|
||||
|
||||
SourceFiles
|
||||
basicMultiComponentMixture.C
|
||||
@ -39,6 +41,7 @@ SourceFiles
|
||||
#include "volFields.H"
|
||||
#include "PtrList.H"
|
||||
#include "speciesTable.H"
|
||||
#include "typeInfo.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -65,18 +68,23 @@ protected:
|
||||
|
||||
public:
|
||||
|
||||
//- Run time type information
|
||||
TypeName("basicMultiComponentMixture");
|
||||
|
||||
|
||||
//- The base class of the mixture
|
||||
typedef basicMultiComponentMixture basicMixtureType;
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from dictionary and mesh
|
||||
//- Construct from dictionary, species names, mesh and phase name
|
||||
basicMultiComponentMixture
|
||||
(
|
||||
const dictionary&,
|
||||
const wordList& specieNames,
|
||||
const fvMesh&
|
||||
const fvMesh&,
|
||||
const word&
|
||||
);
|
||||
|
||||
|
||||
@ -88,10 +96,7 @@ public:
|
||||
// Member functions
|
||||
|
||||
//- Return the table of species
|
||||
const speciesTable& species() const
|
||||
{
|
||||
return species_;
|
||||
}
|
||||
inline const speciesTable& species() const;
|
||||
|
||||
//- Return the mass-fraction fields
|
||||
inline PtrList<volScalarField>& Y();
|
||||
@ -113,128 +118,6 @@ public:
|
||||
|
||||
//- Does the mixture include this specie?
|
||||
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;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -23,6 +23,13 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
inline const Foam::speciesTable&
|
||||
Foam::basicMultiComponentMixture::species() const
|
||||
{
|
||||
return species_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::PtrList<Foam::volScalarField>&
|
||||
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));
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -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
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -38,14 +38,16 @@ template<class ThermoType>
|
||||
Foam::egrMixture<ThermoType>::egrMixture
|
||||
(
|
||||
const dictionary& thermoDict,
|
||||
const fvMesh& mesh
|
||||
const fvMesh& mesh,
|
||||
const word& phaseName
|
||||
)
|
||||
:
|
||||
basicMultiComponentMixture
|
||||
basicCombustionMixture
|
||||
(
|
||||
thermoDict,
|
||||
speciesTable(nSpecies_, specieNames_),
|
||||
mesh
|
||||
mesh,
|
||||
phaseName
|
||||
),
|
||||
|
||||
stoicRatio_(thermoDict.lookup("stoichiometricAirFuelMassRatio")),
|
||||
@ -110,18 +112,18 @@ void Foam::egrMixture<ThermoType>::read(const dictionary& thermoDict)
|
||||
template<class ThermoType>
|
||||
const ThermoType& Foam::egrMixture<ThermoType>::getLocalThermo
|
||||
(
|
||||
const label specieI
|
||||
const label speciei
|
||||
) const
|
||||
{
|
||||
if (specieI == 0)
|
||||
if (speciei == 0)
|
||||
{
|
||||
return fuel_;
|
||||
}
|
||||
else if (specieI == 1)
|
||||
else if (speciei == 1)
|
||||
{
|
||||
return oxidant_;
|
||||
}
|
||||
else if (specieI == 2)
|
||||
else if (speciei == 2)
|
||||
{
|
||||
return products_;
|
||||
}
|
||||
@ -133,7 +135,7 @@ const ThermoType& Foam::egrMixture<ThermoType>::getLocalThermo
|
||||
"("
|
||||
"const label "
|
||||
") const"
|
||||
) << "Unknown specie index " << specieI << ". Valid indices are 0..2"
|
||||
) << "Unknown specie index " << speciei << ". Valid indices are 0..2"
|
||||
<< abort(FatalError);
|
||||
|
||||
return fuel_;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -35,7 +35,7 @@ SourceFiles
|
||||
#ifndef egrMixture_H
|
||||
#define egrMixture_H
|
||||
|
||||
#include "basicMultiComponentMixture.H"
|
||||
#include "basicCombustionMixture.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -49,7 +49,7 @@ namespace Foam
|
||||
template<class ThermoType>
|
||||
class egrMixture
|
||||
:
|
||||
public basicMultiComponentMixture
|
||||
public basicCombustionMixture
|
||||
{
|
||||
// Private data
|
||||
|
||||
@ -85,8 +85,8 @@ public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from dictionary and mesh
|
||||
egrMixture(const dictionary&, const fvMesh&);
|
||||
//- Construct from dictionary, mesh and phaseName
|
||||
egrMixture(const dictionary&, const fvMesh&, const word&);
|
||||
|
||||
|
||||
//- Destructor
|
||||
@ -169,7 +169,7 @@ public:
|
||||
void read(const dictionary&);
|
||||
|
||||
//- Return thermo based on index
|
||||
const ThermoType& getLocalThermo(const label specieI) const;
|
||||
const ThermoType& getLocalThermo(const label speciei) const;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -38,14 +38,16 @@ template<class ThermoType>
|
||||
Foam::homogeneousMixture<ThermoType>::homogeneousMixture
|
||||
(
|
||||
const dictionary& thermoDict,
|
||||
const fvMesh& mesh
|
||||
const fvMesh& mesh,
|
||||
const word& phaseName
|
||||
)
|
||||
:
|
||||
basicMultiComponentMixture
|
||||
basicCombustionMixture
|
||||
(
|
||||
thermoDict,
|
||||
speciesTable(nSpecies_, specieNames_),
|
||||
mesh
|
||||
mesh,
|
||||
phaseName
|
||||
),
|
||||
|
||||
reactants_(thermoDict.subDict("reactants")),
|
||||
@ -92,14 +94,14 @@ void Foam::homogeneousMixture<ThermoType>::read(const dictionary& thermoDict)
|
||||
template<class ThermoType>
|
||||
const ThermoType& Foam::homogeneousMixture<ThermoType>::getLocalThermo
|
||||
(
|
||||
const label specieI
|
||||
const label speciei
|
||||
) const
|
||||
{
|
||||
if (specieI == 0)
|
||||
if (speciei == 0)
|
||||
{
|
||||
return reactants_;
|
||||
}
|
||||
else if (specieI == 1)
|
||||
else if (speciei == 1)
|
||||
{
|
||||
return products_;
|
||||
}
|
||||
@ -112,7 +114,7 @@ const ThermoType& Foam::homogeneousMixture<ThermoType>::getLocalThermo
|
||||
"("
|
||||
"const label "
|
||||
") const"
|
||||
) << "Unknown specie index " << specieI << ". Valid indices are 0..1"
|
||||
) << "Unknown specie index " << speciei << ". Valid indices are 0..1"
|
||||
<< abort(FatalError);
|
||||
|
||||
return reactants_;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -35,7 +35,7 @@ SourceFiles
|
||||
#ifndef homogeneousMixture_H
|
||||
#define homogeneousMixture_H
|
||||
|
||||
#include "basicMultiComponentMixture.H"
|
||||
#include "basicCombustionMixture.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -49,7 +49,7 @@ namespace Foam
|
||||
template<class ThermoType>
|
||||
class homogeneousMixture
|
||||
:
|
||||
public basicMultiComponentMixture
|
||||
public basicCombustionMixture
|
||||
{
|
||||
// Private data
|
||||
|
||||
@ -76,8 +76,8 @@ public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from dictionary and mesh
|
||||
homogeneousMixture(const dictionary&, const fvMesh&);
|
||||
//- Construct from dictionary, mesh and phase name
|
||||
homogeneousMixture(const dictionary&, const fvMesh&, const word&);
|
||||
|
||||
|
||||
//- Destructor
|
||||
@ -127,7 +127,7 @@ public:
|
||||
void read(const dictionary&);
|
||||
|
||||
//- Return thermo based on index
|
||||
const ThermoType& getLocalThermo(const label specieI) const;
|
||||
const ThermoType& getLocalThermo(const label speciei) const;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -30,7 +30,10 @@ License
|
||||
|
||||
template<class ThermoType>
|
||||
const char* Foam::inhomogeneousMixture<ThermoType>::specieNames_[2] =
|
||||
{"ft", "b"};
|
||||
{
|
||||
"ft",
|
||||
"b"
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
@ -39,14 +42,16 @@ template<class ThermoType>
|
||||
Foam::inhomogeneousMixture<ThermoType>::inhomogeneousMixture
|
||||
(
|
||||
const dictionary& thermoDict,
|
||||
const fvMesh& mesh
|
||||
const fvMesh& mesh,
|
||||
const word& phaseName
|
||||
)
|
||||
:
|
||||
basicMultiComponentMixture
|
||||
basicCombustionMixture
|
||||
(
|
||||
thermoDict,
|
||||
speciesTable(nSpecies_, specieNames_),
|
||||
mesh
|
||||
mesh,
|
||||
phaseName
|
||||
),
|
||||
|
||||
stoicRatio_(thermoDict.lookup("stoichiometricAirFuelMassRatio")),
|
||||
@ -104,18 +109,18 @@ void Foam::inhomogeneousMixture<ThermoType>::read(const dictionary& thermoDict)
|
||||
template<class ThermoType>
|
||||
const ThermoType& Foam::inhomogeneousMixture<ThermoType>::getLocalThermo
|
||||
(
|
||||
const label specieI
|
||||
const label speciei
|
||||
) const
|
||||
{
|
||||
if (specieI == 0)
|
||||
if (speciei == 0)
|
||||
{
|
||||
return fuel_;
|
||||
}
|
||||
else if (specieI == 1)
|
||||
else if (speciei == 1)
|
||||
{
|
||||
return oxidant_;
|
||||
}
|
||||
else if (specieI == 2)
|
||||
else if (speciei == 2)
|
||||
{
|
||||
return products_;
|
||||
}
|
||||
@ -128,7 +133,7 @@ const ThermoType& Foam::inhomogeneousMixture<ThermoType>::getLocalThermo
|
||||
"("
|
||||
"const label "
|
||||
") const"
|
||||
) << "Unknown specie index " << specieI << ". Valid indices are 0..2"
|
||||
) << "Unknown specie index " << speciei << ". Valid indices are 0..2"
|
||||
<< abort(FatalError);
|
||||
|
||||
return fuel_;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -35,7 +35,7 @@ SourceFiles
|
||||
#ifndef inhomogeneousMixture_H
|
||||
#define inhomogeneousMixture_H
|
||||
|
||||
#include "basicMultiComponentMixture.H"
|
||||
#include "basicCombustionMixture.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -49,7 +49,7 @@ namespace Foam
|
||||
template<class ThermoType>
|
||||
class inhomogeneousMixture
|
||||
:
|
||||
public basicMultiComponentMixture
|
||||
public basicCombustionMixture
|
||||
{
|
||||
// Private data
|
||||
|
||||
@ -82,8 +82,8 @@ public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from dictionary and mesh
|
||||
inhomogeneousMixture(const dictionary&, const fvMesh&);
|
||||
//- Construct from dictionary, mesh and phase name
|
||||
inhomogeneousMixture(const dictionary&, const fvMesh&, const word&);
|
||||
|
||||
|
||||
//- Destructor
|
||||
@ -158,7 +158,7 @@ public:
|
||||
void read(const dictionary&);
|
||||
|
||||
//- Return thermo based on index
|
||||
const ThermoType& getLocalThermo(const label specieI) const;
|
||||
const ThermoType& getLocalThermo(const label speciei) const;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -83,10 +83,11 @@ Foam::multiComponentMixture<ThermoType>::multiComponentMixture
|
||||
const dictionary& thermoDict,
|
||||
const wordList& specieNames,
|
||||
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()),
|
||||
mixture_("mixture", *thermoData[specieNames[0]]),
|
||||
mixtureVol_("volMixture", *thermoData[specieNames[0]])
|
||||
@ -108,10 +109,17 @@ template<class ThermoType>
|
||||
Foam::multiComponentMixture<ThermoType>::multiComponentMixture
|
||||
(
|
||||
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()),
|
||||
mixture_("mixture", constructSpeciesData(thermoDict)),
|
||||
mixtureVol_("volMixture", speciesData_[0])
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -35,7 +35,7 @@ SourceFiles
|
||||
#ifndef multiComponentMixture_H
|
||||
#define multiComponentMixture_H
|
||||
|
||||
#include "basicMultiComponentMixture.H"
|
||||
#include "basicSpecieMixture.H"
|
||||
#include "HashPtrTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -50,7 +50,7 @@ namespace Foam
|
||||
template<class ThermoType>
|
||||
class multiComponentMixture
|
||||
:
|
||||
public basicMultiComponentMixture
|
||||
public basicSpecieMixture
|
||||
{
|
||||
// Private data
|
||||
|
||||
@ -86,17 +86,19 @@ public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from dictionary, specie names, thermo database and mesh
|
||||
//- Construct from dictionary, specie names, thermo database,
|
||||
// mesh and phase name
|
||||
multiComponentMixture
|
||||
(
|
||||
const dictionary&,
|
||||
const wordList& specieNames,
|
||||
const HashPtrTable<ThermoType>& thermoData,
|
||||
const fvMesh&
|
||||
const fvMesh&,
|
||||
const word&
|
||||
);
|
||||
|
||||
//- Construct from dictionary and mesh
|
||||
multiComponentMixture(const dictionary&, const fvMesh&);
|
||||
//- Construct from dictionary, mesh and phase name
|
||||
multiComponentMixture(const dictionary&, const fvMesh&, const word&);
|
||||
|
||||
|
||||
//- Destructor
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -32,7 +32,8 @@ template<class ThermoType>
|
||||
Foam::reactingMixture<ThermoType>::reactingMixture
|
||||
(
|
||||
const dictionary& thermoDict,
|
||||
const fvMesh& mesh
|
||||
const fvMesh& mesh,
|
||||
const word& phaseName
|
||||
)
|
||||
:
|
||||
speciesTable(),
|
||||
@ -45,7 +46,8 @@ Foam::reactingMixture<ThermoType>::reactingMixture
|
||||
thermoDict,
|
||||
*this,
|
||||
autoPtr<chemistryReader<ThermoType> >::operator()().speciesThermo(),
|
||||
mesh
|
||||
mesh,
|
||||
phaseName
|
||||
),
|
||||
PtrList<Reaction<ThermoType> >
|
||||
(
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -73,8 +73,8 @@ public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from dictionary and mesh
|
||||
reactingMixture(const dictionary&, const fvMesh&);
|
||||
//- Construct from dictionary, mesh and phase name
|
||||
reactingMixture(const dictionary&, const fvMesh&, const word&);
|
||||
|
||||
|
||||
//- Destructor
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -36,19 +36,19 @@ void Foam::singleStepReactingMixture<ThermoType>::calculateqFuel()
|
||||
|
||||
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;
|
||||
specieStoichCoeffs_[specieI] = -stoichCoeff;
|
||||
qFuel_.value() += this->speciesData()[specieI].hc()*stoichCoeff/Wu;
|
||||
specieStoichCoeffs_[speciei] = -stoichCoeff;
|
||||
qFuel_.value() += this->speciesData()[speciei].hc()*stoichCoeff/Wu;
|
||||
}
|
||||
|
||||
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;
|
||||
specieStoichCoeffs_[specieI] = stoichCoeff;
|
||||
qFuel_.value() -= this->speciesData()[specieI].hc()*stoichCoeff/Wu;
|
||||
specieProd_[specieI] = -1;
|
||||
specieStoichCoeffs_[speciei] = stoichCoeff;
|
||||
qFuel_.value() -= this->speciesData()[speciei].hc()*stoichCoeff/Wu;
|
||||
specieProd_[speciei] = -1;
|
||||
}
|
||||
|
||||
Info << "Fuel heat of combustion :" << qFuel_.value() << endl;
|
||||
@ -88,24 +88,24 @@ void Foam::singleStepReactingMixture<ThermoType>::calculateMaxProducts()
|
||||
scalar totalMol = 0.0;
|
||||
forAll(reaction.rhs(), i)
|
||||
{
|
||||
label specieI = reaction.rhs()[i].index;
|
||||
totalMol += mag(specieStoichCoeffs_[specieI]);
|
||||
label speciei = reaction.rhs()[i].index;
|
||||
totalMol += mag(specieStoichCoeffs_[speciei]);
|
||||
}
|
||||
|
||||
scalarList Xi(reaction.rhs().size());
|
||||
|
||||
forAll(reaction.rhs(), i)
|
||||
{
|
||||
const label specieI = reaction.rhs()[i].index;
|
||||
Xi[i] = mag(specieStoichCoeffs_[specieI])/totalMol;
|
||||
const label speciei = reaction.rhs()[i].index;
|
||||
Xi[i] = mag(specieStoichCoeffs_[speciei])/totalMol;
|
||||
|
||||
Wm += Xi[i]*this->speciesData()[specieI].W();
|
||||
Wm += Xi[i]*this->speciesData()[speciei].W();
|
||||
}
|
||||
|
||||
forAll(reaction.rhs(), i)
|
||||
{
|
||||
const label specieI = reaction.rhs()[i].index;
|
||||
Yprod0_[specieI] = this->speciesData()[specieI].W()/Wm*Xi[i];
|
||||
const label speciei = reaction.rhs()[i].index;
|
||||
Yprod0_[speciei] = this->speciesData()[speciei].W()/Wm*Xi[i];
|
||||
}
|
||||
|
||||
Info << "Maximum products mass concentrations:" << nl;
|
||||
@ -141,14 +141,14 @@ void Foam::singleStepReactingMixture<ThermoType>::fresCorrect()
|
||||
// reactants
|
||||
forAll(reaction.lhs(), i)
|
||||
{
|
||||
const label specieI = reaction.lhs()[i].index;
|
||||
if (specieI == fuelIndex_)
|
||||
const label speciei = reaction.lhs()[i].index;
|
||||
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
|
||||
forAll(reaction.rhs(), i)
|
||||
{
|
||||
const label specieI = reaction.rhs()[i].index;
|
||||
if (specieI != inertIndex_)
|
||||
const label speciei = reaction.rhs()[i].index;
|
||||
if (speciei != inertIndex_)
|
||||
{
|
||||
forAll(fres_[specieI], cellI)
|
||||
forAll(fres_[speciei], cellI)
|
||||
{
|
||||
if (fres_[fuelIndex_][cellI] > 0.0)
|
||||
{
|
||||
// rich mixture
|
||||
fres_[specieI][cellI] =
|
||||
Yprod0_[specieI]
|
||||
fres_[speciei][cellI] =
|
||||
Yprod0_[speciei]
|
||||
* (1.0 + YO2[cellI]/s_.value() - YFuel[cellI]);
|
||||
}
|
||||
else
|
||||
{
|
||||
// lean mixture
|
||||
fres_[specieI][cellI] =
|
||||
Yprod0_[specieI]
|
||||
fres_[speciei][cellI] =
|
||||
Yprod0_[speciei]
|
||||
* (
|
||||
1.0
|
||||
- YO2[cellI]/s_.value()*stoicRatio_.value()
|
||||
@ -191,10 +191,11 @@ template<class ThermoType>
|
||||
Foam::singleStepReactingMixture<ThermoType>::singleStepReactingMixture
|
||||
(
|
||||
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)),
|
||||
s_(dimensionedScalar("s", dimless, 0.0)),
|
||||
qFuel_(dimensionedScalar("qFuel", sqr(dimVelocity), 0.0)),
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -111,8 +111,13 @@ public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from dictionary and mesh
|
||||
singleStepReactingMixture(const dictionary&, const fvMesh&);
|
||||
//- Construct from dictionary, mesh and phase name
|
||||
singleStepReactingMixture
|
||||
(
|
||||
const dictionary&,
|
||||
const fvMesh&,
|
||||
const word&
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -30,7 +30,11 @@ License
|
||||
|
||||
template<class ThermoType>
|
||||
const char* Foam::veryInhomogeneousMixture<ThermoType>::specieNames_[3] =
|
||||
{"ft", "fu", "b"};
|
||||
{
|
||||
"ft",
|
||||
"fu",
|
||||
"b"
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
@ -39,14 +43,16 @@ template<class ThermoType>
|
||||
Foam::veryInhomogeneousMixture<ThermoType>::veryInhomogeneousMixture
|
||||
(
|
||||
const dictionary& thermoDict,
|
||||
const fvMesh& mesh
|
||||
const fvMesh& mesh,
|
||||
const word& phaseName
|
||||
)
|
||||
:
|
||||
basicMultiComponentMixture
|
||||
basicCombustionMixture
|
||||
(
|
||||
thermoDict,
|
||||
speciesTable(nSpecies_, specieNames_),
|
||||
mesh
|
||||
mesh,
|
||||
phaseName
|
||||
),
|
||||
|
||||
stoicRatio_(thermoDict.lookup("stoichiometricAirFuelMassRatio")),
|
||||
@ -105,18 +111,18 @@ void Foam::veryInhomogeneousMixture<ThermoType>::read
|
||||
template<class ThermoType>
|
||||
const ThermoType& Foam::veryInhomogeneousMixture<ThermoType>::getLocalThermo
|
||||
(
|
||||
const label specieI
|
||||
const label speciei
|
||||
) const
|
||||
{
|
||||
if (specieI == 0)
|
||||
if (speciei == 0)
|
||||
{
|
||||
return fuel_;
|
||||
}
|
||||
else if (specieI == 1)
|
||||
else if (speciei == 1)
|
||||
{
|
||||
return oxidant_;
|
||||
}
|
||||
else if (specieI == 2)
|
||||
else if (speciei == 2)
|
||||
{
|
||||
return products_;
|
||||
}
|
||||
@ -129,7 +135,7 @@ const ThermoType& Foam::veryInhomogeneousMixture<ThermoType>::getLocalThermo
|
||||
"("
|
||||
"const label "
|
||||
") const"
|
||||
) << "Unknown specie index " << specieI << ". Valid indices are 0..2"
|
||||
) << "Unknown specie index " << speciei << ". Valid indices are 0..2"
|
||||
<< abort(FatalError);
|
||||
|
||||
return fuel_;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -35,7 +35,7 @@ SourceFiles
|
||||
#ifndef veryInhomogeneousMixture_H
|
||||
#define veryInhomogeneousMixture_H
|
||||
|
||||
#include "basicMultiComponentMixture.H"
|
||||
#include "basicCombustionMixture.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -49,7 +49,7 @@ namespace Foam
|
||||
template<class ThermoType>
|
||||
class veryInhomogeneousMixture
|
||||
:
|
||||
public basicMultiComponentMixture
|
||||
public basicCombustionMixture
|
||||
{
|
||||
// Private data
|
||||
|
||||
@ -85,8 +85,13 @@ public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from dictionary and mesh
|
||||
veryInhomogeneousMixture(const dictionary&, const fvMesh&);
|
||||
//- Construct from dictionary, mesh and phase name
|
||||
veryInhomogeneousMixture
|
||||
(
|
||||
const dictionary&,
|
||||
const fvMesh&,
|
||||
const word&
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
@ -159,7 +164,7 @@ public:
|
||||
void read(const dictionary&);
|
||||
|
||||
//- Return thermo based on index
|
||||
const ThermoType& getLocalThermo(const label specieI) const;
|
||||
const ThermoType& getLocalThermo(const label speciei) const;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -36,7 +36,7 @@ SourceFiles
|
||||
#define psiReactionThermo_H
|
||||
|
||||
#include "psiThermo.H"
|
||||
#include "basicMultiComponentMixture.H"
|
||||
#include "basicSpecieMixture.H"
|
||||
#include "autoPtr.H"
|
||||
#include "runTimeSelectionTables.H"
|
||||
|
||||
@ -98,10 +98,10 @@ public:
|
||||
// Member functions
|
||||
|
||||
//- Return the composition of the multi-component mixture
|
||||
virtual basicMultiComponentMixture& composition() = 0;
|
||||
virtual basicSpecieMixture& composition() = 0;
|
||||
|
||||
//- Return the composition of the multi-component mixture
|
||||
virtual const basicMultiComponentMixture& composition() const = 0;
|
||||
virtual const basicSpecieMixture& composition() const = 0;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -36,7 +36,7 @@ SourceFiles
|
||||
#define rhoReactionThermo_H
|
||||
|
||||
#include "rhoThermo.H"
|
||||
#include "basicMultiComponentMixture.H"
|
||||
#include "basicSpecieMixture.H"
|
||||
#include "autoPtr.H"
|
||||
#include "runTimeSelectionTables.H"
|
||||
|
||||
@ -98,10 +98,10 @@ public:
|
||||
// Member functions
|
||||
|
||||
//- Return the composition of the multi-component mixture
|
||||
virtual basicMultiComponentMixture& composition() = 0;
|
||||
virtual basicSpecieMixture& composition() = 0;
|
||||
|
||||
//- Return the composition of the multi-component mixture
|
||||
virtual const basicMultiComponentMixture& composition() const = 0;
|
||||
virtual const basicSpecieMixture& composition() const = 0;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -39,11 +39,12 @@ namespace Foam
|
||||
|
||||
Foam::basicSolidChemistryModel::basicSolidChemistryModel
|
||||
(
|
||||
const fvMesh& mesh
|
||||
const fvMesh& mesh,
|
||||
const word& phaseName
|
||||
)
|
||||
:
|
||||
basicChemistryModel(mesh),
|
||||
solidThermo_(solidReactionThermo::New(mesh))
|
||||
basicChemistryModel(mesh, phaseName),
|
||||
solidThermo_(solidReactionThermo::New(mesh, phaseName))
|
||||
{}
|
||||
|
||||
|
||||
@ -88,7 +89,7 @@ Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh> >
|
||||
Foam::basicSolidChemistryModel::calculateRR
|
||||
(
|
||||
const label reactionI,
|
||||
const label specieI
|
||||
const label speciei
|
||||
) const
|
||||
{
|
||||
notImplemented
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -88,19 +88,23 @@ public:
|
||||
autoPtr,
|
||||
basicSolidChemistryModel,
|
||||
fvMesh,
|
||||
(const fvMesh& mesh),
|
||||
(mesh)
|
||||
(const fvMesh& mesh, const word& phaseName),
|
||||
(mesh, phaseName)
|
||||
);
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from mesh
|
||||
basicSolidChemistryModel(const fvMesh& mesh);
|
||||
basicSolidChemistryModel(const fvMesh& mesh, const word& phaseName);
|
||||
|
||||
|
||||
//- Selector
|
||||
static autoPtr<basicSolidChemistryModel> New(const fvMesh& mesh);
|
||||
static autoPtr<basicSolidChemistryModel> New
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const word& phaseName=word::null
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
@ -133,11 +137,11 @@ public:
|
||||
const label i
|
||||
) 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
|
||||
(
|
||||
const label reactionI,
|
||||
const label specieI
|
||||
const label speciei
|
||||
) const;
|
||||
|
||||
//- Return sensible enthalpy for gas i [J/Kg]
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -30,14 +30,15 @@ License
|
||||
Foam::autoPtr<Foam::basicSolidChemistryModel> Foam::basicSolidChemistryModel::
|
||||
New
|
||||
(
|
||||
const fvMesh& mesh
|
||||
const fvMesh& mesh,
|
||||
const word& phaseName
|
||||
)
|
||||
{
|
||||
IOdictionary chemistryDict
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"chemistryProperties",
|
||||
IOobject::groupName("chemistryProperties", phaseName),
|
||||
mesh.time().constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
@ -163,7 +164,7 @@ New
|
||||
FatalError<< exit(FatalError);
|
||||
}
|
||||
|
||||
return autoPtr<basicSolidChemistryModel>(cstrIter()(mesh));
|
||||
return autoPtr<basicSolidChemistryModel>(cstrIter()(mesh, phaseName));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -32,10 +32,11 @@ template<class CompType, class SolidThermo, class GasThermo>
|
||||
Foam::pyrolysisChemistryModel<CompType, SolidThermo, GasThermo>::
|
||||
pyrolysisChemistryModel
|
||||
(
|
||||
const fvMesh& mesh
|
||||
const fvMesh& mesh,
|
||||
const word& phaseName
|
||||
)
|
||||
:
|
||||
solidChemistryModel<CompType, SolidThermo>(mesh),
|
||||
solidChemistryModel<CompType, SolidThermo>(mesh, phaseName),
|
||||
pyrolisisGases_(this->reactions_[0].gasSpecies()),
|
||||
gasThermo_(pyrolisisGases_.size()),
|
||||
nGases_(pyrolisisGases_.size()),
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -105,8 +105,8 @@ public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from mesh
|
||||
pyrolysisChemistryModel(const fvMesh& mesh);
|
||||
//- Construct from mesh and phase name
|
||||
pyrolysisChemistryModel(const fvMesh& mesh, const word& phaseName);
|
||||
|
||||
|
||||
//- Destructor
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -33,10 +33,11 @@ template<class CompType, class SolidThermo>
|
||||
Foam::solidChemistryModel<CompType, SolidThermo>::
|
||||
solidChemistryModel
|
||||
(
|
||||
const fvMesh& mesh
|
||||
const fvMesh& mesh,
|
||||
const word& phaseName
|
||||
)
|
||||
:
|
||||
CompType(mesh),
|
||||
CompType(mesh, phaseName),
|
||||
ODESystem(),
|
||||
Ys_(this->solidThermo().composition().Y()),
|
||||
reactions_
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -113,8 +113,8 @@ public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from mesh
|
||||
solidChemistryModel(const fvMesh& mesh);
|
||||
//- Construct from mesh and phase name
|
||||
solidChemistryModel(const fvMesh& mesh, const word& phaseName);
|
||||
|
||||
|
||||
//- Destructor
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -35,7 +35,7 @@ SourceFiles
|
||||
#ifndef solidReactionThermo_H
|
||||
#define solidReactionThermo_H
|
||||
|
||||
#include "basicMultiComponentMixture.H"
|
||||
#include "basicSpecieMixture.H"
|
||||
#include "solidThermo.H"
|
||||
#include "autoPtr.H"
|
||||
#include "runTimeSelectionTables.H"
|
||||
@ -124,10 +124,10 @@ public:
|
||||
// Member functions
|
||||
|
||||
//- Return the composition of the multi-component mixture
|
||||
virtual basicMultiComponentMixture& composition() = 0;
|
||||
virtual basicSpecieMixture& composition() = 0;
|
||||
|
||||
//- Return the composition of the multi-component mixture
|
||||
virtual const basicMultiComponentMixture& composition() const = 0;
|
||||
virtual const basicSpecieMixture& composition() const = 0;
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user