ENH: Added new diffusion combustion model

This commit is contained in:
andy 2012-08-01 16:30:41 +01:00
parent 962f72c333
commit e6f521bec0
4 changed files with 302 additions and 0 deletions

View File

@ -10,6 +10,7 @@ rhoCombustionModel/rhoCombustionModel/rhoCombustionModelNew.C
rhoCombustionModel/rhoThermoCombustion/rhoThermoCombustion.C
rhoCombustionModel/rhoChemistryCombustion/rhoChemistryCombustion.C
diffusion/diffusions.C
infinitelyFastChemistry/infinitelyFastChemistrys.C
PaSR/PaSRs.C

View File

@ -0,0 +1,105 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
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 "diffusion.H"
#include "fvcGrad.H"
namespace Foam
{
namespace combustionModels
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class CombThermoType, class ThermoType>
diffusion<CombThermoType, ThermoType>::diffusion
(
const word& modelType, const fvMesh& mesh
)
:
singleStepCombustion<CombThermoType, ThermoType>(modelType, mesh),
C_(readScalar(this->coeffs().lookup("C"))),
oxidantName_(this->coeffs().template lookupOrDefault<word>("oxidant", "O2"))
{}
// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * * //
template<class CombThermoType, class ThermoType>
diffusion<CombThermoType, ThermoType>::~diffusion()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
template<class CombThermoType, class ThermoType>
void diffusion<CombThermoType, ThermoType>::correct()
{
this->wFuel_ ==
dimensionedScalar("zero", dimMass/pow3(dimLength)/dimTime, 0.0);
if (this->active())
{
this->singleMixturePtr_->fresCorrect();
const label fuelI = this->singleMixturePtr_->fuelIndex();
const volScalarField& YFuel = this->thermoPtr_->composition().Y()[fuelI];
if (this->thermoPtr_->composition().contains(oxidantName_))
{
const volScalarField& YO2 =
this->thermoPtr_->composition().Y(oxidantName_);
this->wFuel_ ==
C_*this->turbulence().muEff()
*mag(fvc::grad(YFuel) & fvc::grad(YO2))
*pos(YFuel)*pos(YO2);
}
}
}
template<class CombThermoType, class ThermoType>
bool diffusion<CombThermoType, ThermoType>::read()
{
if (singleStepCombustion<CombThermoType, ThermoType>::read())
{
this->coeffs().lookup("C") >> C_ ;
this->coeffs().readIfPresent("oxidant", oxidantName_);
return true;
}
else
{
return false;
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace combustionModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -0,0 +1,122 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
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::diffusion
Description
Simple diffusion-based combustion model based on the principle mixed is
burnt. Additional parameter C is used to distribute the heat release rate
in time.
SourceFiles
diffusion.C
\*---------------------------------------------------------------------------*/
#ifndef diffusion_H
#define diffusion_H
#include "singleStepCombustion.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace combustionModels
{
/*---------------------------------------------------------------------------*\
Class diffusion Declaration
\*---------------------------------------------------------------------------*/
template<class CombThermoType, class ThermoType>
class diffusion
:
public singleStepCombustion<CombThermoType, ThermoType>
{
// Private data
//- Model constant
scalar C_;
//- Name of oxidant - default is "O2"
word oxidantName_;
// Private Member Functions
//- Disallow copy construct
diffusion(const diffusion&);
//- Disallow default bitwise assignment
void operator=(const diffusion&);
public:
//- Runtime type information
TypeName("diffusion");
// Constructors
//- Construct from components
diffusion(const word& modelType, const fvMesh& mesh);
//- Destructor
virtual ~diffusion();
// Member Functions
// Evolution
//- Correct combustion rate
virtual void correct();
// I-O
//- Update properties
virtual bool read();
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace combustionModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "diffusion.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,74 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 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 "thermoPhysicsTypes.H"
#include "psiThermoCombustion.H"
#include "rhoThermoCombustion.H"
#include "diffusion.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace combustionModels
{
makeCombustionTypesThermo
(
diffusion,
psiThermoCombustion,
gasThermoPhysics,
psiCombustionModel
);
makeCombustionTypesThermo
(
diffusion,
psiThermoCombustion,
constGasThermoPhysics,
psiCombustionModel
);
makeCombustionTypesThermo
(
diffusion,
rhoThermoCombustion,
gasThermoPhysics,
rhoCombustionModel
);
makeCombustionTypesThermo
(
diffusion,
rhoThermoCombustion,
constGasThermoPhysics,
rhoCombustionModel
);
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //