From ead82884b3068e51c98a90dff6c5179ab0b171ef Mon Sep 17 00:00:00 2001 From: of Date: Thu, 16 Jun 2022 23:00:09 +0800 Subject: [PATCH 1/3] add orig combustionModerls --- .../ChemistryCombustion/ChemistryCombustion.C | 76 ++++ .../ChemistryCombustion/ChemistryCombustion.H | 106 ++++++ .../CombustionModel/CombustionModel.C | 87 +++++ .../CombustionModel/CombustionModel.H | 139 +++++++ .../CombustionModel/CombustionModels.C | 43 +++ .../ThermoCombustion/ThermoCombustion.C | 74 ++++ .../ThermoCombustion/ThermoCombustion.H | 104 ++++++ src/dfCombustionModels/EDC/EDC.C | 226 ++++++++++++ src/dfCombustionModels/EDC/EDC.H | 214 +++++++++++ src/dfCombustionModels/EDC/EDCs.C | 66 ++++ src/dfCombustionModels/FSD/FSD.C | 343 ++++++++++++++++++ src/dfCombustionModels/FSD/FSD.H | 180 +++++++++ src/dfCombustionModels/FSD/FSDs.C | 98 +++++ .../consumptionSpeed/consumptionSpeed.C | 134 +++++++ .../consumptionSpeed/consumptionSpeed.H | 143 ++++++++ .../reactionRateFlameArea.C | 82 +++++ .../reactionRateFlameArea.H | 164 +++++++++ .../reactionRateFlameAreaNew.C | 69 ++++ .../relaxation/relaxation.C | 169 +++++++++ .../relaxation/relaxation.H | 122 +++++++ src/dfCombustionModels/Make/files | 28 ++ src/dfCombustionModels/Make/options | 20 + src/dfCombustionModels/PaSR/PaSR.C | 135 +++++++ src/dfCombustionModels/PaSR/PaSR.H | 131 +++++++ src/dfCombustionModels/PaSR/PaSRs.C | 42 +++ .../combustionModel/combustionModel.C | 111 ++++++ .../combustionModel/combustionModel.H | 174 +++++++++ .../combustionModel/combustionModelI.H | 58 +++ .../combustionModelTemplates.C | 180 +++++++++ .../combustionModel/makeCombustionTypes.H | 107 ++++++ src/dfCombustionModels/diffusion/diffusion.C | 112 ++++++ src/dfCombustionModels/diffusion/diffusion.H | 124 +++++++ src/dfCombustionModels/diffusion/diffusions.C | 100 +++++ .../functionObjects/Qdot/Qdot.C | 117 ++++++ .../functionObjects/Qdot/Qdot.H | 109 ++++++ .../infinitelyFastChemistry.C | 109 ++++++ .../infinitelyFastChemistry.H | 121 ++++++ .../infinitelyFastChemistrys.C | 100 +++++ src/dfCombustionModels/laminar/laminar.C | 158 ++++++++ src/dfCombustionModels/laminar/laminar.H | 133 +++++++ src/dfCombustionModels/laminar/laminars.C | 42 +++ .../noCombustion/noCombustion.C | 101 ++++++ .../noCombustion/noCombustion.H | 118 ++++++ .../noCombustion/noCombustions.C | 42 +++ .../greyMeanCombustion/greyMeanCombustion.C | 89 +++++ .../greyMeanCombustion/greyMeanCombustion.H | 103 ++++++ .../wideBandCombustion/wideBandCombustion.C | 102 ++++++ .../wideBandCombustion/wideBandCombustion.H | 101 ++++++ .../singleStepCombustion.C | 159 ++++++++ .../singleStepCombustion.H | 126 +++++++ .../zoneCombustion/zoneCombustion.C | 197 ++++++++++ .../zoneCombustion/zoneCombustion.H | 145 ++++++++ .../zoneCombustion/zoneCombustions.C | 42 +++ 53 files changed, 6175 insertions(+) create mode 100644 src/dfCombustionModels/CombustionModel/ChemistryCombustion/ChemistryCombustion.C create mode 100644 src/dfCombustionModels/CombustionModel/ChemistryCombustion/ChemistryCombustion.H create mode 100644 src/dfCombustionModels/CombustionModel/CombustionModel/CombustionModel.C create mode 100644 src/dfCombustionModels/CombustionModel/CombustionModel/CombustionModel.H create mode 100644 src/dfCombustionModels/CombustionModel/CombustionModel/CombustionModels.C create mode 100644 src/dfCombustionModels/CombustionModel/ThermoCombustion/ThermoCombustion.C create mode 100644 src/dfCombustionModels/CombustionModel/ThermoCombustion/ThermoCombustion.H create mode 100644 src/dfCombustionModels/EDC/EDC.C create mode 100644 src/dfCombustionModels/EDC/EDC.H create mode 100644 src/dfCombustionModels/EDC/EDCs.C create mode 100644 src/dfCombustionModels/FSD/FSD.C create mode 100644 src/dfCombustionModels/FSD/FSD.H create mode 100644 src/dfCombustionModels/FSD/FSDs.C create mode 100644 src/dfCombustionModels/FSD/reactionRateFlameAreaModels/consumptionSpeed/consumptionSpeed.C create mode 100644 src/dfCombustionModels/FSD/reactionRateFlameAreaModels/consumptionSpeed/consumptionSpeed.H create mode 100644 src/dfCombustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameArea.C create mode 100644 src/dfCombustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameArea.H create mode 100644 src/dfCombustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameAreaNew.C create mode 100644 src/dfCombustionModels/FSD/reactionRateFlameAreaModels/relaxation/relaxation.C create mode 100644 src/dfCombustionModels/FSD/reactionRateFlameAreaModels/relaxation/relaxation.H create mode 100644 src/dfCombustionModels/Make/files create mode 100644 src/dfCombustionModels/Make/options create mode 100644 src/dfCombustionModels/PaSR/PaSR.C create mode 100644 src/dfCombustionModels/PaSR/PaSR.H create mode 100644 src/dfCombustionModels/PaSR/PaSRs.C create mode 100644 src/dfCombustionModels/combustionModel/combustionModel.C create mode 100644 src/dfCombustionModels/combustionModel/combustionModel.H create mode 100644 src/dfCombustionModels/combustionModel/combustionModelI.H create mode 100644 src/dfCombustionModels/combustionModel/combustionModelTemplates.C create mode 100644 src/dfCombustionModels/combustionModel/makeCombustionTypes.H create mode 100644 src/dfCombustionModels/diffusion/diffusion.C create mode 100644 src/dfCombustionModels/diffusion/diffusion.H create mode 100644 src/dfCombustionModels/diffusion/diffusions.C create mode 100644 src/dfCombustionModels/functionObjects/Qdot/Qdot.C create mode 100644 src/dfCombustionModels/functionObjects/Qdot/Qdot.H create mode 100644 src/dfCombustionModels/infinitelyFastChemistry/infinitelyFastChemistry.C create mode 100644 src/dfCombustionModels/infinitelyFastChemistry/infinitelyFastChemistry.H create mode 100644 src/dfCombustionModels/infinitelyFastChemistry/infinitelyFastChemistrys.C create mode 100644 src/dfCombustionModels/laminar/laminar.C create mode 100644 src/dfCombustionModels/laminar/laminar.H create mode 100644 src/dfCombustionModels/laminar/laminars.C create mode 100644 src/dfCombustionModels/noCombustion/noCombustion.C create mode 100644 src/dfCombustionModels/noCombustion/noCombustion.H create mode 100644 src/dfCombustionModels/noCombustion/noCombustions.C create mode 100644 src/dfCombustionModels/radiationModels/absorptionEmissionModels/greyMeanCombustion/greyMeanCombustion.C create mode 100644 src/dfCombustionModels/radiationModels/absorptionEmissionModels/greyMeanCombustion/greyMeanCombustion.H create mode 100644 src/dfCombustionModels/radiationModels/absorptionEmissionModels/wideBandCombustion/wideBandCombustion.C create mode 100644 src/dfCombustionModels/radiationModels/absorptionEmissionModels/wideBandCombustion/wideBandCombustion.H create mode 100644 src/dfCombustionModels/singleStepCombustion/singleStepCombustion.C create mode 100644 src/dfCombustionModels/singleStepCombustion/singleStepCombustion.H create mode 100644 src/dfCombustionModels/zoneCombustion/zoneCombustion.C create mode 100644 src/dfCombustionModels/zoneCombustion/zoneCombustion.H create mode 100644 src/dfCombustionModels/zoneCombustion/zoneCombustions.C diff --git a/src/dfCombustionModels/CombustionModel/ChemistryCombustion/ChemistryCombustion.C b/src/dfCombustionModels/CombustionModel/ChemistryCombustion/ChemistryCombustion.C new file mode 100644 index 00000000..5041995d --- /dev/null +++ b/src/dfCombustionModels/CombustionModel/ChemistryCombustion/ChemistryCombustion.C @@ -0,0 +1,76 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2012-2018 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 "ChemistryCombustion.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::ChemistryCombustion::ChemistryCombustion +( + const word& modelType, + ReactionThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties +) +: + CombustionModel + ( + modelType, + thermo, + turb, + combustionProperties + ), + chemistryPtr_(BasicChemistryModel::New(thermo)) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template +Foam::ChemistryCombustion:: +~ChemistryCombustion() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +template +ReactionThermo& +Foam::ChemistryCombustion::thermo() +{ + return chemistryPtr_->thermo(); +} + + +template +const ReactionThermo& +Foam::ChemistryCombustion::thermo() const +{ + return chemistryPtr_->thermo(); +} + + +// ************************************************************************* // diff --git a/src/dfCombustionModels/CombustionModel/ChemistryCombustion/ChemistryCombustion.H b/src/dfCombustionModels/CombustionModel/ChemistryCombustion/ChemistryCombustion.H new file mode 100644 index 00000000..bb48b840 --- /dev/null +++ b/src/dfCombustionModels/CombustionModel/ChemistryCombustion/ChemistryCombustion.H @@ -0,0 +1,106 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2012-2018 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 . + +Class + Foam::ChemistryCombustion + +Description + Chemistry model wrapper for combustion models + +SourceFiles + ChemistryCombustion.C + +\*---------------------------------------------------------------------------*/ + +#ifndef ChemistryCombustion_H +#define ChemistryCombustion_H + +#include "autoPtr.H" +#include "CombustionModel.H" +#include "BasicChemistryModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + class ChemistryCombustion Declaration +\*---------------------------------------------------------------------------*/ + +template +class ChemistryCombustion +: + public CombustionModel +{ +protected: + + // Protected data + + //- Pointer to chemistry model + autoPtr> chemistryPtr_; + + +public: + + // Constructors + + //- Construct from components and thermo + ChemistryCombustion + ( + const word& modelType, + ReactionThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties + ); + + + //- Destructor + virtual ~ChemistryCombustion(); + + + // Member Functions + + //- Return access to the thermo package + virtual ReactionThermo& thermo(); + + //- Return const access to the thermo package + virtual const ReactionThermo& thermo() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository + #include "ChemistryCombustion.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/dfCombustionModels/CombustionModel/CombustionModel/CombustionModel.C b/src/dfCombustionModels/CombustionModel/CombustionModel/CombustionModel.C new file mode 100644 index 00000000..e3d546c2 --- /dev/null +++ b/src/dfCombustionModels/CombustionModel/CombustionModel/CombustionModel.C @@ -0,0 +1,87 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2011-2018 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 "CombustionModel.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::CombustionModel::CombustionModel +( + const word& modelType, + ReactionThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties +) +: + combustionModel(modelType, thermo, turb, combustionProperties) +{} + + +// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // + +template +Foam::autoPtr> +Foam::CombustionModel::New +( + ReactionThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties +) +{ + return + combustionModel::New> + ( + thermo, + turb, + combustionProperties + ); +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template +Foam::CombustionModel::~CombustionModel() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +template +bool Foam::CombustionModel::read() +{ + if (combustionModel::read()) + { + return true; + } + else + { + return false; + } +} + + +// ************************************************************************* // diff --git a/src/dfCombustionModels/CombustionModel/CombustionModel/CombustionModel.H b/src/dfCombustionModels/CombustionModel/CombustionModel/CombustionModel.H new file mode 100644 index 00000000..219b435e --- /dev/null +++ b/src/dfCombustionModels/CombustionModel/CombustionModel/CombustionModel.H @@ -0,0 +1,139 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2011-2018 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 . + +Class + Foam::CombustionModel + +Description + Combustion models for templated thermodynamics + +SourceFiles + CombustionModelI.H + CombustionModel.C + CombustionModelNew.C + +\*---------------------------------------------------------------------------*/ + +#ifndef CombustionModel_H +#define CombustionModel_H + +#include "combustionModel.H" +#include "autoPtr.H" +#include "runTimeSelectionTables.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + class CombustionModel Declaration +\*---------------------------------------------------------------------------*/ + +template +class CombustionModel +: + public combustionModel +{ +public: + + //- Thermo type + typedef ReactionThermo reactionThermo; + + + //- Runtime type information + TypeName("CombustionModel"); + + + //- Declare run-time constructor selection tables + declareRunTimeSelectionTable + ( + autoPtr, + CombustionModel, + dictionary, + ( + const word& modelType, + ReactionThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties + ), + (modelType, thermo, turb, combustionProperties) + ); + + + // Constructors + + //- Construct from components + CombustionModel + ( + const word& modelType, + ReactionThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties + ); + + + //- Selector + static autoPtr New + ( + ReactionThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties=combustionPropertiesName + ); + + + //- Destructor + virtual ~CombustionModel(); + + + // Member Functions + + //- Return access to the thermo package + virtual ReactionThermo& thermo() = 0; + + //- Return const access to the thermo package + virtual const ReactionThermo& thermo() const = 0; + + + // IO + + //- Update properties from given dictionary + virtual bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository + #include "CombustionModel.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/dfCombustionModels/CombustionModel/CombustionModel/CombustionModels.C b/src/dfCombustionModels/CombustionModel/CombustionModel/CombustionModels.C new file mode 100644 index 00000000..6348a5a8 --- /dev/null +++ b/src/dfCombustionModels/CombustionModel/CombustionModel/CombustionModels.C @@ -0,0 +1,43 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2011-2018 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 "CombustionModel.H" + +#include "rhoReactionThermo.H" +#include "psiReactionThermo.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +makeCombustion(psiReactionThermo); +makeCombustion(rhoReactionThermo); + +} + +// ************************************************************************* // diff --git a/src/dfCombustionModels/CombustionModel/ThermoCombustion/ThermoCombustion.C b/src/dfCombustionModels/CombustionModel/ThermoCombustion/ThermoCombustion.C new file mode 100644 index 00000000..c2fb017a --- /dev/null +++ b/src/dfCombustionModels/CombustionModel/ThermoCombustion/ThermoCombustion.C @@ -0,0 +1,74 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2012-2018 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 "ThermoCombustion.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::ThermoCombustion::ThermoCombustion +( + const word& modelType, + ReactionThermo& thermo, + const compressibleTurbulenceModel& turb +) +: + CombustionModel + ( + modelType, + thermo, + turb, + combustionModel::combustionPropertiesName + ), + thermo_(thermo) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template +Foam::ThermoCombustion::~ThermoCombustion() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +template +ReactionThermo& +Foam::ThermoCombustion::thermo() +{ + return thermo_; +} + + +template +const ReactionThermo& +Foam::ThermoCombustion::thermo() const +{ + return thermo_; +} + + +// ************************************************************************* // diff --git a/src/dfCombustionModels/CombustionModel/ThermoCombustion/ThermoCombustion.H b/src/dfCombustionModels/CombustionModel/ThermoCombustion/ThermoCombustion.H new file mode 100644 index 00000000..a772f1c2 --- /dev/null +++ b/src/dfCombustionModels/CombustionModel/ThermoCombustion/ThermoCombustion.H @@ -0,0 +1,104 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2012-2018 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 . + +Class + Foam::ThermoCombustion + +Description + Thermo model wrapper for combustion models + +SourceFiles + ThermoCombustion.C + +\*---------------------------------------------------------------------------*/ + +#ifndef ThermoCombustion_H +#define ThermoCombustion_H + +#include "autoPtr.H" +#include "CombustionModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + class ThermoCombustion Declaration +\*---------------------------------------------------------------------------*/ + +template +class ThermoCombustion +: + public CombustionModel +{ +protected: + + // Protected data + + //- Thermo + ReactionThermo& thermo_; + + +public: + + // Constructors + + //- Construct from components + ThermoCombustion + ( + const word& modelType, + ReactionThermo& thermo, + const compressibleTurbulenceModel& turb + ); + + + //- Destructor + virtual ~ThermoCombustion(); + + + // Member Functions + + //- Return access to the thermo package + virtual ReactionThermo& thermo(); + + //- Return const access to the thermo package + virtual const ReactionThermo& thermo() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository + #include "ThermoCombustion.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/dfCombustionModels/EDC/EDC.C b/src/dfCombustionModels/EDC/EDC.C new file mode 100644 index 00000000..762a563d --- /dev/null +++ b/src/dfCombustionModels/EDC/EDC.C @@ -0,0 +1,226 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2017-2018 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 "EDC.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::combustionModels::EDC::EDC +( + const word& modelType, + ReactionThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties +) +: + laminar(modelType, thermo, turb, combustionProperties), + version_ + ( + EDCversionNames + [ + this->coeffs().lookupOrDefault + ( + "version", + word(EDCversionNames[EDCdefaultVersion]) + ) + ] + ), + C1_(this->coeffs().lookupOrDefault("C1", 0.05774)), + C2_(this->coeffs().lookupOrDefault("C2", 0.5)), + Cgamma_(this->coeffs().lookupOrDefault("Cgamma", 2.1377)), + Ctau_(this->coeffs().lookupOrDefault("Ctau", 0.4083)), + exp1_(this->coeffs().lookupOrDefault("exp1", EDCexp1[int(version_)])), + exp2_(this->coeffs().lookupOrDefault("exp2", EDCexp2[int(version_)])), + kappa_ + ( + IOobject + ( + this->thermo().phasePropertyName(typeName + ":kappa"), + this->mesh().time().timeName(), + this->mesh(), + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + this->mesh(), + dimensionedScalar(dimless, 0) + ) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template +Foam::combustionModels::EDC::~EDC() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +template +void Foam::combustionModels::EDC::correct() +{ + tmp tepsilon(this->turbulence().epsilon()); + const volScalarField& epsilon = tepsilon(); + + tmp tmu(this->turbulence().mu()); + const volScalarField& mu = tmu(); + + tmp tk(this->turbulence().k()); + const volScalarField& k = tk(); + + tmp trho(this->rho()); + const volScalarField& rho = trho(); + + scalarField tauStar(epsilon.size(), 0); + + if (version_ == EDCversions::v2016) + { + tmp ttc(this->chemistryPtr_->tc()); + const volScalarField& tc = ttc(); + + forAll(tauStar, i) + { + const scalar nu = mu[i]/(rho[i] + small); + + const scalar Da = + max(min(sqrt(nu/(epsilon[i] + small))/tc[i], 10), 1e-10); + + const scalar ReT = sqr(k[i])/(nu*epsilon[i] + small); + const scalar CtauI = min(C1_/(Da*sqrt(ReT + 1)), 2.1377); + + const scalar CgammaI = + max(min(C2_*sqrt(Da*(ReT + 1)), 5), 0.4082); + + const scalar gammaL = + CgammaI*pow025(nu*epsilon[i]/(sqr(k[i]) + small)); + + tauStar[i] = CtauI*sqrt(nu/(epsilon[i] + small)); + + if (gammaL >= 1) + { + kappa_[i] = 1; + } + else + { + kappa_[i] = + max + ( + min + ( + pow(gammaL, exp1_)/(1 - pow(gammaL, exp2_)), + 1 + ), + 0 + ); + } + } + } + else + { + forAll(tauStar, i) + { + const scalar nu = mu[i]/(rho[i] + small); + const scalar gammaL = + Cgamma_*pow025(nu*epsilon[i]/(sqr(k[i]) + small)); + + tauStar[i] = Ctau_*sqrt(nu/(epsilon[i] + small)); + if (gammaL >= 1) + { + kappa_[i] = 1; + } + else + { + kappa_[i] = + max + ( + min + ( + pow(gammaL, exp1_)/(1 - pow(gammaL, exp2_)), + 1 + ), + 0 + ); + } + } + } + + this->chemistryPtr_->solve(tauStar); +} + + +template +Foam::tmp +Foam::combustionModels::EDC::R(volScalarField& Y) const +{ + return kappa_*laminar::R(Y); +} + + +template +Foam::tmp +Foam::combustionModels::EDC::Qdot() const +{ + return volScalarField::New + ( + this->thermo().phasePropertyName(typeName + ":Qdot"), + kappa_*this->chemistryPtr_->Qdot() + ); +} + + +template +bool Foam::combustionModels::EDC::read() +{ + if (laminar::read()) + { + version_ = + ( + EDCversionNames + [ + this->coeffs().lookupOrDefault + ( + "version", + word(EDCversionNames[EDCdefaultVersion]) + ) + ] + ); + C1_ = this->coeffs().lookupOrDefault("C1", 0.05774); + C2_ = this->coeffs().lookupOrDefault("C2", 0.5); + Cgamma_ = this->coeffs().lookupOrDefault("Cgamma", 2.1377); + Ctau_ = this->coeffs().lookupOrDefault("Ctau", 0.4083); + exp1_ = this->coeffs().lookupOrDefault("exp1", EDCexp1[int(version_)]); + exp2_ = this->coeffs().lookupOrDefault("exp2", EDCexp2[int(version_)]); + + return true; + } + else + { + return false; + } +} + + +// ************************************************************************* // diff --git a/src/dfCombustionModels/EDC/EDC.H b/src/dfCombustionModels/EDC/EDC.H new file mode 100644 index 00000000..74b24509 --- /dev/null +++ b/src/dfCombustionModels/EDC/EDC.H @@ -0,0 +1,214 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2017-2019 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 . + +Class + Foam::combustionModels::EDC + +Description + Eddy Dissipation Concept (EDC) turbulent combustion model. + + This model considers that the reaction occurs in the regions of the flow + where the dissipation of turbulence kinetic energy takes place (fine + structures). The mass fraction of the fine structures and the mean residence + time are provided by an energy cascade model. + + There are many versions and developments of the EDC model, 4 of which are + currently supported in this implementation: v1981, v1996, v2005 and + v2016. The model variant is selected using the optional \c version entry in + the \c EDCCoeffs dictionary, \eg + + \verbatim + EDCCoeffs + { + version v2016; + } + \endverbatim + + The default version is \c v2005 if the \c version entry is not specified. + + Model versions and references: + \verbatim + Version v2005: + + Cgamma = 2.1377 + Ctau = 0.4083 + kappa = gammaL^exp1 / (1 - gammaL^exp2), + + where exp1 = 2, and exp2 = 2. + + Magnussen, B. F. (2005, June). + The Eddy Dissipation Concept - + A Bridge Between Science and Technology. + In ECCOMAS thematic conference on computational combustion + (pp. 21-24). + + Version v1981: + + Changes coefficients exp1 = 3 and exp2 = 3 + + Magnussen, B. (1981, January). + On the structure of turbulence and a generalized + eddy dissipation concept for chemical reaction in turbulent flow. + In 19th Aerospace Sciences Meeting (p. 42). + + Version v1996: + + Changes coefficients exp1 = 2 and exp2 = 3 + + Gran, I. R., & Magnussen, B. F. (1996). + A numerical study of a bluff-body stabilized diffusion flame. + Part 2. Influence of combustion modeling and finite-rate chemistry. + Combustion Science and Technology, 119(1-6), 191-217. + + Version v2016: + + Use local constants computed from the turbulent Da and Re numbers. + + Parente, A., Malik, M. R., Contino, F., Cuoci, A., & Dally, B. B. + (2016). + Extension of the Eddy Dissipation Concept for + turbulence/chemistry interactions to MILD combustion. + Fuel, 163, 98-111. + \endverbatim + +SourceFiles + EDC.C + +\*---------------------------------------------------------------------------*/ + +#ifndef EDC_H +#define EDC_H + +#include "../laminar/laminar.H" +#include "NamedEnum.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace combustionModels +{ + +//- EDC model versions +enum class EDCversions +{ + v1981, + v1996, + v2005, + v2016 +}; + +extern const NamedEnum EDCversionNames; +extern const EDCversions EDCdefaultVersion; + +const scalar EDCexp1[] = {3, 2, 2, 2}; +const scalar EDCexp2[] = {3, 3, 2, 2}; + +/*---------------------------------------------------------------------------*\ + Class EDC Declaration +\*---------------------------------------------------------------------------*/ + +template +class EDC +: + public laminar +{ + // Private Data + + //- The selected model version + EDCversions version_; + + scalar C1_; + scalar C2_; + scalar Cgamma_; + scalar Ctau_; + scalar exp1_; + scalar exp2_; + + //- Mixing parameter + volScalarField kappa_; + + +public: + + //- Runtime type information + TypeName("EDC"); + + + // Constructors + + //- Construct from components + EDC + ( + const word& modelType, + ReactionThermo& type, + const compressibleTurbulenceModel& turb, + const word& combustionProperties + ); + + //- Disallow default bitwise copy construction + EDC(const EDC&); + + + //- Destructor + virtual ~EDC(); + + + // Member Functions + + //- Correct combustion rate + virtual void correct(); + + //- Fuel consumption rate matrix. + virtual tmp R(volScalarField& Y) const; + + //- Heat release rate [kg/m/s^3] + virtual tmp Qdot() const; + + //- Update properties from given dictionary + virtual bool read(); + + + // Member Operators + + //- Disallow default bitwise assignment + void operator=(const EDC&) = delete; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace combustionModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository + #include "EDC.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/dfCombustionModels/EDC/EDCs.C b/src/dfCombustionModels/EDC/EDCs.C new file mode 100644 index 00000000..2003ad07 --- /dev/null +++ b/src/dfCombustionModels/EDC/EDCs.C @@ -0,0 +1,66 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2017-2018 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 "psiReactionThermo.H" +#include "rhoReactionThermo.H" +#include "EDC.H" + +// * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * * // + +template<> +const char* Foam::NamedEnum +< + Foam::combustionModels::EDCversions, + 4 +>::names[] = +{ + "v1981", + "v1996", + "v2005", + "v2016" +}; + +const Foam::NamedEnum + Foam::combustionModels::EDCversionNames; + +const Foam::combustionModels::EDCversions +Foam::combustionModels::EDCdefaultVersion +( + Foam::combustionModels::EDCversions::v2005 +); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +makeCombustionTypes(EDC, psiReactionThermo); +makeCombustionTypes(EDC, rhoReactionThermo); + +} + +// ************************************************************************* // diff --git a/src/dfCombustionModels/FSD/FSD.C b/src/dfCombustionModels/FSD/FSD.C new file mode 100644 index 00000000..36d27a64 --- /dev/null +++ b/src/dfCombustionModels/FSD/FSD.C @@ -0,0 +1,343 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2011-2018 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 "FSD.H" +#include "addToRunTimeSelectionTable.H" +#include "LESModel.H" +#include "fvcGrad.H" +#include "fvcDiv.H" + +namespace Foam +{ +namespace combustionModels +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +FSD::FSD +( + const word& modelType, + ReactionThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties +) +: + singleStepCombustion + ( + modelType, + thermo, + turb, + combustionProperties + ), + reactionRateFlameArea_ + ( + reactionRateFlameArea::New + ( + this->coeffs(), + this->mesh(), + *this + ) + ), + ft_ + ( + IOobject + ( + this->thermo().phasePropertyName("ft"), + this->mesh().time().timeName(), + this->mesh(), + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + this->mesh(), + dimensionedScalar(dimless, 0) + ), + YFuelFuelStream_(dimensionedScalar(dimless, 1.0)), + YO2OxiStream_(dimensionedScalar(dimless, 0.23)), + Cv_(readScalar(this->coeffs().lookup("Cv"))), + C_(5.0), + ftMin_(0.0), + ftMax_(1.0), + ftDim_(300), + ftVarMin_(readScalar(this->coeffs().lookup("ftVarMin"))) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template +FSD::~FSD() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +template +void FSD::calculateSourceNorm() +{ + this->singleMixturePtr_->fresCorrect(); + + const label fuelI = this->singleMixturePtr_->fuelIndex(); + + const volScalarField& YFuel = this->thermo().composition().Y()[fuelI]; + + const volScalarField& YO2 = this->thermo().composition().Y("O2"); + + const dimensionedScalar s = this->singleMixturePtr_->s(); + + ft_ = + (s*YFuel - (YO2 - YO2OxiStream_))/(s*YFuelFuelStream_ + YO2OxiStream_); + + + volVectorField nft(fvc::grad(ft_)); + + volScalarField mgft(mag(nft)); + + surfaceVectorField SfHat(this->mesh().Sf()/this->mesh().magSf()); + + volScalarField cAux(scalar(1) - ft_); + + dimensionedScalar dMgft = 1.0e-3* + (ft_*cAux*mgft)().weightedAverage(this->mesh().V()) + /((ft_*cAux)().weightedAverage(this->mesh().V()) + small) + + dimensionedScalar(mgft.dimensions(), small); + + mgft += dMgft; + + nft /= mgft; + + const volVectorField& U = YO2.db().lookupObject("U"); + + const volScalarField sigma + ( + (nft & nft)*fvc::div(U) - (nft & fvc::grad(U) & nft) + ); + + reactionRateFlameArea_->correct(sigma); + + const volScalarField& omegaFuel = reactionRateFlameArea_->omega(); + + + const scalar ftStoich = + YO2OxiStream_.value() + /( + s.value()*YFuelFuelStream_.value() + YO2OxiStream_.value() + ); + + tmp tPc + ( + volScalarField::New + ( + this->thermo().phasePropertyName("Pc"), + U.mesh(), + dimensionedScalar(dimless, 0) + ) + ); + + volScalarField& pc = tPc.ref(); + + tmp tomegaFuel + ( + volScalarField::New + ( + this->thermo().phasePropertyName("omegaFuelBar"), + U.mesh(), + dimensionedScalar(omegaFuel.dimensions(), 0) + ) + ); + + volScalarField& omegaFuelBar = tomegaFuel.ref(); + + // Calculation of the mixture fraction variance (ftVar) + const compressible::LESModel& lesModel = + YO2.db().lookupObject + ( + turbulenceModel::propertiesName + ); + + const volScalarField& delta = lesModel.delta(); + const volScalarField ftVar(Cv_*sqr(delta)*sqr(mgft)); + + // Thickened flame (average flame thickness for counterflow configuration + // is 1.5 mm) + + volScalarField deltaF + ( + lesModel.delta()/dimensionedScalar(dimLength, 1.5e-3) + ); + + // Linear correlation between delta and flame thickness + volScalarField omegaF(max(deltaF*(4.0/3.0) + (2.0/3.0), scalar(1))); + + scalar deltaFt = 1.0/ftDim_; + + forAll(ft_, celli) + { + if (ft_[celli] > ftMin_ && ft_[celli] < ftMax_) + { + scalar ftCell = ft_[celli]; + + if (ftVar[celli] > ftVarMin_) // sub-grid beta pdf of ft_ + { + scalar ftVarc = ftVar[celli]; + scalar a = + max(ftCell*(ftCell*(1.0 - ftCell)/ftVarc - 1.0), 0.0); + scalar b = max(a/ftCell - a, 0.0); + + for (int i=1; i productsIndex(2, label(-1)); + { + label i = 0; + forAll(this->singleMixturePtr_->specieProd(), specieI) + { + if (this->singleMixturePtr_->specieProd()[specieI] < 0) + { + productsIndex[i] = specieI; + i++; + } + } + } + + + // Flamelet probability of the progress c based on IFC (reuse pc) + scalar YprodTotal = 0; + forAll(productsIndex, j) + { + YprodTotal += this->singleMixturePtr_->Yprod0()[productsIndex[j]]; + } + + forAll(ft_, celli) + { + if (ft_[celli] < ftStoich) + { + pc[celli] = ft_[celli]*(YprodTotal/ftStoich); + } + else + { + pc[celli] = (1.0 - ft_[celli])*(YprodTotal/(1.0 - ftStoich)); + } + } + + tmp tproducts + ( + volScalarField::New + ( + this->thermo().phasePropertyName("products"), + U.mesh(), + dimensionedScalar(dimless, 0) + ) + ); + + volScalarField& products = tproducts.ref(); + + forAll(productsIndex, j) + { + label specieI = productsIndex[j]; + const volScalarField& Yp = this->thermo().composition().Y()[specieI]; + products += Yp; + } + + volScalarField c + ( + max(scalar(1) - products/max(pc, scalar(1e-5)), scalar(0)) + ); + + pc = min(C_*c, scalar(1)); + + const volScalarField fres(this->singleMixturePtr_->fres(fuelI)); + + this->wFuel_ == mgft*pc*omegaFuelBar; +} + + +template +void FSD::correct() +{ + this->wFuel_ == + dimensionedScalar(dimMass/pow3(dimLength)/dimTime, 0); + + calculateSourceNorm(); +} + + +template +bool FSD::read() +{ + if (singleStepCombustion::read()) + { + this->coeffs().lookup("Cv") >> Cv_ ; + this->coeffs().lookup("ftVarMin") >> ftVarMin_; + reactionRateFlameArea_->read(this->coeffs()); + return true; + } + else + { + return false; + } +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace combustionModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/dfCombustionModels/FSD/FSD.H b/src/dfCombustionModels/FSD/FSD.H new file mode 100644 index 00000000..1cf72093 --- /dev/null +++ b/src/dfCombustionModels/FSD/FSD.H @@ -0,0 +1,180 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2011-2019 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 . + +Class + Foam::combustionModels::FSD + +Description + + Flame Surface Dennsity (FDS) combustion model. + + The fuel source term is given by mgft*pc*omegaFuelBar. + + where: + mgft: filtered flame area. + pc: probability of the combustion progress. + omegaFuelBar: filtered consumption speed per unit of flame area. + + pc is considered from the IFC solution. + omegaFuelBar is calculated solving a relaxation equation which tends to + omegaEq. This omegaEq is obtained from the flamelet solution for + different strain rates and fit using a expential distribution. + + The spacial distribution of the consumption speed (omega) is obtained also + from a strained flamelet solution and it is assumed to have a gaussian + distribution. + + If the grid resolution is not enough to resolve the flame, the consumption + speed distribution is linearly thickened conserving the overall heat + release. + + If the turbulent fluctuation of the mixture fraction at the sub-grid level + is large (>1e-04) then a beta pdf is used for filtering. + + At the moment the flame area combustion model is only fit to work in a LES + frame work. In RAS the subgrid fluctuation has to be solved by an extra + transport equation. + +SourceFiles + FSD.C + +\*---------------------------------------------------------------------------*/ + +#ifndef FSD_H +#define FSD_H + +#include "singleStepCombustion.H" +#include "reactionRateFlameArea.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace combustionModels +{ + +/*---------------------------------------------------------------------------*\ + Class FSD Declaration +\*---------------------------------------------------------------------------*/ + +template +class FSD +: + public singleStepCombustion +{ + // Private Data + + //- Auto pointer to consumption speed per unit of flame area model + autoPtr reactionRateFlameArea_; + + //- Mixture fraction + volScalarField ft_; + + //- Fuel mass concentration on the fuel stream + dimensionedScalar YFuelFuelStream_; + + //- Oxygen mass concentration on the oxydizer stream + dimensionedScalar YO2OxiStream_; + + //- Similarity constant for the sub-grid ft fluctuations + scalar Cv_; + + //- Model constant + scalar C_; + + //- Lower flammability limit + scalar ftMin_; + + //- Upper flammability limit + scalar ftMax_; + + //- Dimension of the ft space. Used to integrate the beta-pdf + scalar ftDim_; + + //- Minimum mixture freaction variance to calculate pdf + scalar ftVarMin_; + + + // Private Member Functions + + //- Calculate the normalised fuel source term + void calculateSourceNorm(); + + +public: + + //- Runtime type information + TypeName("FSD"); + + + // Constructors + + //- Construct from components + FSD + ( + const word& modelType, + ReactionThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties + ); + + //- Disallow default bitwise copy construction + FSD(const FSD&); + + + //- Destructor + virtual ~FSD(); + + + // Member Functions + + //- Correct combustion rate + virtual void correct(); + + //- Update properties + virtual bool read(); + + + // Member Operators + + //- Disallow default bitwise assignment + void operator=(const FSD&) = delete; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace combustionModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository + #include "FSD.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/dfCombustionModels/FSD/FSDs.C b/src/dfCombustionModels/FSD/FSDs.C new file mode 100644 index 00000000..28d07399 --- /dev/null +++ b/src/dfCombustionModels/FSD/FSDs.C @@ -0,0 +1,98 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2011-2018 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 "psiReactionThermo.H" +#include "rhoReactionThermo.H" +#include "FSD.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Combustion models based on sensibleEnthalpy +makeCombustionTypesThermo +( + FSD, + psiReactionThermo, + gasHThermoPhysics +); + +makeCombustionTypesThermo +( + FSD, + psiReactionThermo, + constGasHThermoPhysics +); + +makeCombustionTypesThermo +( + FSD, + rhoReactionThermo, + gasHThermoPhysics +); + +makeCombustionTypesThermo +( + FSD, + rhoReactionThermo, + constGasHThermoPhysics +); + +// Combustion models based on sensibleInternalEnergy +makeCombustionTypesThermo +( + FSD, + psiReactionThermo, + gasEThermoPhysics +); + +makeCombustionTypesThermo +( + FSD, + psiReactionThermo, + constGasEThermoPhysics +); + +makeCombustionTypesThermo +( + FSD, + rhoReactionThermo, + gasEThermoPhysics +); + +makeCombustionTypesThermo +( + FSD, + rhoReactionThermo, + constGasEThermoPhysics +); + +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/dfCombustionModels/FSD/reactionRateFlameAreaModels/consumptionSpeed/consumptionSpeed.C b/src/dfCombustionModels/FSD/reactionRateFlameAreaModels/consumptionSpeed/consumptionSpeed.C new file mode 100644 index 00000000..385c90a9 --- /dev/null +++ b/src/dfCombustionModels/FSD/reactionRateFlameAreaModels/consumptionSpeed/consumptionSpeed.C @@ -0,0 +1,134 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2011-2018 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 "consumptionSpeed.H" + +/* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */ + +namespace Foam +{ + defineTypeNameAndDebug(consumptionSpeed, 0); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::consumptionSpeed::consumptionSpeed +( + const dictionary& dict +) +: omega0_(readScalar(dict.lookup("omega0"))), + eta_(readScalar(dict.lookup("eta"))), + sigmaExt_(readScalar(dict.lookup("sigmaExt"))), + omegaMin_(readScalar(dict.lookup("omegaMin"))) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::consumptionSpeed::~consumptionSpeed() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +Foam::scalar Foam::consumptionSpeed::omega0Sigma +( + scalar sigma, + 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; +} + + +Foam::tmp Foam::consumptionSpeed::omega0Sigma +( + const volScalarField& sigma +) +{ + tmp tomega0 + ( + volScalarField::New + ( + "omega0", + sigma.mesh(), + dimensionedScalar + ( + dimensionSet(1, -2, -1, 0, 0, 0, 0), + 0 + ) + ) + ); + + volScalarField& omega0 = tomega0.ref(); + + volScalarField::Internal& iomega0 = omega0; + + forAll(iomega0, celli) + { + iomega0[celli] = omega0Sigma(sigma[celli], 1.0); + } + + volScalarField::Boundary& bomega0 = omega0.boundaryFieldRef(); + + forAll(bomega0, patchi) + { + forAll(bomega0[patchi], facei) + { + bomega0[patchi][facei] = + omega0Sigma + ( + sigma.boundaryField()[patchi][facei], + 1.0 + ); + } + } + + return tomega0; +} + + +void Foam::consumptionSpeed::read(const dictionary& dict) +{ + dict.lookup("omega0") >> omega0_ ; + dict.lookup("eta") >> eta_ ; + dict.lookup("sigmaExt") >> sigmaExt_; + dict.lookup("omegaMin") >> omegaMin_; +} + + +// ************************************************************************* // diff --git a/src/dfCombustionModels/FSD/reactionRateFlameAreaModels/consumptionSpeed/consumptionSpeed.H b/src/dfCombustionModels/FSD/reactionRateFlameAreaModels/consumptionSpeed/consumptionSpeed.H new file mode 100644 index 00000000..c10b3b1b --- /dev/null +++ b/src/dfCombustionModels/FSD/reactionRateFlameAreaModels/consumptionSpeed/consumptionSpeed.H @@ -0,0 +1,143 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2011-2019 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 . + +Class + Foam::consumptionSpeed + +Description + Correlation function for laminar consumption speed obtained from flamelet + solution at increasing strain rates. + +SourceFiles + consumptionSpeed.C + +\*---------------------------------------------------------------------------*/ + +#ifndef consumptionSpeed_H +#define consumptionSpeed_H + +#include "IOdictionary.H" +#include "volFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class consumptionSpeed Declaration +\*---------------------------------------------------------------------------*/ + +class consumptionSpeed +{ + // Private Data + + //- Maximum consumption speed + scalar omega0_; + + //- Exponential factor + scalar eta_; + + //- Extinction strain + scalar sigmaExt_; + + //- Minimum consumption speed + scalar omegaMin_; + + + // Private Member Functions + + //- Return consumption rate + scalar omega0Sigma(scalar sigma, scalar a) const; + + +public: + + //- Runtime type information + TypeName("consumptionSpeed"); + + + // Constructors + + //- Construct from dictionary + consumptionSpeed(const dictionary& dict); + + //- Disallow default bitwise copy construction + consumptionSpeed(const consumptionSpeed&); + + + //- Destructor + virtual ~consumptionSpeed(); + + + // Member Functions + + //- Return speed consumption rate temp + tmp omega0Sigma(const volScalarField& sigma); + + + // Access functions + + scalar omega0() const + { + return omega0_; + } + + scalar eta() const + { + return eta_; + } + + scalar sigmaExt() const + { + return sigmaExt_; + } + + scalar omegaMin() const + { + return omegaMin_; + } + + + // IO + + //- Update properties + void read(const dictionary& dict); + + + // Member Operators + + //- Disallow default bitwise assignment + void operator=(const consumptionSpeed&) = delete; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/dfCombustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameArea.C b/src/dfCombustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameArea.C new file mode 100644 index 00000000..034f6132 --- /dev/null +++ b/src/dfCombustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameArea.C @@ -0,0 +1,82 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2011-2018 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 "reactionRateFlameArea.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(reactionRateFlameArea, 0); + defineRunTimeSelectionTable(reactionRateFlameArea, dictionary); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::reactionRateFlameArea::reactionRateFlameArea +( + const word& modelType, + const dictionary& dict, + const fvMesh& mesh, + const combustionModel& combModel +) +: + coeffDict_(dict.optionalSubDict(modelType + "Coeffs")), + mesh_(mesh), + combModel_(combModel), + fuel_(dict.lookup("fuel")), + omega_ + ( + IOobject + ( + "FSDomega", + mesh_.time().timeName(), + mesh_, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh_ + ) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::reactionRateFlameArea::~reactionRateFlameArea() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +bool Foam::reactionRateFlameArea::read(const dictionary& dict) +{ + dict.lookup("fuel") >> fuel_; + + return true; +} + + +// ************************************************************************* // diff --git a/src/dfCombustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameArea.H b/src/dfCombustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameArea.H new file mode 100644 index 00000000..a7b8ee0d --- /dev/null +++ b/src/dfCombustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameArea.H @@ -0,0 +1,164 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2011-2019 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 . + +Class + Foam::reactionRateFlameArea + +Description + Abstract class for reaction rate per flame area unit + +SourceFiles + reactionRateFlameArea.C + reactionRateFlameAreaNew.C + +\*---------------------------------------------------------------------------*/ + +#ifndef reactionRateFlameArea_H +#define reactionRateFlameArea_H + +#include "runTimeSelectionTables.H" +#include "dictionary.H" +#include "autoPtr.H" +#include "volFields.H" +#include "combustionModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +class fvMesh; + +/*---------------------------------------------------------------------------*\ + Class reactionRateFlameArea Declaration +\*---------------------------------------------------------------------------*/ + +class reactionRateFlameArea +{ + +protected: + + // Protected data + + //- Dictionary + dictionary coeffDict_; + + //- Mesh reference + const fvMesh& mesh_; + + //- Combstion model owner + const combustionModel& combModel_; + + //- Fuel name + word fuel_; + + //- Fuel consumption rate per unit of flame area + volScalarField omega_; + + +public: + + //- Runtime type information + TypeName("reactionRateFlameArea"); + + + // Declare run-time constructor selection table + + declareRunTimeSelectionTable + ( + autoPtr, + reactionRateFlameArea, + dictionary, + ( + const word modelType, + const dictionary& dict, + const fvMesh& mesh, + const combustionModel& combModel + ), + (modelType, dict, mesh, combModel) + ); + + + // Constructors + + //- Construct from components + reactionRateFlameArea + ( + const word& modelType, + const dictionary& dict, + const fvMesh& mesh, + const combustionModel& combModel + ); + + //- Disallow default bitwise copy construction + reactionRateFlameArea(const reactionRateFlameArea&); + + + // Selector + + static autoPtr New + ( + const dictionary& dict, + const fvMesh& mesh, + const combustionModel& combModel + ); + + + // Destructor + + virtual ~reactionRateFlameArea(); + + + // Member Functions + + //- Access functions + + //- Return omega + const volScalarField& omega() const + { + return omega_; + } + + + //- Correct omega + virtual void correct(const volScalarField& sigma) = 0; + + //- Update from dictionary + virtual bool read(const dictionary& dictProperties); + + + // Member Operators + + //- Disallow default bitwise assignment + void operator=(const reactionRateFlameArea&) = delete; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/dfCombustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameAreaNew.C b/src/dfCombustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameAreaNew.C new file mode 100644 index 00000000..7d465999 --- /dev/null +++ b/src/dfCombustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameAreaNew.C @@ -0,0 +1,69 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2011-2018 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 "reactionRateFlameArea.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +Foam::autoPtr Foam::reactionRateFlameArea::New +( + const dictionary& dict, + const fvMesh& mesh, + const combustionModel& combModel +) +{ + word reactionRateFlameAreaType + ( + dict.lookup("reactionRateFlameArea") + ); + + Info<< "Selecting reaction rate flame area correlation " + << reactionRateFlameAreaType << endl; + + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(reactionRateFlameAreaType); + + if (cstrIter == dictionaryConstructorTablePtr_->end()) + { + FatalIOErrorInFunction + ( + dict + ) << "Unknown reactionRateFlameArea type " + << reactionRateFlameAreaType << endl << endl + << "Valid reaction rate flame area types are :" << endl + << dictionaryConstructorTablePtr_->toc() + << exit(FatalIOError); + } + + const label tempOpen = reactionRateFlameAreaType.find('<'); + + const word className = reactionRateFlameAreaType(0, tempOpen); + + return autoPtr + (cstrIter()(className, dict, mesh, combModel)); +} + + +// ************************************************************************* // diff --git a/src/dfCombustionModels/FSD/reactionRateFlameAreaModels/relaxation/relaxation.C b/src/dfCombustionModels/FSD/reactionRateFlameAreaModels/relaxation/relaxation.C new file mode 100644 index 00000000..0edab693 --- /dev/null +++ b/src/dfCombustionModels/FSD/reactionRateFlameAreaModels/relaxation/relaxation.C @@ -0,0 +1,169 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2011-2018 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 "relaxation.H" +#include "addToRunTimeSelectionTable.H" +#include "fvm.H" +#include "LESModel.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace reactionRateFlameAreaModels +{ + defineTypeNameAndDebug(relaxation, 0); + addToRunTimeSelectionTable + ( + reactionRateFlameArea, + relaxation, + dictionary + ); +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::reactionRateFlameAreaModels::relaxation::relaxation +( + const word modelType, + const dictionary& dict, + const fvMesh& mesh, + const combustionModel& combModel +) +: + reactionRateFlameArea(modelType, dict, mesh, combModel), + correlation_(dict.optionalSubDict(typeName + "Coeffs").subDict(fuel_)), + C_(readScalar(dict.optionalSubDict(typeName + "Coeffs").lookup("C"))), + alpha_ + ( + readScalar(dict.optionalSubDict(typeName + "Coeffs").lookup("alpha")) + ) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::reactionRateFlameAreaModels::relaxation::~relaxation() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +void Foam::reactionRateFlameAreaModels::relaxation::correct +( + const volScalarField& sigma +) +{ + dimensionedScalar omega0 + ( + "omega0", + dimensionSet(1, -2, -1, 0, 0, 0, 0), + correlation_.omega0() + ); + + dimensionedScalar sigmaExt + ( + "sigmaExt", + dimensionSet(0, 0, -1, 0, 0, 0, 0), + correlation_.sigmaExt() + ); + + dimensionedScalar omegaMin + ( + "omegaMin", + omega0.dimensions(), + 1e-4 + ); + + dimensionedScalar kMin + ( + "kMin", + sqr(dimVelocity), + small + ); + + const compressibleTurbulenceModel& turbulence = combModel_.turbulence(); + + // Total strain + const volScalarField sigmaTotal + ( + sigma + alpha_*turbulence.epsilon()/(turbulence.k() + kMin) + ); + + const volScalarField omegaInf(correlation_.omega0Sigma(sigmaTotal)); + + dimensionedScalar sigma0("sigma0", sigma.dimensions(), 0.0); + + const volScalarField tau(C_*mag(sigmaTotal)); + + volScalarField Rc + ( + (tau*omegaInf*(omega0 - omegaInf) + sqr(omegaMin)*sigmaExt) + /(sqr(omega0 - omegaInf) + sqr(omegaMin)) + ); + + const volScalarField& rho = combModel_.rho(); + const tmp tphi = combModel_.phi(); + const surfaceScalarField& phi = tphi(); + + solve + ( + fvm::ddt(rho, omega_) + + fvm::div(phi, omega_) + == + rho*Rc*omega0 + - fvm::SuSp(rho*(tau + Rc), omega_) + ); + + omega_.min(omega0); + omega_.max(0.0); +} + + +bool Foam::reactionRateFlameAreaModels::relaxation::read +( + const dictionary& dict +) +{ + if (reactionRateFlameArea::read(dict)) + { + coeffDict_ = dict.optionalSubDict(typeName + "Coeffs"); + coeffDict_.lookup("C") >> C_; + coeffDict_.lookup("alpha") >> alpha_; + correlation_.read + ( + coeffDict_.subDict(fuel_) + ); + return true; + } + else + { + return false; + } +} + +// ************************************************************************* // diff --git a/src/dfCombustionModels/FSD/reactionRateFlameAreaModels/relaxation/relaxation.H b/src/dfCombustionModels/FSD/reactionRateFlameAreaModels/relaxation/relaxation.H new file mode 100644 index 00000000..b086ba04 --- /dev/null +++ b/src/dfCombustionModels/FSD/reactionRateFlameAreaModels/relaxation/relaxation.H @@ -0,0 +1,122 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2011-2019 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 . + +Class + Foam::reactionRateFlameAreaModels::relaxation + +Description + Consumption rate per unit of flame area obtained from a relaxation equation + +SourceFiles + relaxation.C + +\*---------------------------------------------------------------------------*/ + +#ifndef relaxation_H +#define relaxation_H + +#include "reactionRateFlameArea.H" +#include "consumptionSpeed.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace reactionRateFlameAreaModels +{ + +/*---------------------------------------------------------------------------*\ + Class relaxation Declaration +\*---------------------------------------------------------------------------*/ + +class relaxation +: + public reactionRateFlameArea +{ + // Private Data + + //- Correlation + consumptionSpeed correlation_; + + //- Proportionality constant for time scale in the relaxation Eq. + scalar C_; + + //- Proportionality constant for sub-grid strain + scalar alpha_; + + +public: + + //- Runtime type information + TypeName("relaxation"); + + + // Constructors + + //- Construct from dictionary and psiReactionThermo + relaxation + ( + const word modelType, + const dictionary& dictCoeffs, + const fvMesh& mesh, + const combustionModel& combModel + ); + + //- Disallow default bitwise copy construction + relaxation(const relaxation&); + + + // Destructor + + virtual ~relaxation(); + + + // Member Functions + + //- Correct omega + virtual void correct(const volScalarField& sigma); + + + // IO + + //- Update properties from given dictionary + virtual bool read(const dictionary& dictProperties); + + + // Member Operators + + //- Disallow default bitwise assignment + void operator=(const relaxation&) = delete; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End reactionRateFlameAreaModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/dfCombustionModels/Make/files b/src/dfCombustionModels/Make/files new file mode 100644 index 00000000..03b73275 --- /dev/null +++ b/src/dfCombustionModels/Make/files @@ -0,0 +1,28 @@ +combustionModel/combustionModel.C +CombustionModel/CombustionModel/CombustionModels.C + +diffusion/diffusions.C +infinitelyFastChemistry/infinitelyFastChemistrys.C + +PaSR/PaSRs.C +EDC/EDCs.C + +laminar/laminars.C + +FSD/reactionRateFlameAreaModels/consumptionSpeed/consumptionSpeed.C +FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameArea.C +FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameAreaNew.C +FSD/reactionRateFlameAreaModels/relaxation/relaxation.C + +FSD/FSDs.C + +zoneCombustion/zoneCombustions.C + +noCombustion/noCombustions.C + +functionObjects/Qdot/Qdot.C + +radiationModels/absorptionEmissionModels/greyMeanCombustion/greyMeanCombustion.C +radiationModels/absorptionEmissionModels/wideBandCombustion/wideBandCombustion.C + +LIB = $(FOAM_LIBBIN)/libcombustionModels diff --git a/src/dfCombustionModels/Make/options b/src/dfCombustionModels/Make/options new file mode 100644 index 00000000..b779f2eb --- /dev/null +++ b/src/dfCombustionModels/Make/options @@ -0,0 +1,20 @@ +EXE_INC = \ + -I$(LIB_SRC)/transportModels/compressible/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \ + -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ + -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ + -I$(LIB_SRC)/radiationModels/lnInclude \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude + +LIB_LIBS = \ + -lcompressibleTransportModels \ + -lturbulenceModels \ + -lcompressibleTurbulenceModels \ + -lchemistryModel \ + -lradiationModels \ + -lfiniteVolume \ + -lmeshTools diff --git a/src/dfCombustionModels/PaSR/PaSR.C b/src/dfCombustionModels/PaSR/PaSR.C new file mode 100644 index 00000000..cb993737 --- /dev/null +++ b/src/dfCombustionModels/PaSR/PaSR.C @@ -0,0 +1,135 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2011-2018 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 "PaSR.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::combustionModels::PaSR::PaSR +( + const word& modelType, + ReactionThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties +) +: + laminar(modelType, thermo, turb, combustionProperties), + Cmix_(readScalar(this->coeffs().lookup("Cmix"))), + kappa_ + ( + IOobject + ( + thermo.phasePropertyName(typeName + ":kappa"), + this->mesh().time().timeName(), + this->mesh(), + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + this->mesh(), + dimensionedScalar(dimless, 0) + ) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template +Foam::combustionModels::PaSR::~PaSR() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +template +void Foam::combustionModels::PaSR::correct() +{ + laminar::correct(); + + tmp tepsilon(this->turbulence().epsilon()); + const scalarField& epsilon = tepsilon(); + + tmp tmuEff(this->turbulence().muEff()); + const scalarField& muEff = tmuEff(); + + tmp ttc(this->tc()); + const scalarField& tc = ttc(); + + tmp trho(this->rho()); + const scalarField& rho = trho(); + + forAll(epsilon, i) + { + const scalar tk = + Cmix_*sqrt(max(muEff[i]/rho[i]/(epsilon[i] + small), 0)); + + if (tk > small) + { + kappa_[i] = tc[i]/(tc[i] + tk); + } + else + { + kappa_[i] = 1.0; + } + } +} + + +template +Foam::tmp +Foam::combustionModels::PaSR::R(volScalarField& Y) const +{ + return kappa_*laminar::R(Y); +} + + +template +Foam::tmp +Foam::combustionModels::PaSR::Qdot() const +{ + return volScalarField::New + ( + this->thermo().phasePropertyName(typeName + ":Qdot"), + kappa_*laminar::Qdot() + ); +} + + +template +bool Foam::combustionModels::PaSR::read() +{ + if (laminar::read()) + { + this->coeffs().lookup("Cmix") >> Cmix_; + return true; + } + else + { + return false; + } +} + + +// ************************************************************************* // diff --git a/src/dfCombustionModels/PaSR/PaSR.H b/src/dfCombustionModels/PaSR/PaSR.H new file mode 100644 index 00000000..a3fa0de1 --- /dev/null +++ b/src/dfCombustionModels/PaSR/PaSR.H @@ -0,0 +1,131 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2011-2019 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 . + +Class + Foam::combustionModels::PaSR + +Description + Partially stirred reactor turbulent combustion model. + + This model calculates a finite rate, based on both turbulence and chemistry + time scales. Depending on mesh resolution, the Cmix parameter can be used + to scale the turbulence mixing time scale. + +SourceFiles + PaSR.C + +\*---------------------------------------------------------------------------*/ + +#ifndef PaSR_H +#define PaSR_H + +#include "../laminar/laminar.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace combustionModels +{ + +/*---------------------------------------------------------------------------*\ + Class PaSR Declaration +\*---------------------------------------------------------------------------*/ + +template +class PaSR +: + public laminar +{ + // Private Data + + //- Mixing constant + scalar Cmix_; + + //- Mixing parameter + volScalarField kappa_; + + +public: + + //- Runtime type information + TypeName("PaSR"); + + + // Constructors + + //- Construct from components + PaSR + ( + const word& modelType, + ReactionThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties + ); + + //- Disallow default bitwise copy construction + PaSR(const PaSR&); + + + //- Destructor + virtual ~PaSR(); + + + // Member Functions + + //- Correct combustion rate + virtual void correct(); + + //- Fuel consumption rate matrix. + virtual tmp R(volScalarField& Y) const; + + //- Heat release rate [kg/m/s^3] + virtual tmp Qdot() const; + + //- Update properties from given dictionary + virtual bool read(); + + + // Member Operators + + //- Disallow default bitwise assignment + void operator=(const PaSR&) = delete; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace combustionModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository + #include "PaSR.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/dfCombustionModels/PaSR/PaSRs.C b/src/dfCombustionModels/PaSR/PaSRs.C new file mode 100644 index 00000000..965881a2 --- /dev/null +++ b/src/dfCombustionModels/PaSR/PaSRs.C @@ -0,0 +1,42 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2011-2018 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 "psiReactionThermo.H" +#include "rhoReactionThermo.H" +#include "PaSR.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +makeCombustionTypes(PaSR, psiReactionThermo); +makeCombustionTypes(PaSR, rhoReactionThermo); + +} + +// ************************************************************************* // diff --git a/src/dfCombustionModels/combustionModel/combustionModel.C b/src/dfCombustionModels/combustionModel/combustionModel.C new file mode 100644 index 00000000..d7b351fd --- /dev/null +++ b/src/dfCombustionModels/combustionModel/combustionModel.C @@ -0,0 +1,111 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2011-2018 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 "combustionModel.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(combustionModel, 0); +} + +const Foam::word Foam::combustionModel::combustionPropertiesName +( + "combustionProperties" +); + + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +Foam::IOobject Foam::combustionModel::createIOobject +( + basicThermo& thermo, + const word& combustionProperties +) const +{ + IOobject io + ( + thermo.phasePropertyName(combustionProperties), + thermo.db().time().constant(), + thermo.db(), + IOobject::MUST_READ, + IOobject::NO_WRITE + ); + + if (io.typeHeaderOk(true)) + { + io.readOpt() = IOobject::MUST_READ_IF_MODIFIED; + return io; + } + else + { + io.readOpt() = IOobject::NO_READ; + return io; + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::combustionModel::combustionModel +( + const word& modelType, + basicThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties +) +: + IOdictionary(createIOobject(thermo, combustionProperties)), + mesh_(thermo.p().mesh()), + turb_(turb), + coeffs_(optionalSubDict(modelType + "Coeffs")), + modelType_(modelType) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::combustionModel::~combustionModel() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +bool Foam::combustionModel::read() +{ + if (regIOobject::read()) + { + coeffs_ = optionalSubDict(modelType_ + "Coeffs"); + return true; + } + else + { + return false; + } +} + + +// ************************************************************************* // diff --git a/src/dfCombustionModels/combustionModel/combustionModel.H b/src/dfCombustionModels/combustionModel/combustionModel.H new file mode 100644 index 00000000..f2f10b79 --- /dev/null +++ b/src/dfCombustionModels/combustionModel/combustionModel.H @@ -0,0 +1,174 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2011-2019 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 . + +Class + Foam::combustionModel + +Description + Base class for combustion models + +SourceFiles + combustionModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef combustionModel_H +#define combustionModel_H + +#include "IOdictionary.H" +#include "turbulentFluidThermoModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class combustionModel Declaration +\*---------------------------------------------------------------------------*/ + +class combustionModel +: + public IOdictionary +{ + // Private Member Functions + + //- Construct the base IO object + IOobject createIOobject + ( + basicThermo& thermo, + const word& combustionProperties + ) const; + + +protected: + + // Protected data + + //- Reference to the mesh database + const fvMesh& mesh_; + + //- Reference to the turbulence model + const compressibleTurbulenceModel& turb_; + + //- Dictionary of the model + dictionary coeffs_; + + //- Model type + const word modelType_; + + +public: + + //- Runtime type information + TypeName("combustionModel"); + + //- Default combustionProperties dictionary name + static const word combustionPropertiesName; + + + // Constructors + + //- Construct from components + combustionModel + ( + const word& modelType, + basicThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties=combustionPropertiesName + ); + + //- Disallow default bitwise copy construction + combustionModel(const combustionModel&); + + + // Selectors + + //- Generic New for each of the related chemistry model + template + static autoPtr New + ( + typename CombustionModel::reactionThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties + ); + + + //- Destructor + virtual ~combustionModel(); + + + // Member Functions + + //- Return const access to the mesh database + inline const fvMesh& mesh() const; + + //- Return access to turbulence + inline const compressibleTurbulenceModel& turbulence() const; + + //- Return const access to rho + inline const volScalarField& rho() const; + + //- Return const access to phi + inline tmp phi() const; + + //- Return const dictionary of the model + inline const dictionary& coeffs() const; + + //- Correct combustion rate + virtual void correct() = 0; + + //- Fuel consumption rate matrix, i.e. source term for fuel equation + virtual tmp R(volScalarField& Y) const = 0; + + //- Heat release rate [kg/m/s^3] + virtual tmp Qdot() const = 0; + + //- Update properties from given dictionary + virtual bool read(); + + + // Member Operators + + //- Disallow default bitwise assignment + void operator=(const combustionModel&) = delete; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "combustionModelI.H" + +#ifdef NoRepository + #include "combustionModelTemplates.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/dfCombustionModels/combustionModel/combustionModelI.H b/src/dfCombustionModels/combustionModel/combustionModelI.H new file mode 100644 index 00000000..a31d3aa3 --- /dev/null +++ b/src/dfCombustionModels/combustionModel/combustionModelI.H @@ -0,0 +1,58 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2011-2018 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 . + +\*---------------------------------------------------------------------------*/ + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +inline const Foam::fvMesh& Foam::combustionModel::mesh() const +{ + return mesh_; +} + + +inline const Foam::compressibleTurbulenceModel& +Foam::combustionModel::turbulence() const +{ + return turb_; +} + + +inline const Foam::volScalarField& Foam::combustionModel::rho() const +{ + return turbulence().rho(); +} + + +inline Foam::tmp Foam::combustionModel::phi() const +{ + return turbulence().alphaRhoPhi(); +} + + +inline const Foam::dictionary& Foam::combustionModel::coeffs() const +{ + return coeffs_; +} + +// ************************************************************************* // diff --git a/src/dfCombustionModels/combustionModel/combustionModelTemplates.C b/src/dfCombustionModels/combustionModel/combustionModelTemplates.C new file mode 100644 index 00000000..cb3ed4b7 --- /dev/null +++ b/src/dfCombustionModels/combustionModel/combustionModelTemplates.C @@ -0,0 +1,180 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2011-2018 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 . + +\*---------------------------------------------------------------------------*/ + +// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // + +template +Foam::autoPtr Foam::combustionModel::New +( + typename CombustionModel::reactionThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties +) +{ + IOobject combIO + ( + IOobject + ( + thermo.phasePropertyName(combustionProperties), + thermo.db().time().constant(), + thermo.db(), + IOobject::MUST_READ, + IOobject::NO_WRITE, + false + ) + ); + + word combModelName("none"); + if (combIO.typeHeaderOk(false)) + { + IOdictionary(combIO).lookup("combustionModel") >> combModelName; + } + else + { + Info<< "Combustion model not active: " + << thermo.phasePropertyName(combustionProperties) + << " not found" << endl; + } + + Info<< "Selecting combustion model " << combModelName << endl; + + const wordList cmpts2(basicThermo::splitThermoName(combModelName, 2)); + const wordList cmpts3(basicThermo::splitThermoName(combModelName, 3)); + if (cmpts2.size() == 2 || cmpts3.size() == 3) + { + combModelName = cmpts2.size() ? cmpts2[0] : cmpts3[0]; + + WarningInFunction + << "Template parameters are no longer required when selecting a " + << combustionModel::typeName << ". This information is now " + << "obtained directly from the thermodynamics. Actually selecting " + << "combustion model " << combModelName << "." << endl; + } + + typedef typename CombustionModel::dictionaryConstructorTable cstrTableType; + cstrTableType* cstrTable = CombustionModel::dictionaryConstructorTablePtr_; + + const word compCombModelName = + combModelName + '<' + CombustionModel::reactionThermo::typeName + '>'; + + const word thermoCombModelName = + combModelName + '<' + CombustionModel::reactionThermo::typeName + ',' + + thermo.thermoName() + '>'; + + typename cstrTableType::iterator compCstrIter = + cstrTable->find(compCombModelName); + + typename cstrTableType::iterator thermoCstrIter = + cstrTable->find(thermoCombModelName); + + if (compCstrIter == cstrTable->end() && thermoCstrIter == cstrTable->end()) + { + FatalErrorInFunction + << "Unknown " << combustionModel::typeName << " type " + << combModelName << endl << endl; + + const wordList names(cstrTable->toc()); + + wordList thisCmpts; + thisCmpts.append(word::null); + thisCmpts.append(CombustionModel::reactionThermo::typeName); + thisCmpts.append(basicThermo::splitThermoName(thermo.thermoName(), 5)); + + wordList validNames; + forAll(names, i) + { + wordList cmpts(basicThermo::splitThermoName(names[i], 2)); + if (cmpts.size() != 2) + { + cmpts = basicThermo::splitThermoName(names[i], 7); + } + + bool isValid = true; + for (label i = 1; i < cmpts.size() && isValid; ++ i) + { + isValid = isValid && cmpts[i] == thisCmpts[i]; + } + + if (isValid) + { + validNames.append(cmpts[0]); + } + } + + FatalErrorInFunction + << "Valid " << combustionModel::typeName << " types for this " + << "thermodynamic model are:" << endl << validNames << endl; + + List validCmpts2, validCmpts7; + validCmpts2.append(wordList(2, word::null)); + validCmpts2[0][0] = combustionModel::typeName; + validCmpts2[0][1] = "reactionThermo"; + validCmpts7.append(wordList(7, word::null)); + validCmpts7[0][0] = combustionModel::typeName; + validCmpts7[0][1] = "reactionThermo"; + validCmpts7[0][2] = "transport"; + validCmpts7[0][3] = "thermo"; + validCmpts7[0][4] = "equationOfState"; + validCmpts7[0][5] = "specie"; + validCmpts7[0][6] = "energy"; + forAll(names, i) + { + const wordList cmpts2(basicThermo::splitThermoName(names[i], 2)); + const wordList cmpts7(basicThermo::splitThermoName(names[i], 7)); + if (cmpts2.size() == 2) + { + validCmpts2.append(cmpts2); + } + if (cmpts7.size() == 7) + { + validCmpts7.append(cmpts7); + } + } + + FatalErrorInFunction + << "All " << validCmpts2[0][0] << '/' << validCmpts2[0][1] + << " combinations are:" << endl << endl; + printTable(validCmpts2, FatalErrorInFunction); + + FatalErrorInFunction << endl; + + FatalErrorInFunction + << "All " << validCmpts7[0][0] << '/' << validCmpts7[0][1] + << "/thermoPhysics combinations are:" << endl << endl; + printTable(validCmpts7, FatalErrorInFunction); + + FatalErrorInFunction << exit(FatalError); + } + + return autoPtr + ( + thermoCstrIter != cstrTable->end() + ? thermoCstrIter()(combModelName, thermo, turb, combustionProperties) + : compCstrIter()(combModelName, thermo, turb, combustionProperties) + ); +} + + +// ************************************************************************* // diff --git a/src/dfCombustionModels/combustionModel/makeCombustionTypes.H b/src/dfCombustionModels/combustionModel/makeCombustionTypes.H new file mode 100644 index 00000000..3e989f2d --- /dev/null +++ b/src/dfCombustionModels/combustionModel/makeCombustionTypes.H @@ -0,0 +1,107 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2011-2018 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 . + +\*---------------------------------------------------------------------------*/ + +#ifndef makeCombustionTypes_H +#define makeCombustionTypes_H + +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define makeCombustion(Comp) \ + \ + typedef CombustionModel CombustionModel##Comp; \ + \ + defineTemplateTypeNameAndDebugWithName \ + ( \ + CombustionModel##Comp, \ + ( \ + word(CombustionModel##Comp::typeName_()) + "<" + Comp::typeName \ + + ">" \ + ).c_str(), \ + 0 \ + ); \ + \ + defineTemplateRunTimeSelectionTable \ + ( \ + CombustionModel##Comp, \ + dictionary \ + ); + + +#define makeCombustionTypesThermo(CombModel, Comp, Thermo) \ + \ + typedef combustionModels::CombModel \ + CombModel##Comp##Thermo; \ + \ + defineTemplateTypeNameAndDebugWithName \ + ( \ + CombModel##Comp##Thermo, \ + ( \ + word(CombModel##Comp##Thermo::typeName_()) + "<" + Comp::typeName \ + + "," + Thermo::typeName() + ">" \ + ).c_str(), \ + 0 \ + ); \ + \ + CombustionModel:: \ + add##dictionary##ConstructorToTable \ + add##CombModel##Comp##Thermo##dictionary##ConstructorTo##\ +CombustionModel##Comp##Table_; + + +#define makeCombustionTypes(CombModel, Comp) \ + \ + typedef combustionModels::CombModel CombModel##Comp; \ + \ + defineTemplateTypeNameAndDebugWithName \ + ( \ + CombModel##Comp, \ + ( \ + word(CombModel##Comp::typeName_()) + "<" + Comp::typeName + ">" \ + ).c_str(), \ + 0 \ + ); \ + \ + CombustionModel:: \ + add##dictionary##ConstructorToTable \ + add##CombModel##Comp##dictionary##ConstructorTo##CombustionModel##Comp\ +##Table_; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/dfCombustionModels/diffusion/diffusion.C b/src/dfCombustionModels/diffusion/diffusion.C new file mode 100644 index 00000000..82e6f44b --- /dev/null +++ b/src/dfCombustionModels/diffusion/diffusion.C @@ -0,0 +1,112 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2012-2018 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 "diffusion.H" +#include "fvcGrad.H" + +namespace Foam +{ +namespace combustionModels +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +diffusion::diffusion +( + const word& modelType, + ReactionThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties +) +: + singleStepCombustion + ( + modelType, + thermo, + turb, + combustionProperties + ), + C_(readScalar(this->coeffs().lookup("C"))), + oxidantName_(this->coeffs().template lookupOrDefault("oxidant", "O2")) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template +diffusion::~diffusion() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +template +void diffusion::correct() +{ + this->wFuel_ == + dimensionedScalar(dimMass/pow3(dimLength)/dimTime, 0); + + this->singleMixturePtr_->fresCorrect(); + + const label fuelI = this->singleMixturePtr_->fuelIndex(); + + const volScalarField& YFuel = this->thermo().composition().Y()[fuelI]; + + if (this->thermo().composition().contains(oxidantName_)) + { + const volScalarField& YO2 = + this->thermo().composition().Y(oxidantName_); + + this->wFuel_ == + C_*this->turbulence().muEff() + *mag(fvc::grad(YFuel) & fvc::grad(YO2)) + *pos0(YFuel)*pos0(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/dfCombustionModels/diffusion/diffusion.H b/src/dfCombustionModels/diffusion/diffusion.H new file mode 100644 index 00000000..b478cccc --- /dev/null +++ b/src/dfCombustionModels/diffusion/diffusion.H @@ -0,0 +1,124 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2012-2019 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 . + +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_; + + +public: + + //- Runtime type information + TypeName("diffusion"); + + + // Constructors + + //- Construct from components + diffusion + ( + const word& modelType, + ReactionThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties + ); + + //- Disallow default bitwise copy construction + diffusion(const diffusion&); + + + //- Destructor + virtual ~diffusion(); + + + // Member Functions + + //- Correct combustion rate + virtual void correct(); + + //- Update properties + virtual bool read(); + + + // Member Operators + + //- Disallow default bitwise assignment + void operator=(const diffusion&) = delete; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace combustionModels +} // End namespace Foam + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository + #include "diffusion.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/dfCombustionModels/diffusion/diffusions.C b/src/dfCombustionModels/diffusion/diffusions.C new file mode 100644 index 00000000..0fb18d86 --- /dev/null +++ b/src/dfCombustionModels/diffusion/diffusions.C @@ -0,0 +1,100 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2012-2018 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 "psiReactionThermo.H" +#include "rhoReactionThermo.H" +#include "diffusion.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Combustion models based on sensibleEnthalpy +makeCombustionTypesThermo +( + diffusion, + psiReactionThermo, + gasHThermoPhysics +); + +makeCombustionTypesThermo +( + diffusion, + psiReactionThermo, + constGasHThermoPhysics +); + +makeCombustionTypesThermo +( + diffusion, + rhoReactionThermo, + gasHThermoPhysics +); + +makeCombustionTypesThermo +( + diffusion, + rhoReactionThermo, + constGasHThermoPhysics +); + + +// Combustion models based on sensibleInternalEnergy + +makeCombustionTypesThermo +( + diffusion, + psiReactionThermo, + gasEThermoPhysics +); + +makeCombustionTypesThermo +( + diffusion, + psiReactionThermo, + constGasEThermoPhysics +); + +makeCombustionTypesThermo +( + diffusion, + rhoReactionThermo, + gasEThermoPhysics +); + +makeCombustionTypesThermo +( + diffusion, + rhoReactionThermo, + constGasEThermoPhysics +); + +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/dfCombustionModels/functionObjects/Qdot/Qdot.C b/src/dfCombustionModels/functionObjects/Qdot/Qdot.C new file mode 100644 index 00000000..78c1cb84 --- /dev/null +++ b/src/dfCombustionModels/functionObjects/Qdot/Qdot.C @@ -0,0 +1,117 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2019 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 "Qdot.H" +#include "combustionModel.H" +#include "volFields.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace functionObjects +{ + defineTypeNameAndDebug(Qdot, 0); + + addToRunTimeSelectionTable + ( + functionObject, + Qdot, + dictionary + ); +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::functionObjects::Qdot::Qdot +( + const word& name, + const Time& runTime, + const dictionary& dict +) +: + fvMeshFunctionObject(name, runTime, dict), + writeLocalObjects(obr_, false), + phaseName_(word::null) +{ + read(dict); + resetLocalObjectName(IOobject::groupName(type(), phaseName_)); +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::functionObjects::Qdot::~Qdot() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +bool Foam::functionObjects::Qdot::read +( + const dictionary& dict +) +{ + fvMeshFunctionObject::read(dict); + writeLocalObjects::read(dict); + + phaseName_ = dict.lookupOrDefault("phase", word::null); + + return true; +} + + +bool Foam::functionObjects::Qdot::execute() +{ + word fieldName(IOobject::groupName(type(), phaseName_)); + + const word modelName + ( + IOobject::groupName + ( + combustionModel::combustionPropertiesName, + phaseName_ + ) + ); + + return + store + ( + fieldName, + mesh_.lookupObject(modelName).Qdot() + ); +} + + +bool Foam::functionObjects::Qdot::write() +{ + return writeLocalObjects::write(); +} + + +// ************************************************************************* // diff --git a/src/dfCombustionModels/functionObjects/Qdot/Qdot.H b/src/dfCombustionModels/functionObjects/Qdot/Qdot.H new file mode 100644 index 00000000..a5a67dfc --- /dev/null +++ b/src/dfCombustionModels/functionObjects/Qdot/Qdot.H @@ -0,0 +1,109 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2019 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 . + +Class + Foam::functionObjects::Qdot + +Description + Calculates and outputs the heat release rate for the current combustion + model. + +SourceFiles + Qdot.C + +\*---------------------------------------------------------------------------*/ + +#ifndef functionObjects_Qdot_H +#define functionObjects_Qdot_H + +#include "fvMeshFunctionObject.H" +#include "writeLocalObjects.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace functionObjects +{ + +/*---------------------------------------------------------------------------*\ + Class Qdot Declaration +\*---------------------------------------------------------------------------*/ + +class Qdot +: + public fvMeshFunctionObject, + public writeLocalObjects +{ +private: + + // Private Data + + //- The name of the phase + word phaseName_; + + +public: + + //- Runtime type information + TypeName("Qdot"); + + + // Constructors + + //- Construct from Time and dictionary + Qdot + ( + const word& name, + const Time& runTime, + const dictionary& dict + ); + + + //- Destructor + virtual ~Qdot(); + + + // Member Functions + + //- Read the data + virtual bool read(const dictionary&); + + //- Calculate the Qdot field + virtual bool execute(); + + //- Do nothing + virtual bool write(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace functionObjects +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/dfCombustionModels/infinitelyFastChemistry/infinitelyFastChemistry.C b/src/dfCombustionModels/infinitelyFastChemistry/infinitelyFastChemistry.C new file mode 100644 index 00000000..f890ef50 --- /dev/null +++ b/src/dfCombustionModels/infinitelyFastChemistry/infinitelyFastChemistry.C @@ -0,0 +1,109 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2011-2018 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 "infinitelyFastChemistry.H" + +namespace Foam +{ +namespace combustionModels +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +infinitelyFastChemistry::infinitelyFastChemistry +( + const word& modelType, + ReactionThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties +) +: + singleStepCombustion + ( + modelType, + thermo, + turb, + combustionProperties + ), + C_(readScalar(this->coeffs().lookup("C"))) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template +infinitelyFastChemistry::~infinitelyFastChemistry() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +template +void infinitelyFastChemistry::correct() +{ + this->wFuel_ == + dimensionedScalar(dimMass/pow3(dimLength)/dimTime, 0); + + this->singleMixturePtr_->fresCorrect(); + + const label fuelI = this->singleMixturePtr_->fuelIndex(); + + const volScalarField& YFuel = this->thermo().composition().Y()[fuelI]; + + const dimensionedScalar s = this->singleMixturePtr_->s(); + + if (this->thermo().composition().contains("O2")) + { + const volScalarField& YO2 = this->thermo().composition().Y("O2"); + + this->wFuel_ == + this->rho()/(this->mesh().time().deltaT()*C_) + *min(YFuel, YO2/s.value()); + } +} + + +template +bool infinitelyFastChemistry::read() +{ + if (singleStepCombustion::read()) + { + this->coeffs().lookup("C") >> C_ ; + return true; + } + else + { + return false; + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace combustionModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/dfCombustionModels/infinitelyFastChemistry/infinitelyFastChemistry.H b/src/dfCombustionModels/infinitelyFastChemistry/infinitelyFastChemistry.H new file mode 100644 index 00000000..51d0a874 --- /dev/null +++ b/src/dfCombustionModels/infinitelyFastChemistry/infinitelyFastChemistry.H @@ -0,0 +1,121 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2011-2019 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 . + +Class + Foam::combustionModels::infinitelyFastChemistry + +Description + Simple infinitely fast chemistry combustion model based on the principle + mixed is burnt. Additional parameter C is used to distribute the heat + release rate.in time + +SourceFiles + infinitelyFastChemistry.C + +\*---------------------------------------------------------------------------*/ + +#ifndef infinitelyFastChemistry_H +#define infinitelyFastChemistry_H + +#include "singleStepCombustion.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace combustionModels +{ + +/*---------------------------------------------------------------------------*\ + Class infinitelyFastChemistry Declaration +\*---------------------------------------------------------------------------*/ + +template +class infinitelyFastChemistry +: + public singleStepCombustion +{ + // Private Data + + //- Model constant + scalar C_; + + +public: + + //- Runtime type information + TypeName("infinitelyFastChemistry"); + + + // Constructors + + //- Construct from components + infinitelyFastChemistry + ( + const word& modelType, + ReactionThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties + ); + + //- Disallow default bitwise copy construction + infinitelyFastChemistry(const infinitelyFastChemistry&); + + + //- Destructor + virtual ~infinitelyFastChemistry(); + + + // Member Functions + + //- Correct combustion rate + virtual void correct(); + + //- Update properties + virtual bool read(); + + + // Member Operators + + //- Disallow default bitwise assignment + void operator=(const infinitelyFastChemistry&) = delete; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace combustionModels +} // End namespace Foam + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository + #include "infinitelyFastChemistry.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/dfCombustionModels/infinitelyFastChemistry/infinitelyFastChemistrys.C b/src/dfCombustionModels/infinitelyFastChemistry/infinitelyFastChemistrys.C new file mode 100644 index 00000000..e86a886e --- /dev/null +++ b/src/dfCombustionModels/infinitelyFastChemistry/infinitelyFastChemistrys.C @@ -0,0 +1,100 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2011-2018 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 "psiReactionThermo.H" +#include "rhoReactionThermo.H" +#include "infinitelyFastChemistry.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Combustion models based on sensibleEnthalpy + +makeCombustionTypesThermo +( + infinitelyFastChemistry, + psiReactionThermo, + gasHThermoPhysics +); + +makeCombustionTypesThermo +( + infinitelyFastChemistry, + psiReactionThermo, + constGasHThermoPhysics +); + +makeCombustionTypesThermo +( + infinitelyFastChemistry, + rhoReactionThermo, + gasHThermoPhysics +); + +makeCombustionTypesThermo +( + infinitelyFastChemistry, + rhoReactionThermo, + constGasHThermoPhysics +); + +// Combustion models based on sensibleInternalEnergy + +makeCombustionTypesThermo +( + infinitelyFastChemistry, + psiReactionThermo, + gasEThermoPhysics +); + +makeCombustionTypesThermo +( + infinitelyFastChemistry, + psiReactionThermo, + constGasEThermoPhysics +); + +makeCombustionTypesThermo +( + infinitelyFastChemistry, + rhoReactionThermo, + gasEThermoPhysics +); + +makeCombustionTypesThermo +( + infinitelyFastChemistry, + rhoReactionThermo, + constGasEThermoPhysics +); + +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/dfCombustionModels/laminar/laminar.C b/src/dfCombustionModels/laminar/laminar.C new file mode 100644 index 00000000..aed969ce --- /dev/null +++ b/src/dfCombustionModels/laminar/laminar.C @@ -0,0 +1,158 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2013-2019 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 "laminar.H" +#include "fvmSup.H" +#include "localEulerDdtScheme.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::combustionModels::laminar::laminar +( + const word& modelType, + ReactionThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties +) +: + ChemistryCombustion + ( + modelType, + thermo, + turb, + combustionProperties + ), + integrateReactionRate_ + ( + this->coeffs().lookupOrDefault("integrateReactionRate", true) + ) +{ + if (integrateReactionRate_) + { + Info<< " using integrated reaction rate" << endl; + } + else + { + Info<< " using instantaneous reaction rate" << endl; + } +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template +Foam::combustionModels::laminar::~laminar() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +template +Foam::tmp +Foam::combustionModels::laminar::tc() const +{ + return this->chemistryPtr_->tc(); +} + + +template +void Foam::combustionModels::laminar::correct() +{ + if (integrateReactionRate_) + { + if (fv::localEulerDdt::enabled(this->mesh())) + { + const scalarField& rDeltaT = + fv::localEulerDdt::localRDeltaT(this->mesh()); + + if (this->coeffs().found("maxIntegrationTime")) + { + const scalar maxIntegrationTime + ( + readScalar(this->coeffs().lookup("maxIntegrationTime")) + ); + + this->chemistryPtr_->solve + ( + min(1.0/rDeltaT, maxIntegrationTime)() + ); + } + else + { + this->chemistryPtr_->solve((1.0/rDeltaT)()); + } + } + else + { + this->chemistryPtr_->solve(this->mesh().time().deltaTValue()); + } + } + else + { + this->chemistryPtr_->calculate(); + } +} + + +template +Foam::tmp +Foam::combustionModels::laminar::R(volScalarField& Y) const +{ + tmp tSu(new fvScalarMatrix(Y, dimMass/dimTime)); + fvScalarMatrix& Su = tSu.ref(); + + const label specieI = this->thermo().composition().species()[Y.member()]; + Su += this->chemistryPtr_->RR(specieI); + + return tSu; +} + + +template +Foam::tmp +Foam::combustionModels::laminar::Qdot() const +{ + return this->chemistryPtr_->Qdot(); +} + + +template +bool Foam::combustionModels::laminar::read() +{ + if (ChemistryCombustion::read()) + { + integrateReactionRate_ = + this->coeffs().lookupOrDefault("integrateReactionRate", true); + return true; + } + else + { + return false; + } +} + + +// ************************************************************************* // diff --git a/src/dfCombustionModels/laminar/laminar.H b/src/dfCombustionModels/laminar/laminar.H new file mode 100644 index 00000000..d4ec595e --- /dev/null +++ b/src/dfCombustionModels/laminar/laminar.H @@ -0,0 +1,133 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2013-2019 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 . + +Class + Foam::combustionModels::laminar + +Description + Laminar combustion model. + +SourceFiles + laminar.C + +\*---------------------------------------------------------------------------*/ + +#ifndef laminar_H +#define laminar_H + +#include "ChemistryCombustion.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace combustionModels +{ + +/*---------------------------------------------------------------------------*\ + Class laminar Declaration +\*---------------------------------------------------------------------------*/ + +template +class laminar +: + public ChemistryCombustion +{ + // Private Data + + //- Integrate reaction rate over the time-step + // using the selected ODE solver + bool integrateReactionRate_; + + +protected: + + // Protected Member Functions + + //- Return the chemical time scale + tmp tc() const; + + +public: + + //- Runtime type information + TypeName("laminar"); + + + // Constructors + + //- Construct from components + laminar + ( + const word& modelType, + ReactionThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties + ); + + //- Disallow default bitwise copy construction + laminar(const laminar&); + + + //- Destructor + virtual ~laminar(); + + + // Member Functions + + //- Correct combustion rate + virtual void correct(); + + //- Fuel consumption rate matrix. + virtual tmp R(volScalarField& Y) const; + + //- Heat release rate [kg/m/s^3] + virtual tmp Qdot() const; + + //- Update properties from given dictionary + virtual bool read(); + + + // Member Operators + + //- Disallow default bitwise assignment + void operator=(const laminar&) = delete; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace combustionModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository + #include "laminar.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/dfCombustionModels/laminar/laminars.C b/src/dfCombustionModels/laminar/laminars.C new file mode 100644 index 00000000..2c5b2cee --- /dev/null +++ b/src/dfCombustionModels/laminar/laminars.C @@ -0,0 +1,42 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2013-2018 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 "psiReactionThermo.H" +#include "rhoReactionThermo.H" +#include "laminar.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +makeCombustionTypes(laminar, psiReactionThermo); +makeCombustionTypes(laminar, rhoReactionThermo); + +} + +// ************************************************************************* // diff --git a/src/dfCombustionModels/noCombustion/noCombustion.C b/src/dfCombustionModels/noCombustion/noCombustion.C new file mode 100644 index 00000000..69dae978 --- /dev/null +++ b/src/dfCombustionModels/noCombustion/noCombustion.C @@ -0,0 +1,101 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2011-2018 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 "noCombustion.H" +#include "fvmSup.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::combustionModels::noCombustion::noCombustion +( + const word& modelType, + ReactionThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties +) +: + ThermoCombustion(modelType, thermo, turb) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template +Foam::combustionModels::noCombustion::~noCombustion() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +template +void Foam::combustionModels::noCombustion::correct() +{} + + +template +Foam::tmp +Foam::combustionModels::noCombustion::R +( + volScalarField& Y +) const +{ + tmp tSu + ( + new fvScalarMatrix(Y, dimMass/dimTime) + ); + + return tSu; +} + + +template +Foam::tmp +Foam::combustionModels::noCombustion::Qdot() const +{ + return volScalarField::New + ( + this->thermo().phasePropertyName(typeName + ":Qdot"), + this->mesh(), + dimensionedScalar(dimEnergy/dimVolume/dimTime, 0) + ); +} + + +template +bool Foam::combustionModels::noCombustion::read() +{ + if (ThermoCombustion::read()) + { + return true; + } + else + { + return false; + } +} + + +// ************************************************************************* // diff --git a/src/dfCombustionModels/noCombustion/noCombustion.H b/src/dfCombustionModels/noCombustion/noCombustion.H new file mode 100644 index 00000000..fd137c4b --- /dev/null +++ b/src/dfCombustionModels/noCombustion/noCombustion.H @@ -0,0 +1,118 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2011-2019 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 . + +Class + Foam::combustionModels::noCombustion + +Description + Dummy combustion model for 'no combustion' + +SourceFiles + noCombustion.C + +\*---------------------------------------------------------------------------*/ + +#ifndef noCombustion_H +#define noCombustion_H + +#include "ThermoCombustion.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace combustionModels +{ + +/*---------------------------------------------------------------------------*\ + Class noCombustion Declaration +\*---------------------------------------------------------------------------*/ + +template +class noCombustion +: + public ThermoCombustion +{ +public: + + //- Runtime type information + TypeName("none"); + + + // Constructors + + //- Construct from components + noCombustion + ( + const word& modelType, + ReactionThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties + ); + + //- Disallow default bitwise copy construction + noCombustion(const noCombustion&); + + + //- Destructor + virtual ~noCombustion(); + + + // Member Functions + + //- Correct combustion rate + virtual void correct(); + + //- Fuel consumption rate matrix + virtual tmp R(volScalarField& Y) const; + + //- Heat release rate [kg/m/s^3] + virtual tmp Qdot() const; + + //- Update properties from given dictionary + virtual bool read(); + + + // Member Operators + + //- Disallow default bitwise assignment + void operator=(const noCombustion&) = delete; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace combustionModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository + #include "noCombustion.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/dfCombustionModels/noCombustion/noCombustions.C b/src/dfCombustionModels/noCombustion/noCombustions.C new file mode 100644 index 00000000..b1c496fd --- /dev/null +++ b/src/dfCombustionModels/noCombustion/noCombustions.C @@ -0,0 +1,42 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2012-2018 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 "psiReactionThermo.H" +#include "rhoReactionThermo.H" +#include "noCombustion.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +makeCombustionTypes(noCombustion, psiReactionThermo); +makeCombustionTypes(noCombustion, rhoReactionThermo); + +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/dfCombustionModels/radiationModels/absorptionEmissionModels/greyMeanCombustion/greyMeanCombustion.C b/src/dfCombustionModels/radiationModels/absorptionEmissionModels/greyMeanCombustion/greyMeanCombustion.C new file mode 100644 index 00000000..1122614a --- /dev/null +++ b/src/dfCombustionModels/radiationModels/absorptionEmissionModels/greyMeanCombustion/greyMeanCombustion.C @@ -0,0 +1,89 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2011-2019 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 "greyMeanCombustion.H" +#include "combustionModel.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace radiationModels +{ +namespace absorptionEmissionModels +{ + defineTypeNameAndDebug(greyMeanCombustion, 0); + + addToRunTimeSelectionTable + ( + absorptionEmissionModel, + greyMeanCombustion, + dictionary + ); +} +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::radiationModels::absorptionEmissionModels::greyMeanCombustion:: +greyMeanCombustion +( + const dictionary& dict, + const fvMesh& mesh +) +: + greyMean(dict, mesh, typeName), + EhrrCoeff_(readScalar(coeffsDict_.lookup("EhrrCoeff"))) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::radiationModels::absorptionEmissionModels::greyMeanCombustion:: +~greyMeanCombustion() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp +Foam::radiationModels::absorptionEmissionModels::greyMeanCombustion::ECont +( + const label bandI +) const +{ + tmp E = greyMean::ECont(bandI); + + const word& name = combustionModel::combustionPropertiesName; + E.ref() += EhrrCoeff_*mesh_.lookupObject(name).Qdot(); + + return E; +} + + +// ************************************************************************* // diff --git a/src/dfCombustionModels/radiationModels/absorptionEmissionModels/greyMeanCombustion/greyMeanCombustion.H b/src/dfCombustionModels/radiationModels/absorptionEmissionModels/greyMeanCombustion/greyMeanCombustion.H new file mode 100644 index 00000000..bc828496 --- /dev/null +++ b/src/dfCombustionModels/radiationModels/absorptionEmissionModels/greyMeanCombustion/greyMeanCombustion.H @@ -0,0 +1,103 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2011-2019 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 . + +Class + Foam::radiationModels::absorptionEmission::greyMeanCombustion + +Description + greyMeanCombustion radiation absorption and emission coefficients for + continuous phase. Exactly as greyMean, but with additional effects of the + combustion heat release rate included. + +See also + Foam::radiationModels::absorptionEmissionModels::greyMean + +SourceFiles + greyMeanCombustion.C + +\*---------------------------------------------------------------------------*/ + +#ifndef greyMeanCombustion_H +#define greyMeanCombustion_H + +#include "greyMean.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace radiationModels +{ +namespace absorptionEmissionModels +{ + +/*---------------------------------------------------------------------------*\ + Class greyMeanCombustion Declaration +\*---------------------------------------------------------------------------*/ + +class greyMeanCombustion +: + public greyMean +{ +private: + + // Private Data + + //- Emission constant coefficient + const scalar EhrrCoeff_; + + +public: + + //- Runtime type information + TypeName("greyMeanCombustion"); + + + // Constructors + + //- Construct from components + greyMeanCombustion(const dictionary& dict, const fvMesh& mesh); + + + //- Destructor + virtual ~greyMeanCombustion(); + + + // Member Functions + + //- Emission contribution for continuous phase + tmp ECont(const label bandI = 0) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace absorptionEmissionModels +} // End namespace radiationModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/dfCombustionModels/radiationModels/absorptionEmissionModels/wideBandCombustion/wideBandCombustion.C b/src/dfCombustionModels/radiationModels/absorptionEmissionModels/wideBandCombustion/wideBandCombustion.C new file mode 100644 index 00000000..93713b12 --- /dev/null +++ b/src/dfCombustionModels/radiationModels/absorptionEmissionModels/wideBandCombustion/wideBandCombustion.C @@ -0,0 +1,102 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2011-2019 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 "wideBandCombustion.H" +#include "combustionModel.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace radiationModels +{ +namespace absorptionEmissionModels +{ + defineTypeNameAndDebug(wideBandCombustion, 0); + + addToRunTimeSelectionTable + ( + absorptionEmissionModel, + wideBandCombustion, + dictionary + ); +} +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::radiationModels::absorptionEmissionModels::wideBandCombustion:: +wideBandCombustion +( + const dictionary& dict, + const fvMesh& mesh +) +: + wideBand(dict, mesh, typeName) +{ + label bandi = 0; + forAllConstIter(dictionary, coeffsDict_, iter) + { + if (!iter().isDict()) continue; + + iter().dict().lookup("EhrrCoeff") >> iEhrrCoeffs_[bandi]; + + ++ bandi; + } +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::radiationModels::absorptionEmissionModels::wideBandCombustion:: +~wideBandCombustion() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp +Foam::radiationModels::absorptionEmissionModels::wideBandCombustion::ECont +( + const label bandi +) const +{ + tmp E = wideBand::ECont(bandi); + + const word& name = combustionModel::combustionPropertiesName; + E.ref() += + iEhrrCoeffs_[bandi] + *mesh_.lookupObject(name).Qdot() + *(iBands_[bandi][1] - iBands_[bandi][0]) + /totalWaveLength_; + + return E; +} + + +// ************************************************************************* // diff --git a/src/dfCombustionModels/radiationModels/absorptionEmissionModels/wideBandCombustion/wideBandCombustion.H b/src/dfCombustionModels/radiationModels/absorptionEmissionModels/wideBandCombustion/wideBandCombustion.H new file mode 100644 index 00000000..ed09a04c --- /dev/null +++ b/src/dfCombustionModels/radiationModels/absorptionEmissionModels/wideBandCombustion/wideBandCombustion.H @@ -0,0 +1,101 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2011-2019 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 . + +Class + Foam::radiationModels::absorptionEmission::wideBandCombustion + +Description + wideBandCombustion radiation absorption and emission coefficients for + continuous phase. Exactly as wideBand, but with additional effects of the + combustion heat release rate included. + +See also + Foam::radiationModels::absorptionEmissionModels::wideBand + +SourceFiles + wideBandCombustion.C + +\*---------------------------------------------------------------------------*/ + +#ifndef wideBandCombustion_H +#define wideBandCombustion_H + +#include "wideBand.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace radiationModels +{ +namespace absorptionEmissionModels +{ + +/*---------------------------------------------------------------------------*\ + Class wideBandCombustion Declaration +\*---------------------------------------------------------------------------*/ + +class wideBandCombustion +: + public wideBand +{ +private: + + //- Proportion of the heat released rate emitted + FixedList iEhrrCoeffs_; + + +public: + + //- Runtime type information + TypeName("wideBandCombustion"); + + + // Constructors + + //- Construct from components + wideBandCombustion(const dictionary& dict, const fvMesh& mesh); + + + //- Destructor + virtual ~wideBandCombustion(); + + + // Member Functions + + //- Emission contribution for continuous phase + tmp ECont(const label bandi = 0) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace absorptionEmissionModels +} // End namespace radiationModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/dfCombustionModels/singleStepCombustion/singleStepCombustion.C b/src/dfCombustionModels/singleStepCombustion/singleStepCombustion.C new file mode 100644 index 00000000..512fe3ad --- /dev/null +++ b/src/dfCombustionModels/singleStepCombustion/singleStepCombustion.C @@ -0,0 +1,159 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2011-2018 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 "singleStepCombustion.H" +#include "fvmSup.H" + +namespace Foam +{ +namespace combustionModels +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +singleStepCombustion::singleStepCombustion +( + const word& modelType, + ReactionThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties +) +: + ThermoCombustion(modelType, thermo, turb), + singleMixturePtr_(nullptr), + wFuel_ + ( + IOobject + ( + this->thermo().phasePropertyName("wFuel"), + this->mesh().time().timeName(), + this->mesh(), + IOobject::NO_READ, + IOobject::NO_WRITE + ), + this->mesh(), + dimensionedScalar(dimMass/dimVolume/dimTime, 0) + ), + semiImplicit_(readBool(this->coeffs_.lookup("semiImplicit"))) +{ + if (isA>(this->thermo())) + { + singleMixturePtr_ = + &dynamic_cast&> + ( + this->thermo() + ); + } + else + { + FatalErrorInFunction + << "Inconsistent thermo package for " << this->type() << " model:\n" + << " " << this->thermo().type() << nl << nl + << "Please select a thermo package based on " + << "singleStepReactingMixture" << exit(FatalError); + } + + if (semiImplicit_) + { + Info<< "Combustion mode: semi-implicit" << endl; + } + else + { + Info<< "Combustion mode: explicit" << endl; + } +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template +singleStepCombustion::~singleStepCombustion() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +template +tmp singleStepCombustion::R +( + volScalarField& Y +) const +{ + const label specieI = + this->thermo().composition().species()[Y.member()]; + + volScalarField wSpecie + ( + wFuel_*singleMixturePtr_->specieStoichCoeffs()[specieI] + ); + + if (semiImplicit_) + { + const label fNorm = singleMixturePtr_->specieProd()[specieI]; + const volScalarField fres(singleMixturePtr_->fres(specieI)); + wSpecie /= max(fNorm*(Y - fres), scalar(1e-2)); + + return -fNorm*wSpecie*fres + fNorm*fvm::Sp(wSpecie, Y); + } + else + { + return wSpecie + fvm::Sp(0.0*wSpecie, Y); + } +} + + +template +tmp +singleStepCombustion::Qdot() const +{ + const label fuelI = singleMixturePtr_->fuelIndex(); + volScalarField& YFuel = + const_cast(this->thermo().composition().Y(fuelI)); + + return -singleMixturePtr_->qFuel()*(R(YFuel) & YFuel); +} + + +template +bool singleStepCombustion::read() +{ + if (ThermoCombustion::read()) + { + return true; + } + else + { + return false; + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace combustionModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/dfCombustionModels/singleStepCombustion/singleStepCombustion.H b/src/dfCombustionModels/singleStepCombustion/singleStepCombustion.H new file mode 100644 index 00000000..855455a5 --- /dev/null +++ b/src/dfCombustionModels/singleStepCombustion/singleStepCombustion.H @@ -0,0 +1,126 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2011-2019 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 . + +Class + Foam::combustionModels::singleStepCombustion + +Description + Base class for combustion models using singleStepReactingMixture. + +SourceFiles + singleStepCombustion.C + +\*---------------------------------------------------------------------------*/ + +#ifndef singleStepCombustion_H +#define singleStepCombustion_H + +#include "singleStepReactingMixture.H" +#include "ThermoCombustion.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace combustionModels +{ + +/*---------------------------------------------------------------------------*\ + Class singleStepCombustion Declaration +\*---------------------------------------------------------------------------*/ + +template +class singleStepCombustion +: + public ThermoCombustion +{ +protected: + + // Protected data + + //- Pointer to singleStepReactingMixture mixture + singleStepReactingMixture* singleMixturePtr_; + + //- Fuel consumption rate + volScalarField wFuel_; + + //- Semi-implicit (true) or explicit (false) treatment + bool semiImplicit_; + + +public: + + // Constructors + + //- Construct from components + singleStepCombustion + ( + const word& modelType, + ReactionThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties + ); + + //- Disallow default bitwise copy construction + singleStepCombustion(const singleStepCombustion&); + + + //- Destructor + virtual ~singleStepCombustion(); + + + // Member Functions + + //- Fuel consumption rate matrix + virtual tmp R(volScalarField& Y) const; + + //- Heat release rate [kg/m/s^3] + virtual tmp Qdot() const; + + //- Update properties from given dictionary + virtual bool read(); + + + // Member Operators + + //- Disallow default bitwise assignment + void operator=(const singleStepCombustion&) = delete; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace combustionModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository + #include "singleStepCombustion.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/dfCombustionModels/zoneCombustion/zoneCombustion.C b/src/dfCombustionModels/zoneCombustion/zoneCombustion.C new file mode 100644 index 00000000..e1389968 --- /dev/null +++ b/src/dfCombustionModels/zoneCombustion/zoneCombustion.C @@ -0,0 +1,197 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2016-2018 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 "zoneCombustion.H" + +// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // + +template +Foam::tmp +Foam::combustionModels::zoneCombustion::filter +( + const tmp& tR +) const +{ + fvScalarMatrix& R = tR.ref(); + scalarField& Su = R.source(); + scalarField filteredField(Su.size(), 0); + + forAll(zoneNames_, zonei) + { + const labelList& cells = this->mesh().cellZones()[zoneNames_[zonei]]; + + forAll(cells, i) + { + filteredField[cells[i]] = Su[cells[i]]; + } + } + + Su = filteredField; + + if (R.hasDiag()) + { + scalarField& Sp = R.diag(); + + forAll(zoneNames_, zonei) + { + const labelList& cells = + this->mesh().cellZones()[zoneNames_[zonei]]; + + forAll(cells, i) + { + filteredField[cells[i]] = Sp[cells[i]]; + } + } + + Sp = filteredField; + } + + return tR; +} + + +template +Foam::tmp +Foam::combustionModels::zoneCombustion::filter +( + const tmp& tS +) const +{ + scalarField& S = tS.ref(); + scalarField filteredField(S.size(), 0); + + forAll(zoneNames_, zonei) + { + const labelList& cells = this->mesh().cellZones()[zoneNames_[zonei]]; + + forAll(cells, i) + { + filteredField[cells[i]] = S[cells[i]]; + } + } + + S = filteredField; + + return tS; +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::combustionModels::zoneCombustion::zoneCombustion +( + const word& modelType, + ReactionThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties +) +: + CombustionModel + ( + modelType, + thermo, + turb, + combustionProperties + ), + combustionModelPtr_ + ( + CombustionModel::New + ( + thermo, + turb, + "zoneCombustionProperties" + ) + ), + zoneNames_(this->coeffs().lookup("zones")) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template +Foam::combustionModels::zoneCombustion::~zoneCombustion() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +template +ReactionThermo& Foam::combustionModels::zoneCombustion::thermo() +{ + return combustionModelPtr_->thermo(); +} + + +template +const ReactionThermo& +Foam::combustionModels::zoneCombustion::thermo() const +{ + return combustionModelPtr_->thermo(); +} + + +template +void Foam::combustionModels::zoneCombustion::correct() +{ + combustionModelPtr_->correct(); +} + + +template +Foam::tmp +Foam::combustionModels::zoneCombustion::R +( + volScalarField& Y +) const +{ + return filter(combustionModelPtr_->R(Y)); +} + + +template +Foam::tmp +Foam::combustionModels::zoneCombustion::Qdot() const +{ + return filter(combustionModelPtr_->Qdot()); +} + + +template +bool Foam::combustionModels::zoneCombustion::read() +{ + if (CombustionModel::read()) + { + combustionModelPtr_->read(); + return true; + } + else + { + return false; + } +} + + +// ************************************************************************* // diff --git a/src/dfCombustionModels/zoneCombustion/zoneCombustion.H b/src/dfCombustionModels/zoneCombustion/zoneCombustion.H new file mode 100644 index 00000000..12359245 --- /dev/null +++ b/src/dfCombustionModels/zoneCombustion/zoneCombustion.H @@ -0,0 +1,145 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2016-2019 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 . + +Class + Foam::combustionModels::zoneCombustion + +Description + Zone-filtered combustion model. + + Enable the reactions within the specified list of cell-zones and set + to zero elsewhere. + +SourceFiles + zoneCombustion.C + +\*---------------------------------------------------------------------------*/ + +#ifndef zoneCombustion_H +#define zoneCombustion_H + +#include "CombustionModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace combustionModels +{ + +/*---------------------------------------------------------------------------*\ + Class zoneCombustion Declaration +\*---------------------------------------------------------------------------*/ + +template +class zoneCombustion +: + public CombustionModel +{ + // Private Data + + //- The combustion model to be zone-filtered + autoPtr> combustionModelPtr_; + + //- List of zone names in which the reactions are active + wordList zoneNames_; + + + // Private Member Functions + + //- Filter the reaction-rate matrix on the cellZones + tmp filter(const tmp& tR) const; + + //- Filter the given field on the cellZones + tmp filter(const tmp& tS) const; + + +public: + + //- Runtime type information + TypeName("zoneCombustion"); + + + // Constructors + + //- Construct from components + zoneCombustion + ( + const word& modelType, + ReactionThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties + ); + + //- Disallow default bitwise copy construction + zoneCombustion(const zoneCombustion&); + + + //- Destructor + virtual ~zoneCombustion(); + + + // Member Functions + + //- Return access to the thermo package + virtual ReactionThermo& thermo(); + + //- Return const access to the thermo package + virtual const ReactionThermo& thermo() const; + + //- Correct combustion rate + virtual void correct(); + + //- Fuel consumption rate matrix. + virtual tmp R(volScalarField& Y) const; + + //- Heat release rate [kg/m/s^3] + virtual tmp Qdot() const; + + //- Update properties from given dictionary + virtual bool read(); + + + // Member Operators + + //- Disallow default bitwise assignment + void operator=(const zoneCombustion&) = delete; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace combustionModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository + #include "zoneCombustion.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/dfCombustionModels/zoneCombustion/zoneCombustions.C b/src/dfCombustionModels/zoneCombustion/zoneCombustions.C new file mode 100644 index 00000000..d4bb9b47 --- /dev/null +++ b/src/dfCombustionModels/zoneCombustion/zoneCombustions.C @@ -0,0 +1,42 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2016-2018 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 "psiReactionThermo.H" +#include "rhoReactionThermo.H" +#include "zoneCombustion.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +makeCombustionTypes(zoneCombustion, psiReactionThermo); +makeCombustionTypes(zoneCombustion, rhoReactionThermo); + +} + +// ************************************************************************* // From 8b0b67cfb0916d6a0214abf5699bdcab5ad72419 Mon Sep 17 00:00:00 2001 From: of Date: Thu, 16 Jun 2022 23:01:42 +0800 Subject: [PATCH 2/3] adapt combustionModels to deepflame --- Allwmake | 1 + applications/solvers/df0DFoam/EEqn.H | 2 +- applications/solvers/df0DFoam/Make/options | 4 +- applications/solvers/df0DFoam/YEqn.H | 6 +- applications/solvers/df0DFoam/createFields.H | 18 +- applications/solvers/df0DFoam/df0DFoam.C | 2 + .../solvers/dfHighSpeedFoam/Make/options | 2 +- .../solvers/dfLowMachFoam/Make/options | 2 +- applications/solvers/dfSprayFoam/Make/options | 2 +- .../cvodeSolver/constant/combustionProperties | 20 + src/dfChemistryModel/dfChemistryModel.C | 8 +- src/dfChemistryModel/dfChemistryModel.H | 2 + .../ChemistryCombustion/ChemistryCombustion.C | 7 +- .../ChemistryCombustion/ChemistryCombustion.H | 8 +- .../CombustionModel/CombustionModel.C | 7 +- .../CombustionModel/CombustionModel.H | 10 +- .../CombustionModel/CombustionModels.C | 7 +- .../ThermoCombustion/ThermoCombustion.C | 74 ---- .../ThermoCombustion/ThermoCombustion.H | 104 ------ src/dfCombustionModels/EDC/EDC.C | 6 +- src/dfCombustionModels/EDC/EDCs.C | 8 +- src/dfCombustionModels/FSD/FSD.C | 343 ------------------ src/dfCombustionModels/FSD/FSD.H | 180 --------- src/dfCombustionModels/FSD/FSDs.C | 98 ----- .../consumptionSpeed/consumptionSpeed.C | 134 ------- .../consumptionSpeed/consumptionSpeed.H | 143 -------- .../reactionRateFlameArea.C | 82 ----- .../reactionRateFlameArea.H | 164 --------- .../reactionRateFlameAreaNew.C | 69 ---- .../relaxation/relaxation.C | 169 --------- .../relaxation/relaxation.H | 122 ------- src/dfCombustionModels/Make/files | 9 +- src/dfCombustionModels/Make/options | 21 +- src/dfCombustionModels/PaSR/PaSRs.C | 9 +- src/dfCombustionModels/diffusion/diffusion.C | 112 ------ src/dfCombustionModels/diffusion/diffusion.H | 124 ------- src/dfCombustionModels/diffusion/diffusions.C | 100 ----- .../functionObjects/Qdot/Qdot.C | 117 ------ .../functionObjects/Qdot/Qdot.H | 109 ------ .../infinitelyFastChemistry.C | 109 ------ .../infinitelyFastChemistry.H | 121 ------ .../infinitelyFastChemistrys.C | 100 ----- src/dfCombustionModels/laminar/laminar.C | 51 ++- src/dfCombustionModels/laminar/laminars.C | 12 +- .../noCombustion/noCombustion.C | 101 ------ .../noCombustion/noCombustion.H | 118 ------ .../noCombustion/noCombustions.C | 42 --- .../greyMeanCombustion/greyMeanCombustion.C | 89 ----- .../greyMeanCombustion/greyMeanCombustion.H | 103 ------ .../wideBandCombustion/wideBandCombustion.C | 102 ------ .../wideBandCombustion/wideBandCombustion.H | 101 ------ .../singleStepCombustion.C | 159 -------- .../singleStepCombustion.H | 126 ------- .../zoneCombustion/zoneCombustion.C | 197 ---------- .../zoneCombustion/zoneCombustion.H | 145 -------- .../zoneCombustion/zoneCombustions.C | 42 --- 56 files changed, 155 insertions(+), 3968 deletions(-) create mode 100644 examples/zeroD_cubicReactor/H2/cvodeSolver/constant/combustionProperties delete mode 100644 src/dfCombustionModels/CombustionModel/ThermoCombustion/ThermoCombustion.C delete mode 100644 src/dfCombustionModels/CombustionModel/ThermoCombustion/ThermoCombustion.H delete mode 100644 src/dfCombustionModels/FSD/FSD.C delete mode 100644 src/dfCombustionModels/FSD/FSD.H delete mode 100644 src/dfCombustionModels/FSD/FSDs.C delete mode 100644 src/dfCombustionModels/FSD/reactionRateFlameAreaModels/consumptionSpeed/consumptionSpeed.C delete mode 100644 src/dfCombustionModels/FSD/reactionRateFlameAreaModels/consumptionSpeed/consumptionSpeed.H delete mode 100644 src/dfCombustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameArea.C delete mode 100644 src/dfCombustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameArea.H delete mode 100644 src/dfCombustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameAreaNew.C delete mode 100644 src/dfCombustionModels/FSD/reactionRateFlameAreaModels/relaxation/relaxation.C delete mode 100644 src/dfCombustionModels/FSD/reactionRateFlameAreaModels/relaxation/relaxation.H delete mode 100644 src/dfCombustionModels/diffusion/diffusion.C delete mode 100644 src/dfCombustionModels/diffusion/diffusion.H delete mode 100644 src/dfCombustionModels/diffusion/diffusions.C delete mode 100644 src/dfCombustionModels/functionObjects/Qdot/Qdot.C delete mode 100644 src/dfCombustionModels/functionObjects/Qdot/Qdot.H delete mode 100644 src/dfCombustionModels/infinitelyFastChemistry/infinitelyFastChemistry.C delete mode 100644 src/dfCombustionModels/infinitelyFastChemistry/infinitelyFastChemistry.H delete mode 100644 src/dfCombustionModels/infinitelyFastChemistry/infinitelyFastChemistrys.C delete mode 100644 src/dfCombustionModels/noCombustion/noCombustion.C delete mode 100644 src/dfCombustionModels/noCombustion/noCombustion.H delete mode 100644 src/dfCombustionModels/noCombustion/noCombustions.C delete mode 100644 src/dfCombustionModels/radiationModels/absorptionEmissionModels/greyMeanCombustion/greyMeanCombustion.C delete mode 100644 src/dfCombustionModels/radiationModels/absorptionEmissionModels/greyMeanCombustion/greyMeanCombustion.H delete mode 100644 src/dfCombustionModels/radiationModels/absorptionEmissionModels/wideBandCombustion/wideBandCombustion.C delete mode 100644 src/dfCombustionModels/radiationModels/absorptionEmissionModels/wideBandCombustion/wideBandCombustion.H delete mode 100644 src/dfCombustionModels/singleStepCombustion/singleStepCombustion.C delete mode 100644 src/dfCombustionModels/singleStepCombustion/singleStepCombustion.H delete mode 100644 src/dfCombustionModels/zoneCombustion/zoneCombustion.C delete mode 100644 src/dfCombustionModels/zoneCombustion/zoneCombustion.H delete mode 100644 src/dfCombustionModels/zoneCombustion/zoneCombustions.C diff --git a/Allwmake b/Allwmake index 923b8ec4..ab776f44 100755 --- a/Allwmake +++ b/Allwmake @@ -12,6 +12,7 @@ wmake src/dfChemistryModel wmake src/TurbulenceModels/compressible wmake src/regionModels/surfaceFilmModels src/lagrangian/Allwmake $targetType $* +wmake src/dfCombustionModels wmake applications/solvers/df0DFoam wmake applications/solvers/dfLowMachFoam diff --git a/applications/solvers/df0DFoam/EEqn.H b/applications/solvers/df0DFoam/EEqn.H index faba8642..b28d13dd 100644 --- a/applications/solvers/df0DFoam/EEqn.H +++ b/applications/solvers/df0DFoam/EEqn.H @@ -1,5 +1,5 @@ { volScalarField& he = thermo.he(); if (constProp == "volume") he[0] = u0 + p[0]/rho[0]; - chemistry.correctThermo(); + chemistry->correctThermo(); } diff --git a/applications/solvers/df0DFoam/Make/options b/applications/solvers/df0DFoam/Make/options index 7edf9048..8bb0b01c 100644 --- a/applications/solvers/df0DFoam/Make/options +++ b/applications/solvers/df0DFoam/Make/options @@ -9,7 +9,8 @@ EXE_INC = -std=c++14 \ -I$(LIB_SRC)/sampling/lnInclude \ -I$(LIB_SRC)/dynamicFvMesh/lnInclude \ -I$(DF_SRC)/CanteraMixture/lnInclude \ - -I$(DF_SRC)/dfChemistryModel \ + -I$(DF_SRC)/dfChemistryModel/lnInclude \ + -I$(DF_SRC)/dfCombustionModels/lnInclude \ -I$(CANTERA_ROOT)/include \ -I$(TORCH_ROOT)/include \ -I$(TORCH_ROOT)/include/torch/csrc/api/include @@ -27,6 +28,7 @@ EXE_LIBS = \ -ldfCompressibleTurbulenceModels \ -lCanteraMixture \ -ldfChemistryModel \ + -ldfCombustionModels \ $(CANTERA_ROOT)/lib/libcantera.so \ $(TORCH_ROOT)/lib/libtorch.so \ $(TORCH_ROOT)/lib/libc10.so \ diff --git a/applications/solvers/df0DFoam/YEqn.H b/applications/solvers/df0DFoam/YEqn.H index 2c0370d0..5f1a7e02 100644 --- a/applications/solvers/df0DFoam/YEqn.H +++ b/applications/solvers/df0DFoam/YEqn.H @@ -10,7 +10,8 @@ tmp> mvConvection ); { - chemistry.solve(mesh.time().deltaTValue()); + //chemistry.solve(mesh.time().deltaTValue()); + combustion->correct(); volScalarField Yt(0.0*Y[0]); @@ -24,7 +25,8 @@ tmp> mvConvection ( fvm::ddt(rho, Yi) == - chemistry.RR(i) + //chemistry.RR(i) + combustion->R(Yi) //+ fvOptions(rho, Yi) ); diff --git a/applications/solvers/df0DFoam/createFields.H b/applications/solvers/df0DFoam/createFields.H index fd529a3b..f0ddf365 100644 --- a/applications/solvers/df0DFoam/createFields.H +++ b/applications/solvers/df0DFoam/createFields.H @@ -87,12 +87,16 @@ multivariateSurfaceInterpolationScheme::fieldTable fields; #include "createMRF.H" //#include "createFvOptions.H" - - -dfChemistryModel chemistry(thermo); -PtrList& Y = chemistry.Y(); -const word inertSpecie(chemistry.lookup("inertSpecie")); -const label inertIndex(chemistry.species()[inertSpecie]); +Info<< "Creating reaction model\n" << endl; +autoPtr> combustion +( + CombustionModel::New(thermo, turbulence()) +); +Info<< "end Creating reaction model\n" << endl; +dfChemistryModel* chemistry = combustion->chemistry(); +PtrList& Y = chemistry->Y(); +const word inertSpecie(chemistry->lookup("inertSpecie")); +const label inertIndex(chemistry->species()[inertSpecie]); forAll(Y, i) { @@ -116,4 +120,4 @@ if } volScalarField& he = thermo.he(); -scalar u0 = he[0] - p[0]/rho[0]; \ No newline at end of file +scalar u0 = he[0] - p[0]/rho[0]; diff --git a/applications/solvers/df0DFoam/df0DFoam.C b/applications/solvers/df0DFoam/df0DFoam.C index a0ef43b2..142f459c 100644 --- a/applications/solvers/df0DFoam/df0DFoam.C +++ b/applications/solvers/df0DFoam/df0DFoam.C @@ -46,6 +46,8 @@ Description //#include "fvOptions.H" #include "localEulerDdtScheme.H" #include "fvcSmooth.H" +#include "basicThermo.H" +#include "CombustionModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/dfHighSpeedFoam/Make/options b/applications/solvers/dfHighSpeedFoam/Make/options index f5f42f89..f0898e1d 100644 --- a/applications/solvers/dfHighSpeedFoam/Make/options +++ b/applications/solvers/dfHighSpeedFoam/Make/options @@ -10,7 +10,7 @@ EXE_INC = -std=c++14 \ -I$(LIB_SRC)/dynamicFvMesh/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(DF_SRC)/CanteraMixture/lnInclude \ - -I$(DF_SRC)/dfChemistryModel \ + -I$(DF_SRC)/dfChemistryModel/lnInclude \ -I$(CANTERA_ROOT)/include \ -I$(TORCH_ROOT)/include \ -I$(TORCH_ROOT)/include/torch/csrc/api/include diff --git a/applications/solvers/dfLowMachFoam/Make/options b/applications/solvers/dfLowMachFoam/Make/options index 18cf9317..6e6f7d92 100644 --- a/applications/solvers/dfLowMachFoam/Make/options +++ b/applications/solvers/dfLowMachFoam/Make/options @@ -13,7 +13,7 @@ EXE_INC = -std=c++14 \ -I$(LIB_SRC)/dynamicFvMesh/lnInclude \ -I$(LIB_SRC)/Pstream/mpi \ -I$(DF_SRC)/CanteraMixture/lnInclude \ - -I$(DF_SRC)/dfChemistryModel \ + -I$(DF_SRC)/dfChemistryModel/lnInclude \ -I$(CANTERA_ROOT)/include \ -I$(TORCH_ROOT)/include \ -I$(TORCH_ROOT)/include/torch/csrc/api/include diff --git a/applications/solvers/dfSprayFoam/Make/options b/applications/solvers/dfSprayFoam/Make/options index 436a4f69..a7460794 100644 --- a/applications/solvers/dfSprayFoam/Make/options +++ b/applications/solvers/dfSprayFoam/Make/options @@ -23,7 +23,7 @@ EXE_INC = -std=c++14 \ -I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \ -I$(DF_SRC)/thermophysicalModels/SLGThermo/lnInclude \ -I$(DF_SRC)/CanteraMixture/lnInclude \ - -I$(DF_SRC)/dfChemistryModel \ + -I$(DF_SRC)/dfChemistryModel/lnInclude \ -I$(CANTERA_ROOT)/include \ -I$(TORCH_ROOT)/include \ -I$(TORCH_ROOT)/include/torch/csrc/api/include diff --git a/examples/zeroD_cubicReactor/H2/cvodeSolver/constant/combustionProperties b/examples/zeroD_cubicReactor/H2/cvodeSolver/constant/combustionProperties new file mode 100644 index 00000000..7418500d --- /dev/null +++ b/examples/zeroD_cubicReactor/H2/cvodeSolver/constant/combustionProperties @@ -0,0 +1,20 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 7 + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object combustionProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +combustionModel laminar; + +// ************************************************************************* // diff --git a/src/dfChemistryModel/dfChemistryModel.C b/src/dfChemistryModel/dfChemistryModel.C index 78a6014a..1457cbe3 100644 --- a/src/dfChemistryModel/dfChemistryModel.C +++ b/src/dfChemistryModel/dfChemistryModel.C @@ -409,13 +409,13 @@ Foam::scalar Foam::dfChemistryModel::torchSolve Cantera::ReactorNet sim; sim.addReactor(react); setNumerics(sim); - sim.advance(deltaT); + sim.advance(deltaT[cellI]); CanteraGas_->getMassFractions(yTemp_.begin()); for (size_t i=0; inSpecies(); i++) { - RR_[i][cellI] = (yTemp_[i] - yPre_[i])*rhoi/deltaT; + RR_[i][cellI] = (yTemp_[i] - yPre_[i])*rhoi/deltaT[cellI]; const scalar hc = CanteraGas_->Hf298SS(i)/CanteraGas_->molecularWeight(i); // J/kg Qdot_[cellI] -= hc*RR_[i][cellI]; } @@ -439,13 +439,13 @@ Foam::scalar Foam::dfChemistryModel::torchSolve for (size_t i=0; i<(CanteraGas_->nSpecies()); i++)// { u_[i+2] = outputs[cellI][i+2].item().to()*Ystd_[i+2]+Ymu_[i+2]; - yTemp_[i] = pow((yBCT_[i] + u_[i+2]*deltaT)*lambda+1,1/lambda); + yTemp_[i] = pow((yBCT_[i] + u_[i+2]*deltaT[cellI])*lambda+1,1/lambda); Yt += yTemp_[i]; } for (size_t i=0; inSpecies(); i++) { yTemp_[i] = yTemp_[i] / Yt; - RR_[i][torch_cell[cellI]] = (yTemp_[i] - Y_[i][torch_cell[cellI]])*rho_[torch_cell[cellI]]/deltaT; + RR_[i][torch_cell[cellI]] = (yTemp_[i] - Y_[i][torch_cell[cellI]])*rho_[torch_cell[cellI]]/deltaT[cellI]; const scalar hc = CanteraGas_->Hf298SS(i)/CanteraGas_->molecularWeight(i); // J/kg Qdot_[torch_cell[cellI]] -= hc*RR_[i][torch_cell[cellI]]; } diff --git a/src/dfChemistryModel/dfChemistryModel.H b/src/dfChemistryModel/dfChemistryModel.H index a8e527f4..5634603d 100644 --- a/src/dfChemistryModel/dfChemistryModel.H +++ b/src/dfChemistryModel/dfChemistryModel.H @@ -178,6 +178,8 @@ public: // update T, psi, mu, alpha, rhoD, hai (if needed) void correctThermo(); + + ThermoType& thermo() {return thermo_;} }; diff --git a/src/dfCombustionModels/CombustionModel/ChemistryCombustion/ChemistryCombustion.C b/src/dfCombustionModels/CombustionModel/ChemistryCombustion/ChemistryCombustion.C index 5041995d..c6f1fb18 100644 --- a/src/dfCombustionModels/CombustionModel/ChemistryCombustion/ChemistryCombustion.C +++ b/src/dfCombustionModels/CombustionModel/ChemistryCombustion/ChemistryCombustion.C @@ -42,8 +42,7 @@ Foam::ChemistryCombustion::ChemistryCombustion thermo, turb, combustionProperties - ), - chemistryPtr_(BasicChemistryModel::New(thermo)) + ) {} @@ -61,7 +60,7 @@ template ReactionThermo& Foam::ChemistryCombustion::thermo() { - return chemistryPtr_->thermo(); + return this->chemistryPtr_->thermo(); } @@ -69,7 +68,7 @@ template const ReactionThermo& Foam::ChemistryCombustion::thermo() const { - return chemistryPtr_->thermo(); + return this->chemistryPtr_->thermo(); } diff --git a/src/dfCombustionModels/CombustionModel/ChemistryCombustion/ChemistryCombustion.H b/src/dfCombustionModels/CombustionModel/ChemistryCombustion/ChemistryCombustion.H index bb48b840..1f023fb4 100644 --- a/src/dfCombustionModels/CombustionModel/ChemistryCombustion/ChemistryCombustion.H +++ b/src/dfCombustionModels/CombustionModel/ChemistryCombustion/ChemistryCombustion.H @@ -35,9 +35,11 @@ SourceFiles #ifndef ChemistryCombustion_H #define ChemistryCombustion_H +#include "dfChemistryModel.H" #include "autoPtr.H" #include "CombustionModel.H" -#include "BasicChemistryModel.H" +//#include "BasicChemistryModel.H" + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -57,9 +59,6 @@ protected: // Protected data - //- Pointer to chemistry model - autoPtr> chemistryPtr_; - public: @@ -86,6 +85,7 @@ public: //- Return const access to the thermo package virtual const ReactionThermo& thermo() const; + }; diff --git a/src/dfCombustionModels/CombustionModel/CombustionModel/CombustionModel.C b/src/dfCombustionModels/CombustionModel/CombustionModel/CombustionModel.C index e3d546c2..13208553 100644 --- a/src/dfCombustionModels/CombustionModel/CombustionModel/CombustionModel.C +++ b/src/dfCombustionModels/CombustionModel/CombustionModel/CombustionModel.C @@ -36,7 +36,8 @@ Foam::CombustionModel::CombustionModel const word& combustionProperties ) : - combustionModel(modelType, thermo, turb, combustionProperties) + combustionModel(modelType, thermo, turb, combustionProperties), + chemistryPtr_(new dfChemistryModel(thermo)) {} @@ -65,7 +66,9 @@ Foam::CombustionModel::New template Foam::CombustionModel::~CombustionModel() -{} +{ + delete chemistryPtr_; +} // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // diff --git a/src/dfCombustionModels/CombustionModel/CombustionModel/CombustionModel.H b/src/dfCombustionModels/CombustionModel/CombustionModel/CombustionModel.H index 219b435e..4e48c0f7 100644 --- a/src/dfCombustionModels/CombustionModel/CombustionModel/CombustionModel.H +++ b/src/dfCombustionModels/CombustionModel/CombustionModel/CombustionModel.H @@ -37,6 +37,7 @@ SourceFiles #ifndef CombustionModel_H #define CombustionModel_H +#include "dfChemistryModel.H" #include "combustionModel.H" #include "autoPtr.H" #include "runTimeSelectionTables.H" @@ -55,6 +56,10 @@ class CombustionModel : public combustionModel { +protected: + + dfChemistryModel* chemistryPtr_; + public: //- Thermo type @@ -114,6 +119,9 @@ public: //- Return const access to the thermo package virtual const ReactionThermo& thermo() const = 0; + void correctThermo(); + dfChemistryModel* chemistry() { return chemistryPtr_;} + // IO @@ -136,4 +144,4 @@ public: #endif -// ************************************************************************* // +// ************************************************************************* // \ No newline at end of file diff --git a/src/dfCombustionModels/CombustionModel/CombustionModel/CombustionModels.C b/src/dfCombustionModels/CombustionModel/CombustionModel/CombustionModels.C index 6348a5a8..d5bb1813 100644 --- a/src/dfCombustionModels/CombustionModel/CombustionModel/CombustionModels.C +++ b/src/dfCombustionModels/CombustionModel/CombustionModel/CombustionModels.C @@ -24,19 +24,16 @@ License \*---------------------------------------------------------------------------*/ #include "makeCombustionTypes.H" - #include "CombustionModel.H" +#include "basicThermo.H" -#include "rhoReactionThermo.H" -#include "psiReactionThermo.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { -makeCombustion(psiReactionThermo); -makeCombustion(rhoReactionThermo); +makeCombustion(basicThermo); } diff --git a/src/dfCombustionModels/CombustionModel/ThermoCombustion/ThermoCombustion.C b/src/dfCombustionModels/CombustionModel/ThermoCombustion/ThermoCombustion.C deleted file mode 100644 index c2fb017a..00000000 --- a/src/dfCombustionModels/CombustionModel/ThermoCombustion/ThermoCombustion.C +++ /dev/null @@ -1,74 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2012-2018 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 "ThermoCombustion.H" - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -template -Foam::ThermoCombustion::ThermoCombustion -( - const word& modelType, - ReactionThermo& thermo, - const compressibleTurbulenceModel& turb -) -: - CombustionModel - ( - modelType, - thermo, - turb, - combustionModel::combustionPropertiesName - ), - thermo_(thermo) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -template -Foam::ThermoCombustion::~ThermoCombustion() -{} - - -// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // - -template -ReactionThermo& -Foam::ThermoCombustion::thermo() -{ - return thermo_; -} - - -template -const ReactionThermo& -Foam::ThermoCombustion::thermo() const -{ - return thermo_; -} - - -// ************************************************************************* // diff --git a/src/dfCombustionModels/CombustionModel/ThermoCombustion/ThermoCombustion.H b/src/dfCombustionModels/CombustionModel/ThermoCombustion/ThermoCombustion.H deleted file mode 100644 index a772f1c2..00000000 --- a/src/dfCombustionModels/CombustionModel/ThermoCombustion/ThermoCombustion.H +++ /dev/null @@ -1,104 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2012-2018 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 . - -Class - Foam::ThermoCombustion - -Description - Thermo model wrapper for combustion models - -SourceFiles - ThermoCombustion.C - -\*---------------------------------------------------------------------------*/ - -#ifndef ThermoCombustion_H -#define ThermoCombustion_H - -#include "autoPtr.H" -#include "CombustionModel.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - class ThermoCombustion Declaration -\*---------------------------------------------------------------------------*/ - -template -class ThermoCombustion -: - public CombustionModel -{ -protected: - - // Protected data - - //- Thermo - ReactionThermo& thermo_; - - -public: - - // Constructors - - //- Construct from components - ThermoCombustion - ( - const word& modelType, - ReactionThermo& thermo, - const compressibleTurbulenceModel& turb - ); - - - //- Destructor - virtual ~ThermoCombustion(); - - - // Member Functions - - //- Return access to the thermo package - virtual ReactionThermo& thermo(); - - //- Return const access to the thermo package - virtual const ReactionThermo& thermo() const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#ifdef NoRepository - #include "ThermoCombustion.C" -#endif - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/dfCombustionModels/EDC/EDC.C b/src/dfCombustionModels/EDC/EDC.C index 762a563d..ff544485 100644 --- a/src/dfCombustionModels/EDC/EDC.C +++ b/src/dfCombustionModels/EDC/EDC.C @@ -58,7 +58,7 @@ Foam::combustionModels::EDC::EDC ( IOobject ( - this->thermo().phasePropertyName(typeName + ":kappa"), + "EDC_kappa", this->mesh().time().timeName(), this->mesh(), IOobject::NO_READ, @@ -98,7 +98,7 @@ void Foam::combustionModels::EDC::correct() if (version_ == EDCversions::v2016) { - tmp ttc(this->chemistryPtr_->tc()); + tmp ttc(this->tc()); const volScalarField& tc = ttc(); forAll(tauStar, i) @@ -185,7 +185,7 @@ Foam::combustionModels::EDC::Qdot() const { return volScalarField::New ( - this->thermo().phasePropertyName(typeName + ":Qdot"), + "EDC_Qdot", kappa_*this->chemistryPtr_->Qdot() ); } diff --git a/src/dfCombustionModels/EDC/EDCs.C b/src/dfCombustionModels/EDC/EDCs.C index 2003ad07..cc87df66 100644 --- a/src/dfCombustionModels/EDC/EDCs.C +++ b/src/dfCombustionModels/EDC/EDCs.C @@ -23,11 +23,10 @@ License \*---------------------------------------------------------------------------*/ +#include "EDC.H" #include "makeCombustionTypes.H" -#include "psiReactionThermo.H" -#include "rhoReactionThermo.H" -#include "EDC.H" +#include "basicThermo.H" // * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * * // @@ -58,8 +57,7 @@ Foam::combustionModels::EDCdefaultVersion namespace Foam { -makeCombustionTypes(EDC, psiReactionThermo); -makeCombustionTypes(EDC, rhoReactionThermo); +makeCombustionTypes(EDC, basicThermo); } diff --git a/src/dfCombustionModels/FSD/FSD.C b/src/dfCombustionModels/FSD/FSD.C deleted file mode 100644 index 36d27a64..00000000 --- a/src/dfCombustionModels/FSD/FSD.C +++ /dev/null @@ -1,343 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 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 "FSD.H" -#include "addToRunTimeSelectionTable.H" -#include "LESModel.H" -#include "fvcGrad.H" -#include "fvcDiv.H" - -namespace Foam -{ -namespace combustionModels -{ - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -template -FSD::FSD -( - const word& modelType, - ReactionThermo& thermo, - const compressibleTurbulenceModel& turb, - const word& combustionProperties -) -: - singleStepCombustion - ( - modelType, - thermo, - turb, - combustionProperties - ), - reactionRateFlameArea_ - ( - reactionRateFlameArea::New - ( - this->coeffs(), - this->mesh(), - *this - ) - ), - ft_ - ( - IOobject - ( - this->thermo().phasePropertyName("ft"), - this->mesh().time().timeName(), - this->mesh(), - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - this->mesh(), - dimensionedScalar(dimless, 0) - ), - YFuelFuelStream_(dimensionedScalar(dimless, 1.0)), - YO2OxiStream_(dimensionedScalar(dimless, 0.23)), - Cv_(readScalar(this->coeffs().lookup("Cv"))), - C_(5.0), - ftMin_(0.0), - ftMax_(1.0), - ftDim_(300), - ftVarMin_(readScalar(this->coeffs().lookup("ftVarMin"))) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -template -FSD::~FSD() -{} - - -// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // - -template -void FSD::calculateSourceNorm() -{ - this->singleMixturePtr_->fresCorrect(); - - const label fuelI = this->singleMixturePtr_->fuelIndex(); - - const volScalarField& YFuel = this->thermo().composition().Y()[fuelI]; - - const volScalarField& YO2 = this->thermo().composition().Y("O2"); - - const dimensionedScalar s = this->singleMixturePtr_->s(); - - ft_ = - (s*YFuel - (YO2 - YO2OxiStream_))/(s*YFuelFuelStream_ + YO2OxiStream_); - - - volVectorField nft(fvc::grad(ft_)); - - volScalarField mgft(mag(nft)); - - surfaceVectorField SfHat(this->mesh().Sf()/this->mesh().magSf()); - - volScalarField cAux(scalar(1) - ft_); - - dimensionedScalar dMgft = 1.0e-3* - (ft_*cAux*mgft)().weightedAverage(this->mesh().V()) - /((ft_*cAux)().weightedAverage(this->mesh().V()) + small) - + dimensionedScalar(mgft.dimensions(), small); - - mgft += dMgft; - - nft /= mgft; - - const volVectorField& U = YO2.db().lookupObject("U"); - - const volScalarField sigma - ( - (nft & nft)*fvc::div(U) - (nft & fvc::grad(U) & nft) - ); - - reactionRateFlameArea_->correct(sigma); - - const volScalarField& omegaFuel = reactionRateFlameArea_->omega(); - - - const scalar ftStoich = - YO2OxiStream_.value() - /( - s.value()*YFuelFuelStream_.value() + YO2OxiStream_.value() - ); - - tmp tPc - ( - volScalarField::New - ( - this->thermo().phasePropertyName("Pc"), - U.mesh(), - dimensionedScalar(dimless, 0) - ) - ); - - volScalarField& pc = tPc.ref(); - - tmp tomegaFuel - ( - volScalarField::New - ( - this->thermo().phasePropertyName("omegaFuelBar"), - U.mesh(), - dimensionedScalar(omegaFuel.dimensions(), 0) - ) - ); - - volScalarField& omegaFuelBar = tomegaFuel.ref(); - - // Calculation of the mixture fraction variance (ftVar) - const compressible::LESModel& lesModel = - YO2.db().lookupObject - ( - turbulenceModel::propertiesName - ); - - const volScalarField& delta = lesModel.delta(); - const volScalarField ftVar(Cv_*sqr(delta)*sqr(mgft)); - - // Thickened flame (average flame thickness for counterflow configuration - // is 1.5 mm) - - volScalarField deltaF - ( - lesModel.delta()/dimensionedScalar(dimLength, 1.5e-3) - ); - - // Linear correlation between delta and flame thickness - volScalarField omegaF(max(deltaF*(4.0/3.0) + (2.0/3.0), scalar(1))); - - scalar deltaFt = 1.0/ftDim_; - - forAll(ft_, celli) - { - if (ft_[celli] > ftMin_ && ft_[celli] < ftMax_) - { - scalar ftCell = ft_[celli]; - - if (ftVar[celli] > ftVarMin_) // sub-grid beta pdf of ft_ - { - scalar ftVarc = ftVar[celli]; - scalar a = - max(ftCell*(ftCell*(1.0 - ftCell)/ftVarc - 1.0), 0.0); - scalar b = max(a/ftCell - a, 0.0); - - for (int i=1; i productsIndex(2, label(-1)); - { - label i = 0; - forAll(this->singleMixturePtr_->specieProd(), specieI) - { - if (this->singleMixturePtr_->specieProd()[specieI] < 0) - { - productsIndex[i] = specieI; - i++; - } - } - } - - - // Flamelet probability of the progress c based on IFC (reuse pc) - scalar YprodTotal = 0; - forAll(productsIndex, j) - { - YprodTotal += this->singleMixturePtr_->Yprod0()[productsIndex[j]]; - } - - forAll(ft_, celli) - { - if (ft_[celli] < ftStoich) - { - pc[celli] = ft_[celli]*(YprodTotal/ftStoich); - } - else - { - pc[celli] = (1.0 - ft_[celli])*(YprodTotal/(1.0 - ftStoich)); - } - } - - tmp tproducts - ( - volScalarField::New - ( - this->thermo().phasePropertyName("products"), - U.mesh(), - dimensionedScalar(dimless, 0) - ) - ); - - volScalarField& products = tproducts.ref(); - - forAll(productsIndex, j) - { - label specieI = productsIndex[j]; - const volScalarField& Yp = this->thermo().composition().Y()[specieI]; - products += Yp; - } - - volScalarField c - ( - max(scalar(1) - products/max(pc, scalar(1e-5)), scalar(0)) - ); - - pc = min(C_*c, scalar(1)); - - const volScalarField fres(this->singleMixturePtr_->fres(fuelI)); - - this->wFuel_ == mgft*pc*omegaFuelBar; -} - - -template -void FSD::correct() -{ - this->wFuel_ == - dimensionedScalar(dimMass/pow3(dimLength)/dimTime, 0); - - calculateSourceNorm(); -} - - -template -bool FSD::read() -{ - if (singleStepCombustion::read()) - { - this->coeffs().lookup("Cv") >> Cv_ ; - this->coeffs().lookup("ftVarMin") >> ftVarMin_; - reactionRateFlameArea_->read(this->coeffs()); - return true; - } - else - { - return false; - } -} - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace combustionModels -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/dfCombustionModels/FSD/FSD.H b/src/dfCombustionModels/FSD/FSD.H deleted file mode 100644 index 1cf72093..00000000 --- a/src/dfCombustionModels/FSD/FSD.H +++ /dev/null @@ -1,180 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2019 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 . - -Class - Foam::combustionModels::FSD - -Description - - Flame Surface Dennsity (FDS) combustion model. - - The fuel source term is given by mgft*pc*omegaFuelBar. - - where: - mgft: filtered flame area. - pc: probability of the combustion progress. - omegaFuelBar: filtered consumption speed per unit of flame area. - - pc is considered from the IFC solution. - omegaFuelBar is calculated solving a relaxation equation which tends to - omegaEq. This omegaEq is obtained from the flamelet solution for - different strain rates and fit using a expential distribution. - - The spacial distribution of the consumption speed (omega) is obtained also - from a strained flamelet solution and it is assumed to have a gaussian - distribution. - - If the grid resolution is not enough to resolve the flame, the consumption - speed distribution is linearly thickened conserving the overall heat - release. - - If the turbulent fluctuation of the mixture fraction at the sub-grid level - is large (>1e-04) then a beta pdf is used for filtering. - - At the moment the flame area combustion model is only fit to work in a LES - frame work. In RAS the subgrid fluctuation has to be solved by an extra - transport equation. - -SourceFiles - FSD.C - -\*---------------------------------------------------------------------------*/ - -#ifndef FSD_H -#define FSD_H - -#include "singleStepCombustion.H" -#include "reactionRateFlameArea.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace combustionModels -{ - -/*---------------------------------------------------------------------------*\ - Class FSD Declaration -\*---------------------------------------------------------------------------*/ - -template -class FSD -: - public singleStepCombustion -{ - // Private Data - - //- Auto pointer to consumption speed per unit of flame area model - autoPtr reactionRateFlameArea_; - - //- Mixture fraction - volScalarField ft_; - - //- Fuel mass concentration on the fuel stream - dimensionedScalar YFuelFuelStream_; - - //- Oxygen mass concentration on the oxydizer stream - dimensionedScalar YO2OxiStream_; - - //- Similarity constant for the sub-grid ft fluctuations - scalar Cv_; - - //- Model constant - scalar C_; - - //- Lower flammability limit - scalar ftMin_; - - //- Upper flammability limit - scalar ftMax_; - - //- Dimension of the ft space. Used to integrate the beta-pdf - scalar ftDim_; - - //- Minimum mixture freaction variance to calculate pdf - scalar ftVarMin_; - - - // Private Member Functions - - //- Calculate the normalised fuel source term - void calculateSourceNorm(); - - -public: - - //- Runtime type information - TypeName("FSD"); - - - // Constructors - - //- Construct from components - FSD - ( - const word& modelType, - ReactionThermo& thermo, - const compressibleTurbulenceModel& turb, - const word& combustionProperties - ); - - //- Disallow default bitwise copy construction - FSD(const FSD&); - - - //- Destructor - virtual ~FSD(); - - - // Member Functions - - //- Correct combustion rate - virtual void correct(); - - //- Update properties - virtual bool read(); - - - // Member Operators - - //- Disallow default bitwise assignment - void operator=(const FSD&) = delete; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace combustionModels -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#ifdef NoRepository - #include "FSD.C" -#endif - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/dfCombustionModels/FSD/FSDs.C b/src/dfCombustionModels/FSD/FSDs.C deleted file mode 100644 index 28d07399..00000000 --- a/src/dfCombustionModels/FSD/FSDs.C +++ /dev/null @@ -1,98 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 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 "psiReactionThermo.H" -#include "rhoReactionThermo.H" -#include "FSD.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// Combustion models based on sensibleEnthalpy -makeCombustionTypesThermo -( - FSD, - psiReactionThermo, - gasHThermoPhysics -); - -makeCombustionTypesThermo -( - FSD, - psiReactionThermo, - constGasHThermoPhysics -); - -makeCombustionTypesThermo -( - FSD, - rhoReactionThermo, - gasHThermoPhysics -); - -makeCombustionTypesThermo -( - FSD, - rhoReactionThermo, - constGasHThermoPhysics -); - -// Combustion models based on sensibleInternalEnergy -makeCombustionTypesThermo -( - FSD, - psiReactionThermo, - gasEThermoPhysics -); - -makeCombustionTypesThermo -( - FSD, - psiReactionThermo, - constGasEThermoPhysics -); - -makeCombustionTypesThermo -( - FSD, - rhoReactionThermo, - gasEThermoPhysics -); - -makeCombustionTypesThermo -( - FSD, - rhoReactionThermo, - constGasEThermoPhysics -); - -} - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/dfCombustionModels/FSD/reactionRateFlameAreaModels/consumptionSpeed/consumptionSpeed.C b/src/dfCombustionModels/FSD/reactionRateFlameAreaModels/consumptionSpeed/consumptionSpeed.C deleted file mode 100644 index 385c90a9..00000000 --- a/src/dfCombustionModels/FSD/reactionRateFlameAreaModels/consumptionSpeed/consumptionSpeed.C +++ /dev/null @@ -1,134 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 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 "consumptionSpeed.H" - -/* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */ - -namespace Foam -{ - defineTypeNameAndDebug(consumptionSpeed, 0); -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::consumptionSpeed::consumptionSpeed -( - const dictionary& dict -) -: omega0_(readScalar(dict.lookup("omega0"))), - eta_(readScalar(dict.lookup("eta"))), - sigmaExt_(readScalar(dict.lookup("sigmaExt"))), - omegaMin_(readScalar(dict.lookup("omegaMin"))) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::consumptionSpeed::~consumptionSpeed() -{} - - -// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // - -Foam::scalar Foam::consumptionSpeed::omega0Sigma -( - scalar sigma, - 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; -} - - -Foam::tmp Foam::consumptionSpeed::omega0Sigma -( - const volScalarField& sigma -) -{ - tmp tomega0 - ( - volScalarField::New - ( - "omega0", - sigma.mesh(), - dimensionedScalar - ( - dimensionSet(1, -2, -1, 0, 0, 0, 0), - 0 - ) - ) - ); - - volScalarField& omega0 = tomega0.ref(); - - volScalarField::Internal& iomega0 = omega0; - - forAll(iomega0, celli) - { - iomega0[celli] = omega0Sigma(sigma[celli], 1.0); - } - - volScalarField::Boundary& bomega0 = omega0.boundaryFieldRef(); - - forAll(bomega0, patchi) - { - forAll(bomega0[patchi], facei) - { - bomega0[patchi][facei] = - omega0Sigma - ( - sigma.boundaryField()[patchi][facei], - 1.0 - ); - } - } - - return tomega0; -} - - -void Foam::consumptionSpeed::read(const dictionary& dict) -{ - dict.lookup("omega0") >> omega0_ ; - dict.lookup("eta") >> eta_ ; - dict.lookup("sigmaExt") >> sigmaExt_; - dict.lookup("omegaMin") >> omegaMin_; -} - - -// ************************************************************************* // diff --git a/src/dfCombustionModels/FSD/reactionRateFlameAreaModels/consumptionSpeed/consumptionSpeed.H b/src/dfCombustionModels/FSD/reactionRateFlameAreaModels/consumptionSpeed/consumptionSpeed.H deleted file mode 100644 index c10b3b1b..00000000 --- a/src/dfCombustionModels/FSD/reactionRateFlameAreaModels/consumptionSpeed/consumptionSpeed.H +++ /dev/null @@ -1,143 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2019 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 . - -Class - Foam::consumptionSpeed - -Description - Correlation function for laminar consumption speed obtained from flamelet - solution at increasing strain rates. - -SourceFiles - consumptionSpeed.C - -\*---------------------------------------------------------------------------*/ - -#ifndef consumptionSpeed_H -#define consumptionSpeed_H - -#include "IOdictionary.H" -#include "volFields.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class consumptionSpeed Declaration -\*---------------------------------------------------------------------------*/ - -class consumptionSpeed -{ - // Private Data - - //- Maximum consumption speed - scalar omega0_; - - //- Exponential factor - scalar eta_; - - //- Extinction strain - scalar sigmaExt_; - - //- Minimum consumption speed - scalar omegaMin_; - - - // Private Member Functions - - //- Return consumption rate - scalar omega0Sigma(scalar sigma, scalar a) const; - - -public: - - //- Runtime type information - TypeName("consumptionSpeed"); - - - // Constructors - - //- Construct from dictionary - consumptionSpeed(const dictionary& dict); - - //- Disallow default bitwise copy construction - consumptionSpeed(const consumptionSpeed&); - - - //- Destructor - virtual ~consumptionSpeed(); - - - // Member Functions - - //- Return speed consumption rate temp - tmp omega0Sigma(const volScalarField& sigma); - - - // Access functions - - scalar omega0() const - { - return omega0_; - } - - scalar eta() const - { - return eta_; - } - - scalar sigmaExt() const - { - return sigmaExt_; - } - - scalar omegaMin() const - { - return omegaMin_; - } - - - // IO - - //- Update properties - void read(const dictionary& dict); - - - // Member Operators - - //- Disallow default bitwise assignment - void operator=(const consumptionSpeed&) = delete; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/dfCombustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameArea.C b/src/dfCombustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameArea.C deleted file mode 100644 index 034f6132..00000000 --- a/src/dfCombustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameArea.C +++ /dev/null @@ -1,82 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 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 "reactionRateFlameArea.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(reactionRateFlameArea, 0); - defineRunTimeSelectionTable(reactionRateFlameArea, dictionary); -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::reactionRateFlameArea::reactionRateFlameArea -( - const word& modelType, - const dictionary& dict, - const fvMesh& mesh, - const combustionModel& combModel -) -: - coeffDict_(dict.optionalSubDict(modelType + "Coeffs")), - mesh_(mesh), - combModel_(combModel), - fuel_(dict.lookup("fuel")), - omega_ - ( - IOobject - ( - "FSDomega", - mesh_.time().timeName(), - mesh_, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - mesh_ - ) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::reactionRateFlameArea::~reactionRateFlameArea() -{} - - -// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // - -bool Foam::reactionRateFlameArea::read(const dictionary& dict) -{ - dict.lookup("fuel") >> fuel_; - - return true; -} - - -// ************************************************************************* // diff --git a/src/dfCombustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameArea.H b/src/dfCombustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameArea.H deleted file mode 100644 index a7b8ee0d..00000000 --- a/src/dfCombustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameArea.H +++ /dev/null @@ -1,164 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2019 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 . - -Class - Foam::reactionRateFlameArea - -Description - Abstract class for reaction rate per flame area unit - -SourceFiles - reactionRateFlameArea.C - reactionRateFlameAreaNew.C - -\*---------------------------------------------------------------------------*/ - -#ifndef reactionRateFlameArea_H -#define reactionRateFlameArea_H - -#include "runTimeSelectionTables.H" -#include "dictionary.H" -#include "autoPtr.H" -#include "volFields.H" -#include "combustionModel.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -class fvMesh; - -/*---------------------------------------------------------------------------*\ - Class reactionRateFlameArea Declaration -\*---------------------------------------------------------------------------*/ - -class reactionRateFlameArea -{ - -protected: - - // Protected data - - //- Dictionary - dictionary coeffDict_; - - //- Mesh reference - const fvMesh& mesh_; - - //- Combstion model owner - const combustionModel& combModel_; - - //- Fuel name - word fuel_; - - //- Fuel consumption rate per unit of flame area - volScalarField omega_; - - -public: - - //- Runtime type information - TypeName("reactionRateFlameArea"); - - - // Declare run-time constructor selection table - - declareRunTimeSelectionTable - ( - autoPtr, - reactionRateFlameArea, - dictionary, - ( - const word modelType, - const dictionary& dict, - const fvMesh& mesh, - const combustionModel& combModel - ), - (modelType, dict, mesh, combModel) - ); - - - // Constructors - - //- Construct from components - reactionRateFlameArea - ( - const word& modelType, - const dictionary& dict, - const fvMesh& mesh, - const combustionModel& combModel - ); - - //- Disallow default bitwise copy construction - reactionRateFlameArea(const reactionRateFlameArea&); - - - // Selector - - static autoPtr New - ( - const dictionary& dict, - const fvMesh& mesh, - const combustionModel& combModel - ); - - - // Destructor - - virtual ~reactionRateFlameArea(); - - - // Member Functions - - //- Access functions - - //- Return omega - const volScalarField& omega() const - { - return omega_; - } - - - //- Correct omega - virtual void correct(const volScalarField& sigma) = 0; - - //- Update from dictionary - virtual bool read(const dictionary& dictProperties); - - - // Member Operators - - //- Disallow default bitwise assignment - void operator=(const reactionRateFlameArea&) = delete; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/dfCombustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameAreaNew.C b/src/dfCombustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameAreaNew.C deleted file mode 100644 index 7d465999..00000000 --- a/src/dfCombustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameAreaNew.C +++ /dev/null @@ -1,69 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 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 "reactionRateFlameArea.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -Foam::autoPtr Foam::reactionRateFlameArea::New -( - const dictionary& dict, - const fvMesh& mesh, - const combustionModel& combModel -) -{ - word reactionRateFlameAreaType - ( - dict.lookup("reactionRateFlameArea") - ); - - Info<< "Selecting reaction rate flame area correlation " - << reactionRateFlameAreaType << endl; - - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(reactionRateFlameAreaType); - - if (cstrIter == dictionaryConstructorTablePtr_->end()) - { - FatalIOErrorInFunction - ( - dict - ) << "Unknown reactionRateFlameArea type " - << reactionRateFlameAreaType << endl << endl - << "Valid reaction rate flame area types are :" << endl - << dictionaryConstructorTablePtr_->toc() - << exit(FatalIOError); - } - - const label tempOpen = reactionRateFlameAreaType.find('<'); - - const word className = reactionRateFlameAreaType(0, tempOpen); - - return autoPtr - (cstrIter()(className, dict, mesh, combModel)); -} - - -// ************************************************************************* // diff --git a/src/dfCombustionModels/FSD/reactionRateFlameAreaModels/relaxation/relaxation.C b/src/dfCombustionModels/FSD/reactionRateFlameAreaModels/relaxation/relaxation.C deleted file mode 100644 index 0edab693..00000000 --- a/src/dfCombustionModels/FSD/reactionRateFlameAreaModels/relaxation/relaxation.C +++ /dev/null @@ -1,169 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 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 "relaxation.H" -#include "addToRunTimeSelectionTable.H" -#include "fvm.H" -#include "LESModel.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ -namespace reactionRateFlameAreaModels -{ - defineTypeNameAndDebug(relaxation, 0); - addToRunTimeSelectionTable - ( - reactionRateFlameArea, - relaxation, - dictionary - ); -} -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::reactionRateFlameAreaModels::relaxation::relaxation -( - const word modelType, - const dictionary& dict, - const fvMesh& mesh, - const combustionModel& combModel -) -: - reactionRateFlameArea(modelType, dict, mesh, combModel), - correlation_(dict.optionalSubDict(typeName + "Coeffs").subDict(fuel_)), - C_(readScalar(dict.optionalSubDict(typeName + "Coeffs").lookup("C"))), - alpha_ - ( - readScalar(dict.optionalSubDict(typeName + "Coeffs").lookup("alpha")) - ) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::reactionRateFlameAreaModels::relaxation::~relaxation() -{} - - -// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // - -void Foam::reactionRateFlameAreaModels::relaxation::correct -( - const volScalarField& sigma -) -{ - dimensionedScalar omega0 - ( - "omega0", - dimensionSet(1, -2, -1, 0, 0, 0, 0), - correlation_.omega0() - ); - - dimensionedScalar sigmaExt - ( - "sigmaExt", - dimensionSet(0, 0, -1, 0, 0, 0, 0), - correlation_.sigmaExt() - ); - - dimensionedScalar omegaMin - ( - "omegaMin", - omega0.dimensions(), - 1e-4 - ); - - dimensionedScalar kMin - ( - "kMin", - sqr(dimVelocity), - small - ); - - const compressibleTurbulenceModel& turbulence = combModel_.turbulence(); - - // Total strain - const volScalarField sigmaTotal - ( - sigma + alpha_*turbulence.epsilon()/(turbulence.k() + kMin) - ); - - const volScalarField omegaInf(correlation_.omega0Sigma(sigmaTotal)); - - dimensionedScalar sigma0("sigma0", sigma.dimensions(), 0.0); - - const volScalarField tau(C_*mag(sigmaTotal)); - - volScalarField Rc - ( - (tau*omegaInf*(omega0 - omegaInf) + sqr(omegaMin)*sigmaExt) - /(sqr(omega0 - omegaInf) + sqr(omegaMin)) - ); - - const volScalarField& rho = combModel_.rho(); - const tmp tphi = combModel_.phi(); - const surfaceScalarField& phi = tphi(); - - solve - ( - fvm::ddt(rho, omega_) - + fvm::div(phi, omega_) - == - rho*Rc*omega0 - - fvm::SuSp(rho*(tau + Rc), omega_) - ); - - omega_.min(omega0); - omega_.max(0.0); -} - - -bool Foam::reactionRateFlameAreaModels::relaxation::read -( - const dictionary& dict -) -{ - if (reactionRateFlameArea::read(dict)) - { - coeffDict_ = dict.optionalSubDict(typeName + "Coeffs"); - coeffDict_.lookup("C") >> C_; - coeffDict_.lookup("alpha") >> alpha_; - correlation_.read - ( - coeffDict_.subDict(fuel_) - ); - return true; - } - else - { - return false; - } -} - -// ************************************************************************* // diff --git a/src/dfCombustionModels/FSD/reactionRateFlameAreaModels/relaxation/relaxation.H b/src/dfCombustionModels/FSD/reactionRateFlameAreaModels/relaxation/relaxation.H deleted file mode 100644 index b086ba04..00000000 --- a/src/dfCombustionModels/FSD/reactionRateFlameAreaModels/relaxation/relaxation.H +++ /dev/null @@ -1,122 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2019 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 . - -Class - Foam::reactionRateFlameAreaModels::relaxation - -Description - Consumption rate per unit of flame area obtained from a relaxation equation - -SourceFiles - relaxation.C - -\*---------------------------------------------------------------------------*/ - -#ifndef relaxation_H -#define relaxation_H - -#include "reactionRateFlameArea.H" -#include "consumptionSpeed.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace reactionRateFlameAreaModels -{ - -/*---------------------------------------------------------------------------*\ - Class relaxation Declaration -\*---------------------------------------------------------------------------*/ - -class relaxation -: - public reactionRateFlameArea -{ - // Private Data - - //- Correlation - consumptionSpeed correlation_; - - //- Proportionality constant for time scale in the relaxation Eq. - scalar C_; - - //- Proportionality constant for sub-grid strain - scalar alpha_; - - -public: - - //- Runtime type information - TypeName("relaxation"); - - - // Constructors - - //- Construct from dictionary and psiReactionThermo - relaxation - ( - const word modelType, - const dictionary& dictCoeffs, - const fvMesh& mesh, - const combustionModel& combModel - ); - - //- Disallow default bitwise copy construction - relaxation(const relaxation&); - - - // Destructor - - virtual ~relaxation(); - - - // Member Functions - - //- Correct omega - virtual void correct(const volScalarField& sigma); - - - // IO - - //- Update properties from given dictionary - virtual bool read(const dictionary& dictProperties); - - - // Member Operators - - //- Disallow default bitwise assignment - void operator=(const relaxation&) = delete; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End reactionRateFlameAreaModels -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/dfCombustionModels/Make/files b/src/dfCombustionModels/Make/files index 03b73275..0b06a7f8 100644 --- a/src/dfCombustionModels/Make/files +++ b/src/dfCombustionModels/Make/files @@ -1,14 +1,15 @@ combustionModel/combustionModel.C CombustionModel/CombustionModel/CombustionModels.C -diffusion/diffusions.C -infinitelyFastChemistry/infinitelyFastChemistrys.C +/*diffusion/diffusions.C*/ +/*infinitelyFastChemistry/infinitelyFastChemistrys.C*/ PaSR/PaSRs.C EDC/EDCs.C laminar/laminars.C +/* FSD/reactionRateFlameAreaModels/consumptionSpeed/consumptionSpeed.C FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameArea.C FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameAreaNew.C @@ -23,6 +24,6 @@ noCombustion/noCombustions.C functionObjects/Qdot/Qdot.C radiationModels/absorptionEmissionModels/greyMeanCombustion/greyMeanCombustion.C -radiationModels/absorptionEmissionModels/wideBandCombustion/wideBandCombustion.C +radiationModels/absorptionEmissionModels/wideBandCombustion/wideBandCombustion.C*/ -LIB = $(FOAM_LIBBIN)/libcombustionModels +LIB = $(FOAM_USER_LIBBIN)/libdfCombustionModels diff --git a/src/dfCombustionModels/Make/options b/src/dfCombustionModels/Make/options index b779f2eb..5100b38b 100644 --- a/src/dfCombustionModels/Make/options +++ b/src/dfCombustionModels/Make/options @@ -1,4 +1,4 @@ -EXE_INC = \ +EXE_INC = -std=c++14 \ -I$(LIB_SRC)/transportModels/compressible/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ @@ -8,13 +8,26 @@ EXE_INC = \ -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ -I$(LIB_SRC)/radiationModels/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/meshTools/lnInclude + -I$(LIB_SRC)/meshTools/lnInclude \ + -I$(DF_SRC)/CanteraMixture/lnInclude \ + -I$(DF_SRC)/dfChemistryModel/lnInclude \ + -I$(CANTERA_ROOT)/include \ + -I$(TORCH_ROOT)/include \ + -I$(TORCH_ROOT)/include/torch/csrc/api/include LIB_LIBS = \ -lcompressibleTransportModels \ -lturbulenceModels \ - -lcompressibleTurbulenceModels \ -lchemistryModel \ -lradiationModels \ -lfiniteVolume \ - -lmeshTools + -lmeshTools \ + -L$(FOAM_USER_LIBBIN) \ + -ldfCompressibleTurbulenceModels \ + -lCanteraMixture \ + -ldfChemistryModel \ + $(CANTERA_ROOT)/lib/libcantera.so \ + $(TORCH_ROOT)/lib/libtorch.so \ + $(TORCH_ROOT)/lib/libc10.so \ + -rdynamic \ + -lpthread \ No newline at end of file diff --git a/src/dfCombustionModels/PaSR/PaSRs.C b/src/dfCombustionModels/PaSR/PaSRs.C index 965881a2..3be4c351 100644 --- a/src/dfCombustionModels/PaSR/PaSRs.C +++ b/src/dfCombustionModels/PaSR/PaSRs.C @@ -23,19 +23,18 @@ License \*---------------------------------------------------------------------------*/ +#include "PaSR.H" #include "makeCombustionTypes.H" -#include "psiReactionThermo.H" -#include "rhoReactionThermo.H" -#include "PaSR.H" +#include "basicThermo.H" + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { -makeCombustionTypes(PaSR, psiReactionThermo); -makeCombustionTypes(PaSR, rhoReactionThermo); +makeCombustionTypes(PaSR, basicThermo); } diff --git a/src/dfCombustionModels/diffusion/diffusion.C b/src/dfCombustionModels/diffusion/diffusion.C deleted file mode 100644 index 82e6f44b..00000000 --- a/src/dfCombustionModels/diffusion/diffusion.C +++ /dev/null @@ -1,112 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2012-2018 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 "diffusion.H" -#include "fvcGrad.H" - -namespace Foam -{ -namespace combustionModels -{ - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -template -diffusion::diffusion -( - const word& modelType, - ReactionThermo& thermo, - const compressibleTurbulenceModel& turb, - const word& combustionProperties -) -: - singleStepCombustion - ( - modelType, - thermo, - turb, - combustionProperties - ), - C_(readScalar(this->coeffs().lookup("C"))), - oxidantName_(this->coeffs().template lookupOrDefault("oxidant", "O2")) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -template -diffusion::~diffusion() -{} - - -// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // - -template -void diffusion::correct() -{ - this->wFuel_ == - dimensionedScalar(dimMass/pow3(dimLength)/dimTime, 0); - - this->singleMixturePtr_->fresCorrect(); - - const label fuelI = this->singleMixturePtr_->fuelIndex(); - - const volScalarField& YFuel = this->thermo().composition().Y()[fuelI]; - - if (this->thermo().composition().contains(oxidantName_)) - { - const volScalarField& YO2 = - this->thermo().composition().Y(oxidantName_); - - this->wFuel_ == - C_*this->turbulence().muEff() - *mag(fvc::grad(YFuel) & fvc::grad(YO2)) - *pos0(YFuel)*pos0(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/dfCombustionModels/diffusion/diffusion.H b/src/dfCombustionModels/diffusion/diffusion.H deleted file mode 100644 index b478cccc..00000000 --- a/src/dfCombustionModels/diffusion/diffusion.H +++ /dev/null @@ -1,124 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2012-2019 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 . - -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_; - - -public: - - //- Runtime type information - TypeName("diffusion"); - - - // Constructors - - //- Construct from components - diffusion - ( - const word& modelType, - ReactionThermo& thermo, - const compressibleTurbulenceModel& turb, - const word& combustionProperties - ); - - //- Disallow default bitwise copy construction - diffusion(const diffusion&); - - - //- Destructor - virtual ~diffusion(); - - - // Member Functions - - //- Correct combustion rate - virtual void correct(); - - //- Update properties - virtual bool read(); - - - // Member Operators - - //- Disallow default bitwise assignment - void operator=(const diffusion&) = delete; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace combustionModels -} // End namespace Foam - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#ifdef NoRepository - #include "diffusion.C" -#endif - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/dfCombustionModels/diffusion/diffusions.C b/src/dfCombustionModels/diffusion/diffusions.C deleted file mode 100644 index 0fb18d86..00000000 --- a/src/dfCombustionModels/diffusion/diffusions.C +++ /dev/null @@ -1,100 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2012-2018 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 "psiReactionThermo.H" -#include "rhoReactionThermo.H" -#include "diffusion.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// Combustion models based on sensibleEnthalpy -makeCombustionTypesThermo -( - diffusion, - psiReactionThermo, - gasHThermoPhysics -); - -makeCombustionTypesThermo -( - diffusion, - psiReactionThermo, - constGasHThermoPhysics -); - -makeCombustionTypesThermo -( - diffusion, - rhoReactionThermo, - gasHThermoPhysics -); - -makeCombustionTypesThermo -( - diffusion, - rhoReactionThermo, - constGasHThermoPhysics -); - - -// Combustion models based on sensibleInternalEnergy - -makeCombustionTypesThermo -( - diffusion, - psiReactionThermo, - gasEThermoPhysics -); - -makeCombustionTypesThermo -( - diffusion, - psiReactionThermo, - constGasEThermoPhysics -); - -makeCombustionTypesThermo -( - diffusion, - rhoReactionThermo, - gasEThermoPhysics -); - -makeCombustionTypesThermo -( - diffusion, - rhoReactionThermo, - constGasEThermoPhysics -); - -} - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/dfCombustionModels/functionObjects/Qdot/Qdot.C b/src/dfCombustionModels/functionObjects/Qdot/Qdot.C deleted file mode 100644 index 78c1cb84..00000000 --- a/src/dfCombustionModels/functionObjects/Qdot/Qdot.C +++ /dev/null @@ -1,117 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2019 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 "Qdot.H" -#include "combustionModel.H" -#include "volFields.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ -namespace functionObjects -{ - defineTypeNameAndDebug(Qdot, 0); - - addToRunTimeSelectionTable - ( - functionObject, - Qdot, - dictionary - ); -} -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::functionObjects::Qdot::Qdot -( - const word& name, - const Time& runTime, - const dictionary& dict -) -: - fvMeshFunctionObject(name, runTime, dict), - writeLocalObjects(obr_, false), - phaseName_(word::null) -{ - read(dict); - resetLocalObjectName(IOobject::groupName(type(), phaseName_)); -} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::functionObjects::Qdot::~Qdot() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -bool Foam::functionObjects::Qdot::read -( - const dictionary& dict -) -{ - fvMeshFunctionObject::read(dict); - writeLocalObjects::read(dict); - - phaseName_ = dict.lookupOrDefault("phase", word::null); - - return true; -} - - -bool Foam::functionObjects::Qdot::execute() -{ - word fieldName(IOobject::groupName(type(), phaseName_)); - - const word modelName - ( - IOobject::groupName - ( - combustionModel::combustionPropertiesName, - phaseName_ - ) - ); - - return - store - ( - fieldName, - mesh_.lookupObject(modelName).Qdot() - ); -} - - -bool Foam::functionObjects::Qdot::write() -{ - return writeLocalObjects::write(); -} - - -// ************************************************************************* // diff --git a/src/dfCombustionModels/functionObjects/Qdot/Qdot.H b/src/dfCombustionModels/functionObjects/Qdot/Qdot.H deleted file mode 100644 index a5a67dfc..00000000 --- a/src/dfCombustionModels/functionObjects/Qdot/Qdot.H +++ /dev/null @@ -1,109 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2019 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 . - -Class - Foam::functionObjects::Qdot - -Description - Calculates and outputs the heat release rate for the current combustion - model. - -SourceFiles - Qdot.C - -\*---------------------------------------------------------------------------*/ - -#ifndef functionObjects_Qdot_H -#define functionObjects_Qdot_H - -#include "fvMeshFunctionObject.H" -#include "writeLocalObjects.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace functionObjects -{ - -/*---------------------------------------------------------------------------*\ - Class Qdot Declaration -\*---------------------------------------------------------------------------*/ - -class Qdot -: - public fvMeshFunctionObject, - public writeLocalObjects -{ -private: - - // Private Data - - //- The name of the phase - word phaseName_; - - -public: - - //- Runtime type information - TypeName("Qdot"); - - - // Constructors - - //- Construct from Time and dictionary - Qdot - ( - const word& name, - const Time& runTime, - const dictionary& dict - ); - - - //- Destructor - virtual ~Qdot(); - - - // Member Functions - - //- Read the data - virtual bool read(const dictionary&); - - //- Calculate the Qdot field - virtual bool execute(); - - //- Do nothing - virtual bool write(); -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace functionObjects -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/dfCombustionModels/infinitelyFastChemistry/infinitelyFastChemistry.C b/src/dfCombustionModels/infinitelyFastChemistry/infinitelyFastChemistry.C deleted file mode 100644 index f890ef50..00000000 --- a/src/dfCombustionModels/infinitelyFastChemistry/infinitelyFastChemistry.C +++ /dev/null @@ -1,109 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 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 "infinitelyFastChemistry.H" - -namespace Foam -{ -namespace combustionModels -{ - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -template -infinitelyFastChemistry::infinitelyFastChemistry -( - const word& modelType, - ReactionThermo& thermo, - const compressibleTurbulenceModel& turb, - const word& combustionProperties -) -: - singleStepCombustion - ( - modelType, - thermo, - turb, - combustionProperties - ), - C_(readScalar(this->coeffs().lookup("C"))) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -template -infinitelyFastChemistry::~infinitelyFastChemistry() -{} - - -// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // - -template -void infinitelyFastChemistry::correct() -{ - this->wFuel_ == - dimensionedScalar(dimMass/pow3(dimLength)/dimTime, 0); - - this->singleMixturePtr_->fresCorrect(); - - const label fuelI = this->singleMixturePtr_->fuelIndex(); - - const volScalarField& YFuel = this->thermo().composition().Y()[fuelI]; - - const dimensionedScalar s = this->singleMixturePtr_->s(); - - if (this->thermo().composition().contains("O2")) - { - const volScalarField& YO2 = this->thermo().composition().Y("O2"); - - this->wFuel_ == - this->rho()/(this->mesh().time().deltaT()*C_) - *min(YFuel, YO2/s.value()); - } -} - - -template -bool infinitelyFastChemistry::read() -{ - if (singleStepCombustion::read()) - { - this->coeffs().lookup("C") >> C_ ; - return true; - } - else - { - return false; - } -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace combustionModels -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/dfCombustionModels/infinitelyFastChemistry/infinitelyFastChemistry.H b/src/dfCombustionModels/infinitelyFastChemistry/infinitelyFastChemistry.H deleted file mode 100644 index 51d0a874..00000000 --- a/src/dfCombustionModels/infinitelyFastChemistry/infinitelyFastChemistry.H +++ /dev/null @@ -1,121 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2019 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 . - -Class - Foam::combustionModels::infinitelyFastChemistry - -Description - Simple infinitely fast chemistry combustion model based on the principle - mixed is burnt. Additional parameter C is used to distribute the heat - release rate.in time - -SourceFiles - infinitelyFastChemistry.C - -\*---------------------------------------------------------------------------*/ - -#ifndef infinitelyFastChemistry_H -#define infinitelyFastChemistry_H - -#include "singleStepCombustion.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace combustionModels -{ - -/*---------------------------------------------------------------------------*\ - Class infinitelyFastChemistry Declaration -\*---------------------------------------------------------------------------*/ - -template -class infinitelyFastChemistry -: - public singleStepCombustion -{ - // Private Data - - //- Model constant - scalar C_; - - -public: - - //- Runtime type information - TypeName("infinitelyFastChemistry"); - - - // Constructors - - //- Construct from components - infinitelyFastChemistry - ( - const word& modelType, - ReactionThermo& thermo, - const compressibleTurbulenceModel& turb, - const word& combustionProperties - ); - - //- Disallow default bitwise copy construction - infinitelyFastChemistry(const infinitelyFastChemistry&); - - - //- Destructor - virtual ~infinitelyFastChemistry(); - - - // Member Functions - - //- Correct combustion rate - virtual void correct(); - - //- Update properties - virtual bool read(); - - - // Member Operators - - //- Disallow default bitwise assignment - void operator=(const infinitelyFastChemistry&) = delete; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace combustionModels -} // End namespace Foam - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#ifdef NoRepository - #include "infinitelyFastChemistry.C" -#endif - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/dfCombustionModels/infinitelyFastChemistry/infinitelyFastChemistrys.C b/src/dfCombustionModels/infinitelyFastChemistry/infinitelyFastChemistrys.C deleted file mode 100644 index e86a886e..00000000 --- a/src/dfCombustionModels/infinitelyFastChemistry/infinitelyFastChemistrys.C +++ /dev/null @@ -1,100 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 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 "psiReactionThermo.H" -#include "rhoReactionThermo.H" -#include "infinitelyFastChemistry.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// Combustion models based on sensibleEnthalpy - -makeCombustionTypesThermo -( - infinitelyFastChemistry, - psiReactionThermo, - gasHThermoPhysics -); - -makeCombustionTypesThermo -( - infinitelyFastChemistry, - psiReactionThermo, - constGasHThermoPhysics -); - -makeCombustionTypesThermo -( - infinitelyFastChemistry, - rhoReactionThermo, - gasHThermoPhysics -); - -makeCombustionTypesThermo -( - infinitelyFastChemistry, - rhoReactionThermo, - constGasHThermoPhysics -); - -// Combustion models based on sensibleInternalEnergy - -makeCombustionTypesThermo -( - infinitelyFastChemistry, - psiReactionThermo, - gasEThermoPhysics -); - -makeCombustionTypesThermo -( - infinitelyFastChemistry, - psiReactionThermo, - constGasEThermoPhysics -); - -makeCombustionTypesThermo -( - infinitelyFastChemistry, - rhoReactionThermo, - gasEThermoPhysics -); - -makeCombustionTypesThermo -( - infinitelyFastChemistry, - rhoReactionThermo, - constGasEThermoPhysics -); - -} - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/dfCombustionModels/laminar/laminar.C b/src/dfCombustionModels/laminar/laminar.C index aed969ce..96f06638 100644 --- a/src/dfCombustionModels/laminar/laminar.C +++ b/src/dfCombustionModels/laminar/laminar.C @@ -74,15 +74,47 @@ template Foam::tmp Foam::combustionModels::laminar::tc() const { - return this->chemistryPtr_->tc(); + FatalErrorInFunction + << "wrong implementation!" + << exit(FatalError); + + return this->chemistryPtr_->Qdot(); + //return this->chemistryPtr_->tc(); + + tmp ttc + ( + volScalarField::New + ( + "tc", + this->mesh_, + dimensionedScalar(dimTime, 0) + ) + ); + scalarField& tc = ttc.ref(); + + + const int nCells = this->mesh_.nCells(); + for(int cellI=0; cellI < nCells; ++cellI) + { + PtrList& Y = this->chemistryPtr_->Y(); + forAll(Y, i) + { + scalar tc_i = 0; + const scalar mag_RR = mag(this->chemistryPtr_->RR(i)[cellI]); + if(mag_RR > small) tc_i = Y[i][cellI]/mag_RR; + tc[cellI] = max(tc[cellI], tc_i); + } + } + + return ttc; } template void Foam::combustionModels::laminar::correct() { - if (integrateReactionRate_) - { + //if (integrateReactionRate_) + //{ if (fv::localEulerDdt::enabled(this->mesh())) { const scalarField& rDeltaT = @@ -109,11 +141,11 @@ void Foam::combustionModels::laminar::correct() { this->chemistryPtr_->solve(this->mesh().time().deltaTValue()); } - } - else - { - this->chemistryPtr_->calculate(); - } + // } + // else + // { + // this->chemistryPtr_->calculate(); + // } } @@ -124,7 +156,8 @@ Foam::combustionModels::laminar::R(volScalarField& Y) const tmp tSu(new fvScalarMatrix(Y, dimMass/dimTime)); fvScalarMatrix& Su = tSu.ref(); - const label specieI = this->thermo().composition().species()[Y.member()]; + //const label specieI = this->chemistryPtr_->thermo().specieI(Y.member()); + const label specieI = this->chemistryPtr_->species()[Y.member()]; Su += this->chemistryPtr_->RR(specieI); return tSu; diff --git a/src/dfCombustionModels/laminar/laminars.C b/src/dfCombustionModels/laminar/laminars.C index 2c5b2cee..1571eca8 100644 --- a/src/dfCombustionModels/laminar/laminars.C +++ b/src/dfCombustionModels/laminar/laminars.C @@ -23,19 +23,21 @@ License \*---------------------------------------------------------------------------*/ +#include "laminar.H" #include "makeCombustionTypes.H" -#include "psiReactionThermo.H" -#include "rhoReactionThermo.H" -#include "laminar.H" +//#include "psiReactionThermo.H" +//#include "rhoReactionThermo.H" +#include "basicThermo.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { -makeCombustionTypes(laminar, psiReactionThermo); -makeCombustionTypes(laminar, rhoReactionThermo); +//makeCombustionTypes(laminar, psiReactionThermo); +//makeCombustionTypes(laminar, rhoReactionThermo); +makeCombustionTypes(laminar, basicThermo); } diff --git a/src/dfCombustionModels/noCombustion/noCombustion.C b/src/dfCombustionModels/noCombustion/noCombustion.C deleted file mode 100644 index 69dae978..00000000 --- a/src/dfCombustionModels/noCombustion/noCombustion.C +++ /dev/null @@ -1,101 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 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 "noCombustion.H" -#include "fvmSup.H" - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -template -Foam::combustionModels::noCombustion::noCombustion -( - const word& modelType, - ReactionThermo& thermo, - const compressibleTurbulenceModel& turb, - const word& combustionProperties -) -: - ThermoCombustion(modelType, thermo, turb) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -template -Foam::combustionModels::noCombustion::~noCombustion() -{} - - -// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // - -template -void Foam::combustionModels::noCombustion::correct() -{} - - -template -Foam::tmp -Foam::combustionModels::noCombustion::R -( - volScalarField& Y -) const -{ - tmp tSu - ( - new fvScalarMatrix(Y, dimMass/dimTime) - ); - - return tSu; -} - - -template -Foam::tmp -Foam::combustionModels::noCombustion::Qdot() const -{ - return volScalarField::New - ( - this->thermo().phasePropertyName(typeName + ":Qdot"), - this->mesh(), - dimensionedScalar(dimEnergy/dimVolume/dimTime, 0) - ); -} - - -template -bool Foam::combustionModels::noCombustion::read() -{ - if (ThermoCombustion::read()) - { - return true; - } - else - { - return false; - } -} - - -// ************************************************************************* // diff --git a/src/dfCombustionModels/noCombustion/noCombustion.H b/src/dfCombustionModels/noCombustion/noCombustion.H deleted file mode 100644 index fd137c4b..00000000 --- a/src/dfCombustionModels/noCombustion/noCombustion.H +++ /dev/null @@ -1,118 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2019 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 . - -Class - Foam::combustionModels::noCombustion - -Description - Dummy combustion model for 'no combustion' - -SourceFiles - noCombustion.C - -\*---------------------------------------------------------------------------*/ - -#ifndef noCombustion_H -#define noCombustion_H - -#include "ThermoCombustion.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace combustionModels -{ - -/*---------------------------------------------------------------------------*\ - Class noCombustion Declaration -\*---------------------------------------------------------------------------*/ - -template -class noCombustion -: - public ThermoCombustion -{ -public: - - //- Runtime type information - TypeName("none"); - - - // Constructors - - //- Construct from components - noCombustion - ( - const word& modelType, - ReactionThermo& thermo, - const compressibleTurbulenceModel& turb, - const word& combustionProperties - ); - - //- Disallow default bitwise copy construction - noCombustion(const noCombustion&); - - - //- Destructor - virtual ~noCombustion(); - - - // Member Functions - - //- Correct combustion rate - virtual void correct(); - - //- Fuel consumption rate matrix - virtual tmp R(volScalarField& Y) const; - - //- Heat release rate [kg/m/s^3] - virtual tmp Qdot() const; - - //- Update properties from given dictionary - virtual bool read(); - - - // Member Operators - - //- Disallow default bitwise assignment - void operator=(const noCombustion&) = delete; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace combustionModels -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#ifdef NoRepository - #include "noCombustion.C" -#endif - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/dfCombustionModels/noCombustion/noCombustions.C b/src/dfCombustionModels/noCombustion/noCombustions.C deleted file mode 100644 index b1c496fd..00000000 --- a/src/dfCombustionModels/noCombustion/noCombustions.C +++ /dev/null @@ -1,42 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2012-2018 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 "psiReactionThermo.H" -#include "rhoReactionThermo.H" -#include "noCombustion.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -makeCombustionTypes(noCombustion, psiReactionThermo); -makeCombustionTypes(noCombustion, rhoReactionThermo); - -} - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/dfCombustionModels/radiationModels/absorptionEmissionModels/greyMeanCombustion/greyMeanCombustion.C b/src/dfCombustionModels/radiationModels/absorptionEmissionModels/greyMeanCombustion/greyMeanCombustion.C deleted file mode 100644 index 1122614a..00000000 --- a/src/dfCombustionModels/radiationModels/absorptionEmissionModels/greyMeanCombustion/greyMeanCombustion.C +++ /dev/null @@ -1,89 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2019 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 "greyMeanCombustion.H" -#include "combustionModel.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ -namespace radiationModels -{ -namespace absorptionEmissionModels -{ - defineTypeNameAndDebug(greyMeanCombustion, 0); - - addToRunTimeSelectionTable - ( - absorptionEmissionModel, - greyMeanCombustion, - dictionary - ); -} -} -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::radiationModels::absorptionEmissionModels::greyMeanCombustion:: -greyMeanCombustion -( - const dictionary& dict, - const fvMesh& mesh -) -: - greyMean(dict, mesh, typeName), - EhrrCoeff_(readScalar(coeffsDict_.lookup("EhrrCoeff"))) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::radiationModels::absorptionEmissionModels::greyMeanCombustion:: -~greyMeanCombustion() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -Foam::tmp -Foam::radiationModels::absorptionEmissionModels::greyMeanCombustion::ECont -( - const label bandI -) const -{ - tmp E = greyMean::ECont(bandI); - - const word& name = combustionModel::combustionPropertiesName; - E.ref() += EhrrCoeff_*mesh_.lookupObject(name).Qdot(); - - return E; -} - - -// ************************************************************************* // diff --git a/src/dfCombustionModels/radiationModels/absorptionEmissionModels/greyMeanCombustion/greyMeanCombustion.H b/src/dfCombustionModels/radiationModels/absorptionEmissionModels/greyMeanCombustion/greyMeanCombustion.H deleted file mode 100644 index bc828496..00000000 --- a/src/dfCombustionModels/radiationModels/absorptionEmissionModels/greyMeanCombustion/greyMeanCombustion.H +++ /dev/null @@ -1,103 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2019 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 . - -Class - Foam::radiationModels::absorptionEmission::greyMeanCombustion - -Description - greyMeanCombustion radiation absorption and emission coefficients for - continuous phase. Exactly as greyMean, but with additional effects of the - combustion heat release rate included. - -See also - Foam::radiationModels::absorptionEmissionModels::greyMean - -SourceFiles - greyMeanCombustion.C - -\*---------------------------------------------------------------------------*/ - -#ifndef greyMeanCombustion_H -#define greyMeanCombustion_H - -#include "greyMean.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace radiationModels -{ -namespace absorptionEmissionModels -{ - -/*---------------------------------------------------------------------------*\ - Class greyMeanCombustion Declaration -\*---------------------------------------------------------------------------*/ - -class greyMeanCombustion -: - public greyMean -{ -private: - - // Private Data - - //- Emission constant coefficient - const scalar EhrrCoeff_; - - -public: - - //- Runtime type information - TypeName("greyMeanCombustion"); - - - // Constructors - - //- Construct from components - greyMeanCombustion(const dictionary& dict, const fvMesh& mesh); - - - //- Destructor - virtual ~greyMeanCombustion(); - - - // Member Functions - - //- Emission contribution for continuous phase - tmp ECont(const label bandI = 0) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace absorptionEmissionModels -} // End namespace radiationModels -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/dfCombustionModels/radiationModels/absorptionEmissionModels/wideBandCombustion/wideBandCombustion.C b/src/dfCombustionModels/radiationModels/absorptionEmissionModels/wideBandCombustion/wideBandCombustion.C deleted file mode 100644 index 93713b12..00000000 --- a/src/dfCombustionModels/radiationModels/absorptionEmissionModels/wideBandCombustion/wideBandCombustion.C +++ /dev/null @@ -1,102 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2019 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 "wideBandCombustion.H" -#include "combustionModel.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ -namespace radiationModels -{ -namespace absorptionEmissionModels -{ - defineTypeNameAndDebug(wideBandCombustion, 0); - - addToRunTimeSelectionTable - ( - absorptionEmissionModel, - wideBandCombustion, - dictionary - ); -} -} -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::radiationModels::absorptionEmissionModels::wideBandCombustion:: -wideBandCombustion -( - const dictionary& dict, - const fvMesh& mesh -) -: - wideBand(dict, mesh, typeName) -{ - label bandi = 0; - forAllConstIter(dictionary, coeffsDict_, iter) - { - if (!iter().isDict()) continue; - - iter().dict().lookup("EhrrCoeff") >> iEhrrCoeffs_[bandi]; - - ++ bandi; - } -} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::radiationModels::absorptionEmissionModels::wideBandCombustion:: -~wideBandCombustion() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -Foam::tmp -Foam::radiationModels::absorptionEmissionModels::wideBandCombustion::ECont -( - const label bandi -) const -{ - tmp E = wideBand::ECont(bandi); - - const word& name = combustionModel::combustionPropertiesName; - E.ref() += - iEhrrCoeffs_[bandi] - *mesh_.lookupObject(name).Qdot() - *(iBands_[bandi][1] - iBands_[bandi][0]) - /totalWaveLength_; - - return E; -} - - -// ************************************************************************* // diff --git a/src/dfCombustionModels/radiationModels/absorptionEmissionModels/wideBandCombustion/wideBandCombustion.H b/src/dfCombustionModels/radiationModels/absorptionEmissionModels/wideBandCombustion/wideBandCombustion.H deleted file mode 100644 index ed09a04c..00000000 --- a/src/dfCombustionModels/radiationModels/absorptionEmissionModels/wideBandCombustion/wideBandCombustion.H +++ /dev/null @@ -1,101 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2019 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 . - -Class - Foam::radiationModels::absorptionEmission::wideBandCombustion - -Description - wideBandCombustion radiation absorption and emission coefficients for - continuous phase. Exactly as wideBand, but with additional effects of the - combustion heat release rate included. - -See also - Foam::radiationModels::absorptionEmissionModels::wideBand - -SourceFiles - wideBandCombustion.C - -\*---------------------------------------------------------------------------*/ - -#ifndef wideBandCombustion_H -#define wideBandCombustion_H - -#include "wideBand.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace radiationModels -{ -namespace absorptionEmissionModels -{ - -/*---------------------------------------------------------------------------*\ - Class wideBandCombustion Declaration -\*---------------------------------------------------------------------------*/ - -class wideBandCombustion -: - public wideBand -{ -private: - - //- Proportion of the heat released rate emitted - FixedList iEhrrCoeffs_; - - -public: - - //- Runtime type information - TypeName("wideBandCombustion"); - - - // Constructors - - //- Construct from components - wideBandCombustion(const dictionary& dict, const fvMesh& mesh); - - - //- Destructor - virtual ~wideBandCombustion(); - - - // Member Functions - - //- Emission contribution for continuous phase - tmp ECont(const label bandi = 0) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace absorptionEmissionModels -} // End namespace radiationModels -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/dfCombustionModels/singleStepCombustion/singleStepCombustion.C b/src/dfCombustionModels/singleStepCombustion/singleStepCombustion.C deleted file mode 100644 index 512fe3ad..00000000 --- a/src/dfCombustionModels/singleStepCombustion/singleStepCombustion.C +++ /dev/null @@ -1,159 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 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 "singleStepCombustion.H" -#include "fvmSup.H" - -namespace Foam -{ -namespace combustionModels -{ - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -template -singleStepCombustion::singleStepCombustion -( - const word& modelType, - ReactionThermo& thermo, - const compressibleTurbulenceModel& turb, - const word& combustionProperties -) -: - ThermoCombustion(modelType, thermo, turb), - singleMixturePtr_(nullptr), - wFuel_ - ( - IOobject - ( - this->thermo().phasePropertyName("wFuel"), - this->mesh().time().timeName(), - this->mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE - ), - this->mesh(), - dimensionedScalar(dimMass/dimVolume/dimTime, 0) - ), - semiImplicit_(readBool(this->coeffs_.lookup("semiImplicit"))) -{ - if (isA>(this->thermo())) - { - singleMixturePtr_ = - &dynamic_cast&> - ( - this->thermo() - ); - } - else - { - FatalErrorInFunction - << "Inconsistent thermo package for " << this->type() << " model:\n" - << " " << this->thermo().type() << nl << nl - << "Please select a thermo package based on " - << "singleStepReactingMixture" << exit(FatalError); - } - - if (semiImplicit_) - { - Info<< "Combustion mode: semi-implicit" << endl; - } - else - { - Info<< "Combustion mode: explicit" << endl; - } -} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -template -singleStepCombustion::~singleStepCombustion() -{} - - -// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // - -template -tmp singleStepCombustion::R -( - volScalarField& Y -) const -{ - const label specieI = - this->thermo().composition().species()[Y.member()]; - - volScalarField wSpecie - ( - wFuel_*singleMixturePtr_->specieStoichCoeffs()[specieI] - ); - - if (semiImplicit_) - { - const label fNorm = singleMixturePtr_->specieProd()[specieI]; - const volScalarField fres(singleMixturePtr_->fres(specieI)); - wSpecie /= max(fNorm*(Y - fres), scalar(1e-2)); - - return -fNorm*wSpecie*fres + fNorm*fvm::Sp(wSpecie, Y); - } - else - { - return wSpecie + fvm::Sp(0.0*wSpecie, Y); - } -} - - -template -tmp -singleStepCombustion::Qdot() const -{ - const label fuelI = singleMixturePtr_->fuelIndex(); - volScalarField& YFuel = - const_cast(this->thermo().composition().Y(fuelI)); - - return -singleMixturePtr_->qFuel()*(R(YFuel) & YFuel); -} - - -template -bool singleStepCombustion::read() -{ - if (ThermoCombustion::read()) - { - return true; - } - else - { - return false; - } -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace combustionModels -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/dfCombustionModels/singleStepCombustion/singleStepCombustion.H b/src/dfCombustionModels/singleStepCombustion/singleStepCombustion.H deleted file mode 100644 index 855455a5..00000000 --- a/src/dfCombustionModels/singleStepCombustion/singleStepCombustion.H +++ /dev/null @@ -1,126 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2019 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 . - -Class - Foam::combustionModels::singleStepCombustion - -Description - Base class for combustion models using singleStepReactingMixture. - -SourceFiles - singleStepCombustion.C - -\*---------------------------------------------------------------------------*/ - -#ifndef singleStepCombustion_H -#define singleStepCombustion_H - -#include "singleStepReactingMixture.H" -#include "ThermoCombustion.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace combustionModels -{ - -/*---------------------------------------------------------------------------*\ - Class singleStepCombustion Declaration -\*---------------------------------------------------------------------------*/ - -template -class singleStepCombustion -: - public ThermoCombustion -{ -protected: - - // Protected data - - //- Pointer to singleStepReactingMixture mixture - singleStepReactingMixture* singleMixturePtr_; - - //- Fuel consumption rate - volScalarField wFuel_; - - //- Semi-implicit (true) or explicit (false) treatment - bool semiImplicit_; - - -public: - - // Constructors - - //- Construct from components - singleStepCombustion - ( - const word& modelType, - ReactionThermo& thermo, - const compressibleTurbulenceModel& turb, - const word& combustionProperties - ); - - //- Disallow default bitwise copy construction - singleStepCombustion(const singleStepCombustion&); - - - //- Destructor - virtual ~singleStepCombustion(); - - - // Member Functions - - //- Fuel consumption rate matrix - virtual tmp R(volScalarField& Y) const; - - //- Heat release rate [kg/m/s^3] - virtual tmp Qdot() const; - - //- Update properties from given dictionary - virtual bool read(); - - - // Member Operators - - //- Disallow default bitwise assignment - void operator=(const singleStepCombustion&) = delete; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace combustionModels -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#ifdef NoRepository - #include "singleStepCombustion.C" -#endif - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/dfCombustionModels/zoneCombustion/zoneCombustion.C b/src/dfCombustionModels/zoneCombustion/zoneCombustion.C deleted file mode 100644 index e1389968..00000000 --- a/src/dfCombustionModels/zoneCombustion/zoneCombustion.C +++ /dev/null @@ -1,197 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2016-2018 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 "zoneCombustion.H" - -// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // - -template -Foam::tmp -Foam::combustionModels::zoneCombustion::filter -( - const tmp& tR -) const -{ - fvScalarMatrix& R = tR.ref(); - scalarField& Su = R.source(); - scalarField filteredField(Su.size(), 0); - - forAll(zoneNames_, zonei) - { - const labelList& cells = this->mesh().cellZones()[zoneNames_[zonei]]; - - forAll(cells, i) - { - filteredField[cells[i]] = Su[cells[i]]; - } - } - - Su = filteredField; - - if (R.hasDiag()) - { - scalarField& Sp = R.diag(); - - forAll(zoneNames_, zonei) - { - const labelList& cells = - this->mesh().cellZones()[zoneNames_[zonei]]; - - forAll(cells, i) - { - filteredField[cells[i]] = Sp[cells[i]]; - } - } - - Sp = filteredField; - } - - return tR; -} - - -template -Foam::tmp -Foam::combustionModels::zoneCombustion::filter -( - const tmp& tS -) const -{ - scalarField& S = tS.ref(); - scalarField filteredField(S.size(), 0); - - forAll(zoneNames_, zonei) - { - const labelList& cells = this->mesh().cellZones()[zoneNames_[zonei]]; - - forAll(cells, i) - { - filteredField[cells[i]] = S[cells[i]]; - } - } - - S = filteredField; - - return tS; -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -template -Foam::combustionModels::zoneCombustion::zoneCombustion -( - const word& modelType, - ReactionThermo& thermo, - const compressibleTurbulenceModel& turb, - const word& combustionProperties -) -: - CombustionModel - ( - modelType, - thermo, - turb, - combustionProperties - ), - combustionModelPtr_ - ( - CombustionModel::New - ( - thermo, - turb, - "zoneCombustionProperties" - ) - ), - zoneNames_(this->coeffs().lookup("zones")) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -template -Foam::combustionModels::zoneCombustion::~zoneCombustion() -{} - - -// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // - -template -ReactionThermo& Foam::combustionModels::zoneCombustion::thermo() -{ - return combustionModelPtr_->thermo(); -} - - -template -const ReactionThermo& -Foam::combustionModels::zoneCombustion::thermo() const -{ - return combustionModelPtr_->thermo(); -} - - -template -void Foam::combustionModels::zoneCombustion::correct() -{ - combustionModelPtr_->correct(); -} - - -template -Foam::tmp -Foam::combustionModels::zoneCombustion::R -( - volScalarField& Y -) const -{ - return filter(combustionModelPtr_->R(Y)); -} - - -template -Foam::tmp -Foam::combustionModels::zoneCombustion::Qdot() const -{ - return filter(combustionModelPtr_->Qdot()); -} - - -template -bool Foam::combustionModels::zoneCombustion::read() -{ - if (CombustionModel::read()) - { - combustionModelPtr_->read(); - return true; - } - else - { - return false; - } -} - - -// ************************************************************************* // diff --git a/src/dfCombustionModels/zoneCombustion/zoneCombustion.H b/src/dfCombustionModels/zoneCombustion/zoneCombustion.H deleted file mode 100644 index 12359245..00000000 --- a/src/dfCombustionModels/zoneCombustion/zoneCombustion.H +++ /dev/null @@ -1,145 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2016-2019 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 . - -Class - Foam::combustionModels::zoneCombustion - -Description - Zone-filtered combustion model. - - Enable the reactions within the specified list of cell-zones and set - to zero elsewhere. - -SourceFiles - zoneCombustion.C - -\*---------------------------------------------------------------------------*/ - -#ifndef zoneCombustion_H -#define zoneCombustion_H - -#include "CombustionModel.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace combustionModels -{ - -/*---------------------------------------------------------------------------*\ - Class zoneCombustion Declaration -\*---------------------------------------------------------------------------*/ - -template -class zoneCombustion -: - public CombustionModel -{ - // Private Data - - //- The combustion model to be zone-filtered - autoPtr> combustionModelPtr_; - - //- List of zone names in which the reactions are active - wordList zoneNames_; - - - // Private Member Functions - - //- Filter the reaction-rate matrix on the cellZones - tmp filter(const tmp& tR) const; - - //- Filter the given field on the cellZones - tmp filter(const tmp& tS) const; - - -public: - - //- Runtime type information - TypeName("zoneCombustion"); - - - // Constructors - - //- Construct from components - zoneCombustion - ( - const word& modelType, - ReactionThermo& thermo, - const compressibleTurbulenceModel& turb, - const word& combustionProperties - ); - - //- Disallow default bitwise copy construction - zoneCombustion(const zoneCombustion&); - - - //- Destructor - virtual ~zoneCombustion(); - - - // Member Functions - - //- Return access to the thermo package - virtual ReactionThermo& thermo(); - - //- Return const access to the thermo package - virtual const ReactionThermo& thermo() const; - - //- Correct combustion rate - virtual void correct(); - - //- Fuel consumption rate matrix. - virtual tmp R(volScalarField& Y) const; - - //- Heat release rate [kg/m/s^3] - virtual tmp Qdot() const; - - //- Update properties from given dictionary - virtual bool read(); - - - // Member Operators - - //- Disallow default bitwise assignment - void operator=(const zoneCombustion&) = delete; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace combustionModels -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#ifdef NoRepository - #include "zoneCombustion.C" -#endif - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/dfCombustionModels/zoneCombustion/zoneCombustions.C b/src/dfCombustionModels/zoneCombustion/zoneCombustions.C deleted file mode 100644 index d4bb9b47..00000000 --- a/src/dfCombustionModels/zoneCombustion/zoneCombustions.C +++ /dev/null @@ -1,42 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2016-2018 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 "psiReactionThermo.H" -#include "rhoReactionThermo.H" -#include "zoneCombustion.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -makeCombustionTypes(zoneCombustion, psiReactionThermo); -makeCombustionTypes(zoneCombustion, rhoReactionThermo); - -} - -// ************************************************************************* // From afcb346810150a0ea4088d960aaf5a057fdfc946 Mon Sep 17 00:00:00 2001 From: Zhi Chen Date: Thu, 16 Jun 2022 23:09:21 +0800 Subject: [PATCH 3/3] Update laminar.C --- src/dfCombustionModels/laminar/laminar.C | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/dfCombustionModels/laminar/laminar.C b/src/dfCombustionModels/laminar/laminar.C index 96f06638..b8388a2b 100644 --- a/src/dfCombustionModels/laminar/laminar.C +++ b/src/dfCombustionModels/laminar/laminar.C @@ -74,13 +74,6 @@ template Foam::tmp Foam::combustionModels::laminar::tc() const { - FatalErrorInFunction - << "wrong implementation!" - << exit(FatalError); - - return this->chemistryPtr_->Qdot(); - //return this->chemistryPtr_->tc(); - tmp ttc ( volScalarField::New @@ -92,7 +85,6 @@ Foam::combustionModels::laminar::tc() const ); scalarField& tc = ttc.ref(); - const int nCells = this->mesh_.nCells(); for(int cellI=0; cellI < nCells; ++cellI) {