Commit 0a6814ee authored by Henry's avatar Henry
Browse files

combustionModels: Added multiphase-phase support

by naming fields including the phase name is needed
parent 1a3ef4d8
......@@ -40,10 +40,16 @@ template<class CombThermoType, class ThermoType>
FSD<CombThermoType, ThermoType>::FSD
(
const word& modelType,
const fvMesh& mesh
const fvMesh& mesh,
const word& phaseName
)
:
singleStepCombustion<CombThermoType, ThermoType>(modelType, mesh),
singleStepCombustion<CombThermoType, ThermoType>
(
modelType,
mesh,
phaseName
),
reactionRateFlameArea_
(
reactionRateFlameArea::New
......@@ -57,7 +63,7 @@ FSD<CombThermoType, ThermoType>::FSD
(
IOobject
(
"ft",
IOobject::groupName("ft", phaseName),
this->mesh().time().timeName(),
this->mesh(),
IOobject::NO_READ,
......@@ -144,7 +150,7 @@ void FSD<CombThermoType, ThermoType>::calculateSourceNorm()
(
IOobject
(
"Pc",
IOobject::groupName("Pc", this->phaseName_),
U.time().timeName(),
U.db(),
IOobject::NO_READ,
......@@ -163,7 +169,7 @@ void FSD<CombThermoType, ThermoType>::calculateSourceNorm()
(
IOobject
(
"omegaFuelBar",
IOobject::groupName("omegaFuelBar", this->phaseName_),
U.time().timeName(),
U.db(),
IOobject::NO_READ,
......@@ -291,7 +297,7 @@ void FSD<CombThermoType, ThermoType>::calculateSourceNorm()
(
IOobject
(
"products",
IOobject::groupName("products", this->phaseName_),
U.time().timeName(),
U.db(),
IOobject::NO_READ,
......
......@@ -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
......@@ -136,7 +136,7 @@ public:
// Constructors
//- Construct from components
FSD(const word& modelType, const fvMesh& mesh);
FSD(const word& modelType, const fvMesh& mesh, const word& phaseName);
// Destructor
......@@ -149,7 +149,7 @@ public:
virtual void correct();
// I-O
// IO
//- Update properties
virtual bool read();
......
......@@ -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
......@@ -60,17 +60,18 @@ Foam::scalar Foam::consumptionSpeed::omega0Sigma
scalar a
) const
{
scalar omega0 = 0.0;
if (sigma < sigmaExt_)
{
omega0 =
max
(
a*omega0_*(1.0 - exp(eta_*max(sigma, 0.0))),
omegaMin_
) ;
}
return omega0;
scalar omega0 = 0.0;
if (sigma < sigmaExt_)
{
omega0 = max
(
a*omega0_*(1.0 - exp(eta_*max(sigma, 0.0))),
omegaMin_
) ;
}
return omega0;
}
......@@ -137,4 +138,5 @@ void Foam::consumptionSpeed::read(const dictionary& dict)
dict.lookup("omegaMin") >> omegaMin_;
}
// ************************************************************************* //
......@@ -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
......@@ -51,7 +51,6 @@ class consumptionSpeed
{
// Private Data
//- Maximum consumption speed
scalar omega0_;
......@@ -122,7 +121,7 @@ public:
}
// I-O
// IO
//- Update properties
void read(const dictionary& dict);
......
......@@ -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
......@@ -59,8 +59,7 @@ Foam::reactionRateFlameArea::reactionRateFlameArea
),
mesh_
)
{
}
{}
Foam::reactionRateFlameArea::reactionRateFlameArea
......@@ -87,8 +86,8 @@ Foam::reactionRateFlameArea::reactionRateFlameArea
),
mesh_
)
{
}
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
......@@ -101,8 +100,9 @@ Foam::reactionRateFlameArea::~reactionRateFlameArea()
bool Foam::reactionRateFlameArea::read(const dictionary& dict)
{
dict.lookup("fuel") >> fuel_;
return true;
return true;
}
// ************************************************************************* //
......@@ -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
......@@ -103,7 +103,7 @@ public:
virtual void correct(const volScalarField& sigma);
// I-O
// IO
//- Update properties from given dictionary
virtual bool read(const dictionary& dictProperties);
......
......@@ -32,17 +32,18 @@ template<class Type>
Foam::combustionModels::PaSR<Type>::PaSR
(
const word& modelType,
const fvMesh& mesh
const fvMesh& mesh,
const word& phaseName
)
:
laminar<Type>(modelType, mesh),
laminar<Type>(modelType, mesh, phaseName),
Cmix_(readScalar(this->coeffs().lookup("Cmix"))),
turbulentReaction_(this->coeffs().lookup("turbulentReaction")),
kappa_
(
IOobject
(
"PaSR:kappa",
IOobject::groupName("PaSR:kappa", phaseName),
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
......@@ -116,11 +117,14 @@ template<class Type>
Foam::tmp<Foam::volScalarField>
Foam::combustionModels::PaSR<Type>::dQ() const
{
return
tmp<volScalarField>
return tmp<volScalarField>
(
new volScalarField
(
new volScalarField("PaSR:dQ", kappa_*laminar<Type>::dQ())
);
IOobject::groupName("PaSR:dQ", this->phaseName_),
kappa_*laminar<Type>::dQ()
)
);
}
......@@ -128,11 +132,14 @@ template<class Type>
Foam::tmp<Foam::volScalarField>
Foam::combustionModels::PaSR<Type>::Sh() const
{
return
tmp<volScalarField>
return tmp<volScalarField>
(
new volScalarField
(
new volScalarField("PaSR:Sh", kappa_*laminar<Type>::Sh())
);
IOobject::groupName("PaSR:Sh", this->phaseName_),
kappa_*laminar<Type>::Sh()
)
);
}
......
......@@ -86,7 +86,7 @@ public:
// Constructors
//- Construct from components
PaSR(const word& modelType, const fvMesh& mesh);
PaSR(const word& modelType, const fvMesh& mesh, const word& phaseName);
//- Destructor
......@@ -110,7 +110,7 @@ public:
virtual tmp<volScalarField> Sh() const;
// I-O
// IO
//- Update properties from given dictionary
virtual bool read();
......
......@@ -37,14 +37,15 @@ namespace Foam
Foam::combustionModel::combustionModel
(
const word& modelType,
const fvMesh& mesh
const fvMesh& mesh,
const word& phaseName
)
:
IOdictionary
(
IOobject
(
"combustionProperties",
IOobject::groupName("combustionProperties", phaseName),
mesh.time().constant(),
mesh,
IOobject::MUST_READ_IF_MODIFIED,
......@@ -55,7 +56,8 @@ Foam::combustionModel::combustionModel
mesh_(mesh),
active_(lookupOrDefault<Switch>("active", true)),
coeffs_(subDict(modelType + "Coeffs")),
modelType_(modelType)
modelType_(modelType),
phaseName_(phaseName)
{}
......@@ -96,7 +98,7 @@ Foam::tmp<Foam::volScalarField> Foam::combustionModel::Sh() const
(
IOobject
(
"Sh",
IOobject::groupName("Sh", phaseName_),
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
......
......@@ -51,6 +51,14 @@ class combustionModel
:
public IOdictionary
{
// Private Member Functions
//- Disallow copy construct
combustionModel(const combustionModel&);
//- Disallow default bitwise assignment
void operator=(const combustionModel&);
protected:
......@@ -68,19 +76,11 @@ protected:
//- Dictionary of the model
dictionary coeffs_;
//- Model name
//- Model type
const word modelType_;
private:
// Private Member Functions
//- Disallow copy construct
combustionModel(const combustionModel&);
//- Disallow default bitwise assignment
void operator=(const combustionModel&);
//- Phase name
const word phaseName_;
public:
......@@ -91,9 +91,13 @@ public:
// Constructors
//- Construct from components
combustionModel(const word& modelType, const fvMesh& mesh);
combustionModel
(
const word& modelType,
const fvMesh& mesh,
const word& phaseName=word::null
);
//- Destructor
......@@ -104,7 +108,6 @@ public:
// Access
//- Return const access to the mesh database
inline const fvMesh& mesh() const;
......@@ -145,7 +148,7 @@ public:
virtual tmp<volScalarField> Sh() const;
// I-O
// IO
//- Update properties from given dictionary
virtual bool read();
......
......@@ -36,10 +36,17 @@ namespace combustionModels
template<class CombThermoType, class ThermoType>
diffusion<CombThermoType, ThermoType>::diffusion
(
const word& modelType, const fvMesh& mesh
const word& modelType,
const fvMesh& mesh,
const word& phaseName
)
:
singleStepCombustion<CombThermoType, ThermoType>(modelType, mesh),
singleStepCombustion<CombThermoType, ThermoType>
(
modelType,
mesh,
phaseName
),
C_(readScalar(this->coeffs().lookup("C"))),
oxidantName_(this->coeffs().template lookupOrDefault<word>("oxidant", "O2"))
{}
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -82,7 +82,12 @@ public:
// Constructors
//- Construct from components
diffusion(const word& modelType, const fvMesh& mesh);
diffusion
(
const word& modelType,
const fvMesh& mesh,
const word& phaseName
);
//- Destructor
......@@ -97,7 +102,7 @@ public:
virtual void correct();
// I-O
// IO
//- Update properties
virtual bool read();
......
......@@ -35,10 +35,17 @@ namespace combustionModels
template<class CombThermoType, class ThermoType>
infinitelyFastChemistry<CombThermoType, ThermoType>::infinitelyFastChemistry
(
const word& modelType, const fvMesh& mesh
const word& modelType,
const fvMesh& mesh,
const word& phaseName
)
:
singleStepCombustion<CombThermoType, ThermoType>(modelType, mesh),
singleStepCombustion<CombThermoType, ThermoType>
(
modelType,
mesh,
phaseName
),
C_(readScalar(this->coeffs().lookup("C")))
{}
......
......@@ -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
......@@ -79,7 +79,12 @@ public:
// Constructors
//- Construct from components
infinitelyFastChemistry(const word& modelType, const fvMesh& mesh);
infinitelyFastChemistry
(
const word& modelType,
const fvMesh& mesh,
const word& phaseName
);
//- Destructor
......@@ -94,7 +99,7 @@ public:
virtual void correct();
// I-O
// IO
//- Update properties
virtual bool read();
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -33,10 +33,11 @@ template<class Type>
Foam::combustionModels::laminar<Type>::laminar
(
const word& modelType,
const fvMesh& mesh
const fvMesh& mesh,
const word& phaseName
)
:
Type(modelType, mesh),
Type(modelType, mesh, phaseName),
integrateReactionRate_
(
this->coeffs().lookupOrDefault("integrateReactionRate", true)
......@@ -128,7 +129,8 @@ Foam::combustionModels::laminar<Type>::R(volScalarField& Y) const
if (this->active())
{
const label specieI = this->thermo().composition().species()[Y.name()];
const label specieI =
this->thermo().composition().species()[Y.member()];
Su += this->chemistryPtr_->RR(specieI);
}
......@@ -147,7 +149,7 @@ Foam::combustionModels::laminar<Type>::dQ() const
(
IOobject
(
typeName + ":dQ",
IOobject::groupName(typeName + ":dQ", this->phaseName_),
this->mesh().time().timeName(),
this->mesh(),
IOobject::NO_READ,
......@@ -179,7 +181,7 @@ Foam::combustionModels::laminar<Type>::Sh() const
(
IOobject
(
typeName + ":Sh",
IOobject::groupName(typeName + ":Sh", this->phaseName_),
this->mesh().time().timeName(),
this->mesh(),
IOobject::NO_READ,
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -84,7 +84,12 @@ public:
// Constructors
//- Construct from components
laminar(const word& modelType, const fvMesh& mesh);
laminar
(
const word& modelType,
const fvMesh& mesh,
const word& phaseName
);
//- Destructor
......@@ -108,7 +113,7 @@ public:
virtual tmp<volScalarField> Sh() const;
// I-O
// IO
//- Update properties from given dictionary
virtual bool read();
......
......@@ -32,10 +32,11 @@ template<class CombThermoType>
Foam::combustionModels::noCombustion<CombThermoType>::noCombustion
(
const word& modelType,
const fvMesh& mesh
const fvMesh& mesh,
const word& phaseName
)
:
CombThermoType(modelType, mesh)
CombThermoType(modelType, mesh, phaseName)
{}
......@@ -81,7 +82,7 @@ Foam::combustionModels::noCombustion<CombThermoType>::dQ() const
(
IOobject
(
"dQ",
IOobject::groupName("dQ", this->phaseName_),
this->mesh().time().timeName(),
this->mesh(),
IOobject::NO_READ,
......@@ -108,7 +109,7 @@ Foam::combustionModels::noCombustion<CombThermoType>::Sh() const
(
IOobject
(
"Sh",
IOobject::groupName("Sh", this->phaseName_),
this->mesh().time().timeName(),
this->mesh(),
IOobject::NO_READ,
......