Skip to content
Snippets Groups Projects
Commit 317bf2fb authored by Henry's avatar Henry
Browse files

src/combustionModels/laminar: new model

parent 51b4035d
No related merge requests found
......@@ -15,6 +15,8 @@ infinitelyFastChemistry/infinitelyFastChemistrys.C
PaSR/PaSRs.C
laminar/laminars.C
FSD/reactionRateFlameAreaModels/consumptionSpeed/consumptionSpeed.C
FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameArea.C
FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameAreaNew.C
......@@ -25,4 +27,3 @@ FSD/FSDs.C
noCombustion/noCombustions.C
LIB = $(FOAM_LIBBIN)/libcombustionModels
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 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 "laminar.H"
#include "fvmSup.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
Foam::combustionModels::laminar<Type>::laminar
(
const word& modelType,
const fvMesh& mesh
)
:
Type(modelType, mesh),
integrateReactionRate_
(
this->coeffs().lookupOrDefault("integrateReactionRate", true)
)
{
if (integrateReactionRate_)
{
Info<< " using integrated reaction rate" << endl;
}
else
{
Info<< " using instantaneous reaction rate" << endl;
}
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class Type>
Foam::combustionModels::laminar<Type>::~laminar()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
template<class Type>
Foam::tmp<Foam::volScalarField>
Foam::combustionModels::laminar<Type>::tc() const
{
return this->chemistryPtr_->tc();
}
template<class Type>
void Foam::combustionModels::laminar<Type>::correct()
{
if (this->active())
{
if (integrateReactionRate_)
{
this->chemistryPtr_->solve(this->mesh().time().deltaTValue());
}
else
{
this->chemistryPtr_->calculate();
}
}
}
template<class Type>
Foam::tmp<Foam::fvScalarMatrix>
Foam::combustionModels::laminar<Type>::R(volScalarField& Y) const
{
tmp<fvScalarMatrix> tSu(new fvScalarMatrix(Y, dimMass/dimTime));
fvScalarMatrix& Su = tSu();
if (this->active())
{
const label specieI = this->thermo().composition().species()[Y.name()];
Su += this->chemistryPtr_->RR(specieI);
}
return tSu;
}
template<class Type>
Foam::tmp<Foam::volScalarField>
Foam::combustionModels::laminar<Type>::dQ() const
{
tmp<volScalarField> tdQ
(
new volScalarField
(
IOobject
(
typeName + ":dQ",
this->mesh().time().timeName(),
this->mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
this->mesh(),
dimensionedScalar("dQ", dimEnergy/dimTime, 0.0),
zeroGradientFvPatchScalarField::typeName
)
);
if (this->active())
{
tdQ() = this->chemistryPtr_->dQ();
}
return tdQ;
}
template<class Type>
Foam::tmp<Foam::volScalarField>
Foam::combustionModels::laminar<Type>::Sh() const
{
tmp<volScalarField> tSh
(
new volScalarField
(
IOobject
(
typeName + ":Sh",
this->mesh().time().timeName(),
this->mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
this->mesh(),
dimensionedScalar("zero", dimEnergy/dimTime/dimVolume, 0.0),
zeroGradientFvPatchScalarField::typeName
)
);
if (this->active())
{
tSh() = this->chemistryPtr_->Sh();
}
return tSh;
}
template<class Type>
bool Foam::combustionModels::laminar<Type>::read()
{
if (Type::read())
{
this->coeffs().lookup("integrateReactionRate")
>> integrateReactionRate_;
return true;
}
else
{
return false;
}
}
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 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::combustionModels::laminar
Description
Laminar combustion model.
SourceFiles
laminar.C
\*---------------------------------------------------------------------------*/
#ifndef laminar_H
#define laminar_H
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace combustionModels
{
/*---------------------------------------------------------------------------*\
Class laminar Declaration
\*---------------------------------------------------------------------------*/
template<class Type>
class laminar
:
public Type
{
// Private data
//- Integrate reaction rate over the time-step
// using the selected ODE solver
bool integrateReactionRate_;
// Private Member Functions
//- Return the chemical time scale
tmp<volScalarField> tc() const;
//- Disallow copy construct
laminar(const laminar&);
//- Disallow default bitwise assignment
void operator=(const laminar&);
public:
//- Runtime type information
TypeName("laminar");
// Constructors
//- Construct from components
laminar(const word& modelType, const fvMesh& mesh);
//- Destructor
virtual ~laminar();
// Member Functions
// Evolution
//- Correct combustion rate
virtual void correct();
//- Fuel consumption rate matrix.
virtual tmp<fvScalarMatrix> R(volScalarField& Y) const;
//- Heat release rate calculated from fuel consumption rate matrix
virtual tmp<volScalarField> dQ() const;
//- Return source for enthalpy equation [kg/m/s3]
virtual tmp<volScalarField> Sh() const;
// I-O
//- Update properties from given dictionary
virtual bool read();
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace combustionModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "laminar.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 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 "makeCombustionTypes.H"
#include "psiChemistryCombustion.H"
#include "rhoChemistryCombustion.H"
#include "laminar.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace combustionModels
{
makeCombustionTypes(laminar, psiChemistryCombustion, psiCombustionModel);
makeCombustionTypes(laminar, rhoChemistryCombustion, rhoCombustionModel);
}
}
// ************************************************************************* //
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment