diff --git a/src/combustionModels/Make/files b/src/combustionModels/Make/files index 88e81afe8bc55174ae2d5a686b5f298781ecded3..b68fbb742f273498a2ad7a76f0436b7d665aa45e 100644 --- a/src/combustionModels/Make/files +++ b/src/combustionModels/Make/files @@ -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 - diff --git a/src/combustionModels/laminar/laminar.C b/src/combustionModels/laminar/laminar.C new file mode 100644 index 0000000000000000000000000000000000000000..b7a40921e90e8c68957930d8f2c1cbd275ef7702 --- /dev/null +++ b/src/combustionModels/laminar/laminar.C @@ -0,0 +1,188 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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; + } +} + + +// ************************************************************************* // diff --git a/src/combustionModels/laminar/laminar.H b/src/combustionModels/laminar/laminar.H new file mode 100644 index 0000000000000000000000000000000000000000..25e086d81c45544c5d0808bd04b4b5cd68f5bed5 --- /dev/null +++ b/src/combustionModels/laminar/laminar.H @@ -0,0 +1,128 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 + +// ************************************************************************* // diff --git a/src/combustionModels/laminar/laminars.C b/src/combustionModels/laminar/laminars.C new file mode 100644 index 0000000000000000000000000000000000000000..1c7d5526c9e9ad8aa4e5bd5434d99b91edc2efcb --- /dev/null +++ b/src/combustionModels/laminar/laminars.C @@ -0,0 +1,44 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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); +} +} + + +// ************************************************************************* //