From e6f521bec073359a0e4858f7e287a5fb1cf1ed84 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 1 Aug 2012 16:30:41 +0100 Subject: [PATCH] ENH: Added new diffusion combustion model --- src/combustionModels/Make/files | 1 + src/combustionModels/diffusion/diffusion.C | 105 +++++++++++++++++ src/combustionModels/diffusion/diffusion.H | 122 ++++++++++++++++++++ src/combustionModels/diffusion/diffusions.C | 74 ++++++++++++ 4 files changed, 302 insertions(+) create mode 100644 src/combustionModels/diffusion/diffusion.C create mode 100644 src/combustionModels/diffusion/diffusion.H create mode 100644 src/combustionModels/diffusion/diffusions.C diff --git a/src/combustionModels/Make/files b/src/combustionModels/Make/files index 20de91ecc6..88e81afe8b 100644 --- a/src/combustionModels/Make/files +++ b/src/combustionModels/Make/files @@ -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 diff --git a/src/combustionModels/diffusion/diffusion.C b/src/combustionModels/diffusion/diffusion.C new file mode 100644 index 0000000000..b8cb1ed7ae --- /dev/null +++ b/src/combustionModels/diffusion/diffusion.C @@ -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 . + +\*---------------------------------------------------------------------------*/ + +#include "diffusion.H" +#include "fvcGrad.H" + +namespace Foam +{ +namespace combustionModels +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +diffusion::diffusion +( + const word& modelType, const fvMesh& mesh +) +: + singleStepCombustion(modelType, mesh), + C_(readScalar(this->coeffs().lookup("C"))), + oxidantName_(this->coeffs().template lookupOrDefault("oxidant", "O2")) +{} + + +// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * * // + +template +diffusion::~diffusion() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +template +void diffusion::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 +bool diffusion::read() +{ + if (singleStepCombustion::read()) + { + this->coeffs().lookup("C") >> C_ ; + this->coeffs().readIfPresent("oxidant", oxidantName_); + return true; + } + else + { + return false; + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace combustionModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/combustionModels/diffusion/diffusion.H b/src/combustionModels/diffusion/diffusion.H new file mode 100644 index 0000000000..c3002a894f --- /dev/null +++ b/src/combustionModels/diffusion/diffusion.H @@ -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 . + +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 diffusion +: + public singleStepCombustion +{ + // 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 + +// ************************************************************************* // diff --git a/src/combustionModels/diffusion/diffusions.C b/src/combustionModels/diffusion/diffusions.C new file mode 100644 index 0000000000..73c201f0fc --- /dev/null +++ b/src/combustionModels/diffusion/diffusions.C @@ -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 . + +\*---------------------------------------------------------------------------*/ + +#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 + ); +} +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //