From 8c9e466e667fa79dff29ab89b60685159bf519ae Mon Sep 17 00:00:00 2001 From: Will Bainbridge Date: Thu, 3 Oct 2019 12:30:47 +0100 Subject: [PATCH] reactions: Added surfaceArrheniusReactionRate This is a modified Arrhenius reaction rate where the reaction rate is multiplied by a surface area per unit volume. The reaction rate is given by: k = (A * T^beta * exp(-Ta/T))*a Where a is the surface area per unit volume, the name of which is specified by the user. This enables, for example, the reaction rate to depend on the surface area concentration of catalyst particles. Patch contributed by VTT Technical Research Centre of Finland Ltd and Institute of Fluid Dynamics, Helmholtz-Zentrum Dresden - Rossendorf (HZDR). --- .../chemistryModel/Make/files | 1 + .../makesurfaceArrheniusReactions.C | 63 ++++++++ .../surfaceArrheniusReactionRate.H | 139 ++++++++++++++++++ .../surfaceArrheniusReactionRateI.H | 88 +++++++++++ 4 files changed, 291 insertions(+) create mode 100644 src/thermophysicalModels/chemistryModel/reactions/surfaceArrheniusReactionRate/makesurfaceArrheniusReactions.C create mode 100644 src/thermophysicalModels/chemistryModel/reactions/surfaceArrheniusReactionRate/surfaceArrheniusReactionRate.H create mode 100644 src/thermophysicalModels/chemistryModel/reactions/surfaceArrheniusReactionRate/surfaceArrheniusReactionRateI.H diff --git a/src/thermophysicalModels/chemistryModel/Make/files b/src/thermophysicalModels/chemistryModel/Make/files index ee9a0c08d2..9538d4f935 100644 --- a/src/thermophysicalModels/chemistryModel/Make/files +++ b/src/thermophysicalModels/chemistryModel/Make/files @@ -10,6 +10,7 @@ reactions/makeReactions.C reactions/makeLangmuirHinshelwoodReactions.C reactions/makeMichaelisMentenReactions.C reactions/fluxLimitedLangmuirHinshelwood/makefluxLimitedLangmuirHinshelwoodReactions.C +reactions/surfaceArrheniusReactionRate/makesurfaceArrheniusReactions.C functionObjects/specieReactionRates/specieReactionRates.C diff --git a/src/thermophysicalModels/chemistryModel/reactions/surfaceArrheniusReactionRate/makesurfaceArrheniusReactions.C b/src/thermophysicalModels/chemistryModel/reactions/surfaceArrheniusReactionRate/makesurfaceArrheniusReactions.C new file mode 100644 index 0000000000..dd153179b1 --- /dev/null +++ b/src/thermophysicalModels/chemistryModel/reactions/surfaceArrheniusReactionRate/makesurfaceArrheniusReactions.C @@ -0,0 +1,63 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "makeReaction.H" +#include "reactionTypes.H" +#include "surfaceArrheniusReactionRate.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + makeGeneralReaction + ( + gasHThermoPhysics, + IrreversibleReaction, + surfaceArrheniusReactionRate + ) + + makeGeneralReaction + ( + gasHThermoPhysics, + ReversibleReaction, + surfaceArrheniusReactionRate + ) + + makeGeneralReaction + ( + gasEThermoPhysics, + IrreversibleReaction, + surfaceArrheniusReactionRate + ) + + makeGeneralReaction + ( + gasEThermoPhysics, + ReversibleReaction, + surfaceArrheniusReactionRate + ) +} + +// ************************************************************************* // diff --git a/src/thermophysicalModels/chemistryModel/reactions/surfaceArrheniusReactionRate/surfaceArrheniusReactionRate.H b/src/thermophysicalModels/chemistryModel/reactions/surfaceArrheniusReactionRate/surfaceArrheniusReactionRate.H new file mode 100644 index 0000000000..3a09be6aee --- /dev/null +++ b/src/thermophysicalModels/chemistryModel/reactions/surfaceArrheniusReactionRate/surfaceArrheniusReactionRate.H @@ -0,0 +1,139 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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::surfaceArrheniusReactionRate + +Description + A modified Arrhenius reaction rate given by: + + k = (A * T^beta * exp(-Ta/T))*a + + Where a is the surface area per unit volume, the name of which is + specified by the user. + +SourceFiles + surfaceArrheniusReactionRateI.H + +\*---------------------------------------------------------------------------*/ + +#ifndef surfaceArrheniusReactionRate_H +#define surfaceArrheniusReactionRate_H + +#include "ArrheniusReactionRate.H" +#include "volFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declaration of friend functions and operators + +class surfaceArrheniusReactionRate; + +Ostream& operator<<(Ostream&, const surfaceArrheniusReactionRate&); + +/*---------------------------------------------------------------------------*\ + Class surfaceArrheniusReactionRate Declaration +\*---------------------------------------------------------------------------*/ + +class surfaceArrheniusReactionRate +: + public ArrheniusReactionRate +{ + // Private Data + + //- Name of the surface area per unit volume field + const word aName_; + + //- The surface area per unit volume field + const scalarField& aField_; + + +public: + + // Constructors + + //- Construct from dictionary + inline surfaceArrheniusReactionRate + ( + const speciesTable& species, + const objectRegistry& ob, + const dictionary& dict + ); + + + // Member Functions + + //- Return the type name + static word type() + { + return "surfaceArrhenius"; + } + + //- Evaluate the rate + inline scalar operator() + ( + const scalar p, + const scalar T, + const scalarField& c, + const label li + ) const; + + //- Evaluate the derivative + inline scalar ddT + ( + const scalar p, + const scalar T, + const scalarField& c, + const label li + ) const; + + //- Write to stream + inline void write(Ostream& os) const; + + + // Ostream Operator + + inline friend Ostream& operator<< + ( + Ostream&, + const surfaceArrheniusReactionRate& + ); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "surfaceArrheniusReactionRateI.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/chemistryModel/reactions/surfaceArrheniusReactionRate/surfaceArrheniusReactionRateI.H b/src/thermophysicalModels/chemistryModel/reactions/surfaceArrheniusReactionRate/surfaceArrheniusReactionRateI.H new file mode 100644 index 0000000000..82023f8f02 --- /dev/null +++ b/src/thermophysicalModels/chemistryModel/reactions/surfaceArrheniusReactionRate/surfaceArrheniusReactionRateI.H @@ -0,0 +1,88 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 . + +\*---------------------------------------------------------------------------*/ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +inline Foam::surfaceArrheniusReactionRate::surfaceArrheniusReactionRate +( + const speciesTable& species, + const objectRegistry& ob, + const dictionary& dict +) +: + ArrheniusReactionRate(species, dict), + aName_(dict.lookup("a")), + aField_ + ( + ob.lookupObject(aName_) + ) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +inline Foam::scalar Foam::surfaceArrheniusReactionRate::operator() +( + const scalar p, + const scalar T, + const scalarField& c, + const label li +) const +{ + return ArrheniusReactionRate::operator()(p, T, c, li)*aField_[li]; +} + + +inline Foam::scalar Foam::surfaceArrheniusReactionRate::ddT +( + const scalar p, + const scalar T, + const scalarField& c, + const label li +) const +{ + return ArrheniusReactionRate::ddT(p, T, c, li)*aField_[li]; +} + + +inline void Foam::surfaceArrheniusReactionRate::write(Ostream& os) const +{ + ArrheniusReactionRate::write(os); + writeEntry(os, "a", aName_); +} + + +inline Foam::Ostream& Foam::operator<< +( + Ostream& os, + const surfaceArrheniusReactionRate& arr +) +{ + arr.write(os); + return os; +} + + +// ************************************************************************* //