From 3bed50dbd1578371d5a7f6dd21552bbcff6d1444 Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Tue, 5 Jan 2016 14:09:09 +0000 Subject: [PATCH] Bugfix: Moved case insensitive directory name clash --- .../IrreversibleReaction/IrreversibleReaction.C | 106 ------ .../IrreversibleReaction/IrreversibleReaction.H | 163 ---------- .../NonEquilibriumReversibleReaction.C | 137 -------- .../NonEquilibriumReversibleReaction.H | 185 ----------- .../specie/reaction/Reactions/Reaction/Reaction.C | 356 --------------------- .../specie/reaction/Reactions/Reaction/Reaction.H | 317 ------------------ .../specie/reaction/Reactions/Reaction/ReactionI.H | 65 ---- .../ReversibleReaction/ReversibleReaction.C | 131 -------- .../ReversibleReaction/ReversibleReaction.H | 179 ----------- 9 files changed, 1639 deletions(-) delete mode 100644 src/thermophysicalModels/specie/reaction/Reactions/IrreversibleReaction/IrreversibleReaction.C delete mode 100644 src/thermophysicalModels/specie/reaction/Reactions/IrreversibleReaction/IrreversibleReaction.H delete mode 100644 src/thermophysicalModels/specie/reaction/Reactions/NonEquilibriumReversibleReaction/NonEquilibriumReversibleReaction.C delete mode 100644 src/thermophysicalModels/specie/reaction/Reactions/NonEquilibriumReversibleReaction/NonEquilibriumReversibleReaction.H delete mode 100644 src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.C delete mode 100644 src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.H delete mode 100644 src/thermophysicalModels/specie/reaction/Reactions/Reaction/ReactionI.H delete mode 100644 src/thermophysicalModels/specie/reaction/Reactions/ReversibleReaction/ReversibleReaction.C delete mode 100644 src/thermophysicalModels/specie/reaction/Reactions/ReversibleReaction/ReversibleReaction.H diff --git a/src/thermophysicalModels/specie/reaction/Reactions/IrreversibleReaction/IrreversibleReaction.C b/src/thermophysicalModels/specie/reaction/Reactions/IrreversibleReaction/IrreversibleReaction.C deleted file mode 100644 index b1724784e..000000000 --- a/src/thermophysicalModels/specie/reaction/Reactions/IrreversibleReaction/IrreversibleReaction.C +++ /dev/null @@ -1,106 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | foam-extend: Open Source CFD - \\ / O peration | Version: 3.2 - \\ / A nd | Web: http://www.foam-extend.org - \\/ M anipulation | For copyright notice see file Copyright -------------------------------------------------------------------------------- -License - This file is part of foam-extend. - - foam-extend 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. - - foam-extend 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 foam-extend. If not, see . - -Description - -\*---------------------------------------------------------------------------*/ - -#include "IrreversibleReaction.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -// Construct from components -template -IrreversibleReaction::IrreversibleReaction -( - const Reaction& reaction, - const ReactionRate& k -) -: - Reaction(reaction), - k_(k) -{} - - -// Construct from components -template -IrreversibleReaction::IrreversibleReaction -( - const speciesTable& species, - const HashPtrTable& thermoDatabase, - Istream& is -) -: - Reaction(species, thermoDatabase, is), - k_(species, is) -{} - - -// Construct as copy given new speciesTable -template -IrreversibleReaction::IrreversibleReaction -( - const IrreversibleReaction& irr, - const speciesTable& species -) -: - Reaction(irr, species), - k_(irr.k_) -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -template -scalar IrreversibleReaction::kf -( - const scalar T, - const scalar p, - const scalarField& c -) const -{ - return k_(T, p, c); -} - - -template -void IrreversibleReaction::write -( - Ostream& os -) const -{ - Reaction::write(os); - os << token::SPACE << k_; -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// ************************************************************************* // diff --git a/src/thermophysicalModels/specie/reaction/Reactions/IrreversibleReaction/IrreversibleReaction.H b/src/thermophysicalModels/specie/reaction/Reactions/IrreversibleReaction/IrreversibleReaction.H deleted file mode 100644 index 8b89de63f..000000000 --- a/src/thermophysicalModels/specie/reaction/Reactions/IrreversibleReaction/IrreversibleReaction.H +++ /dev/null @@ -1,163 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | foam-extend: Open Source CFD - \\ / O peration | Version: 3.2 - \\ / A nd | Web: http://www.foam-extend.org - \\/ M anipulation | For copyright notice see file Copyright -------------------------------------------------------------------------------- -License - This file is part of foam-extend. - - foam-extend 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. - - foam-extend 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 foam-extend. If not, see . - -Class - Foam::IrreversibleReaction - -Description - Simple extension of Reaction to handle reversible reactions using - equilibrium thermodynamics. - -SourceFiles - IrreversibleReaction.C - -\*---------------------------------------------------------------------------*/ - -#ifndef IrreversibleReaction_H -#define IrreversibleReaction_H - -#include "Reaction.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class IrreversibleReaction Declaration -\*---------------------------------------------------------------------------*/ - -template -class IrreversibleReaction -: - public Reaction -{ - // Private data - - ReactionRate k_; - - - // Private Member Functions - - //- Disallow default bitwise assignment - void operator= - ( - const IrreversibleReaction& - ); - - -public: - - //- Runtime type information - TypeName("irreversible"); - - - // Constructors - - //- Construct from components - IrreversibleReaction - ( - const Reaction& reaction, - const ReactionRate& reactionRate - ); - - //- Construct as copy given new speciesTable - IrreversibleReaction - ( - const IrreversibleReaction&, - const speciesTable& species - ); - - //- Construct from Istream - IrreversibleReaction - ( - const speciesTable& species, - const HashPtrTable& thermoDatabase, - Istream& is - ); - - //- Construct and return a clone - virtual autoPtr > clone() const - { - return autoPtr > - ( - new IrreversibleReaction(*this) - ); - } - - //- Construct and return a clone with new speciesTable - virtual autoPtr > clone - ( - const speciesTable& species - ) const - { - return autoPtr > - ( - new IrreversibleReaction - ( - *this, - species - ) - ); - } - - - // Destructor - - virtual ~IrreversibleReaction() - {} - - - // Member Functions - - // IrreversibleReaction rate coefficients - - //- Forward rate constant - virtual scalar kf - ( - const scalar T, - const scalar p, - const scalarField& c - ) const; - - - //- Write - virtual void write(Ostream&) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#ifdef NoRepository -# include "IrreversibleReaction.C" -#endif - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/thermophysicalModels/specie/reaction/Reactions/NonEquilibriumReversibleReaction/NonEquilibriumReversibleReaction.C b/src/thermophysicalModels/specie/reaction/Reactions/NonEquilibriumReversibleReaction/NonEquilibriumReversibleReaction.C deleted file mode 100644 index e9336455f..000000000 --- a/src/thermophysicalModels/specie/reaction/Reactions/NonEquilibriumReversibleReaction/NonEquilibriumReversibleReaction.C +++ /dev/null @@ -1,137 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | foam-extend: Open Source CFD - \\ / O peration | Version: 3.2 - \\ / A nd | Web: http://www.foam-extend.org - \\/ M anipulation | For copyright notice see file Copyright -------------------------------------------------------------------------------- -License - This file is part of foam-extend. - - foam-extend 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. - - foam-extend 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 foam-extend. If not, see . - -Description - -\*---------------------------------------------------------------------------*/ - -#include "NonEquilibriumReversibleReaction.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -// Construct from components -template -NonEquilibriumReversibleReaction:: -NonEquilibriumReversibleReaction -( - const Reaction& reaction, - const ReactionRate& forwardReactionRate, - const ReactionRate& reverseReactionRate -) -: - Reaction(reaction), - fk_(forwardReactionRate), - rk_(reverseReactionRate) -{} - - -// Construct from components -template -NonEquilibriumReversibleReaction:: -NonEquilibriumReversibleReaction -( - const speciesTable& species, - const HashPtrTable& thermoDatabase, - Istream& is -) -: - Reaction(species, thermoDatabase, is), - fk_(species, is), - rk_(species, is) -{} - -// Construct as copy given new speciesTable -template -NonEquilibriumReversibleReaction:: -NonEquilibriumReversibleReaction -( - const NonEquilibriumReversibleReaction& nerr, - const speciesTable& species -) -: - Reaction(nerr, species), - fk_(nerr.fk_), - rk_(nerr.rk_) -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -template -scalar NonEquilibriumReversibleReaction::kf -( - const scalar T, - const scalar p, - const scalarField& c -) const -{ - return fk_(T, p, c); -} - - -template -scalar NonEquilibriumReversibleReaction::kr -( - const scalar, - const scalar T, - const scalar p, - const scalarField& c -) const -{ - return rk_(T, p, c); -} - - -template -scalar NonEquilibriumReversibleReaction::kr -( - const scalar T, - const scalar p, - const scalarField& c -) const -{ - return rk_(T, p, c); -} - - -template -void NonEquilibriumReversibleReaction::write -( - Ostream& os -) const -{ - Reaction::write(os); - os << token::SPACE << fk_ << token::SPACE << rk_; -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// ************************************************************************* // diff --git a/src/thermophysicalModels/specie/reaction/Reactions/NonEquilibriumReversibleReaction/NonEquilibriumReversibleReaction.H b/src/thermophysicalModels/specie/reaction/Reactions/NonEquilibriumReversibleReaction/NonEquilibriumReversibleReaction.H deleted file mode 100644 index 2960b2f58..000000000 --- a/src/thermophysicalModels/specie/reaction/Reactions/NonEquilibriumReversibleReaction/NonEquilibriumReversibleReaction.H +++ /dev/null @@ -1,185 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | foam-extend: Open Source CFD - \\ / O peration | Version: 3.2 - \\ / A nd | Web: http://www.foam-extend.org - \\/ M anipulation | For copyright notice see file Copyright -------------------------------------------------------------------------------- -License - This file is part of foam-extend. - - foam-extend 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. - - foam-extend 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 foam-extend. If not, see . - -Class - Foam::NonEquilibriumReversibleReaction - -Description - Simple extension of Reaction to handle reversible reactions using - equilibrium thermodynamics. - -SourceFiles - NonEquilibriumReversibleReaction.C - -\*---------------------------------------------------------------------------*/ - -#ifndef NonEquilibriumReversibleReaction_H -#define NonEquilibriumReversibleReaction_H - -#include "Reaction.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class NonEquilibriumReversibleReaction Declaration -\*---------------------------------------------------------------------------*/ - -template -class NonEquilibriumReversibleReaction -: - public Reaction -{ - // Private data - - ReactionRate fk_; - ReactionRate rk_; - - - // Private Member Functions - - //- Disallow default bitwise assignment - void operator= - ( - const NonEquilibriumReversibleReaction - & - ); - - -public: - - //- Runtime type information - TypeName("nonEquilibriumReversible"); - - - // Constructors - - //- Construct from components - NonEquilibriumReversibleReaction - ( - const Reaction& reaction, - const ReactionRate& forwardReactionRate, - const ReactionRate& reverseReactionRate - ); - - //- Construct as copy given new speciesTable - NonEquilibriumReversibleReaction - ( - const NonEquilibriumReversibleReaction - &, - const speciesTable& species - ); - - //- Construct from Istream - NonEquilibriumReversibleReaction - ( - const speciesTable& species, - const HashPtrTable& thermoDatabase, - Istream& is - ); - - //- Construct and return a clone - virtual autoPtr > clone() const - { - return autoPtr > - ( - new NonEquilibriumReversibleReaction - (*this) - ); - } - - //- Construct and return a clone with new speciesTable - virtual autoPtr > clone - ( - const speciesTable& species - ) const - { - return autoPtr > - ( - new NonEquilibriumReversibleReaction - - (*this, species) - ); - } - - - // Destructor - - virtual ~NonEquilibriumReversibleReaction() - {} - - - // Member Functions - - // NonEquilibriumReversibleReaction rate coefficients - - //- Forward rate constant - virtual scalar kf - ( - const scalar T, - const scalar p, - const scalarField& c - ) const; - - //- Reverse rate constant from the given formard rate constant - virtual scalar kr - ( - const scalar kfwd, - const scalar T, - const scalar p, - const scalarField& c - ) const; - - //- Reverse rate constant. - // Note this evaluates the forward rate constant and divides by the - // equilibrium constant - virtual scalar kr - ( - const scalar T, - const scalar p, - const scalarField& c - ) const; - - - //- Write - virtual void write(Ostream&) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#ifdef NoRepository -# include "NonEquilibriumReversibleReaction.C" -#endif - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.C b/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.C deleted file mode 100644 index a41e551bb..000000000 --- a/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.C +++ /dev/null @@ -1,356 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | foam-extend: Open Source CFD - \\ / O peration | Version: 3.2 - \\ / A nd | Web: http://www.foam-extend.org - \\/ M anipulation | For copyright notice see file Copyright -------------------------------------------------------------------------------- -License - This file is part of foam-extend. - - foam-extend 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. - - foam-extend 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 foam-extend. If not, see . - -Description - Simple extension of ReactionThermo to handle Reaction kinetics in addition - to the equilibrium thermodynamics already handled. - -\*---------------------------------------------------------------------------*/ - -#include "Reaction.H" -#include "DynamicList.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -template -void Reaction::setThermo -( - const HashPtrTable& thermoDatabase -) -{ - ReactionThermo::operator= - ( - rhs_[0].stoichCoeff*(*thermoDatabase[species_[rhs_[0].index]]) - ); - - for (label i=1; ioperator+= - ( - rhs_[i].stoichCoeff*(*thermoDatabase[species_[rhs_[i].index]]) - ); - } - - for (label i=0; ioperator-= - ( - lhs_[i].stoichCoeff*(*thermoDatabase[species_[lhs_[i].index]]) - ); - } -} - - -// Construct from components -template -Reaction::Reaction -( - const speciesTable& species, - const List& lhs, - const List& rhs, - const HashPtrTable& thermoDatabase -) -: - ReactionThermo(*thermoDatabase[species[0]]), - species_(species), - lhs_(lhs), - rhs_(rhs) -{ - setThermo(thermoDatabase); -} - - -// Construct as copy given new speciesTable -template -Reaction::Reaction -( - const Reaction& r, - const speciesTable& species -) -: - ReactionThermo(r), - species_(species), - lhs_(r.lhs_), - rhs_(r.rhs_) -{} - - -template -Reaction::specieCoeffs::specieCoeffs -( - const speciesTable& species, - Istream& is -) -{ - token t(is); - - if (t.isNumber()) - { - stoichCoeff = t.number(); - is >> t; - } - else - { - stoichCoeff = 1.0; - } - - exponent = stoichCoeff; - - if (t.isWord()) - { - word specieName = t.wordToken(); - - size_t i = specieName.find('^'); - - if (i != word::npos) - { - string exponentStr = specieName - ( - i + 1, - specieName.size() - i - 1 - ); - exponent = atof(exponentStr.c_str()); - specieName = specieName(0, i); - } - - index = species[specieName]; - } - else - { - FatalIOErrorIn("Reaction::lrhs(Istream& is)", is) - << "Expected a word but found " << t.info() - << exit(FatalIOError); - } -} - - -template -void Reaction::setLRhs(Istream& is) -{ - DynamicList dlrhs; - - while (is) - { - dlrhs.append(specieCoeffs(species_, is)); - - token t(is); - - if (t.isPunctuation()) - { - if (t == token::ADD) - { - } - else if (t == token::ASSIGN) - { - lhs_ = dlrhs.shrink(); - dlrhs.clear(); - } - else - { - rhs_ = dlrhs.shrink(); - is.putBack(t); - return; - } - } - else - { - rhs_ = dlrhs.shrink(); - is.putBack(t); - return; - } - } - - FatalIOErrorIn("Reaction::lrhs(Istream& is)", is) - << "Cannot continue reading reaction data from stream" - << exit(FatalIOError); -} - - -//- Construct from Istream -template -Reaction::Reaction -( - const speciesTable& species, - const HashPtrTable& thermoDatabase, - Istream& is -) -: - ReactionThermo(*thermoDatabase[species[0]]), - species_(species) -{ - setLRhs(is); - setThermo(thermoDatabase); -} - - -// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // - -template -autoPtr > Reaction::New -( - const speciesTable& species, - const HashPtrTable& thermoDatabase, - Istream& is -) -{ - if (is.eof()) - { - FatalIOErrorIn - ( - "Reaction::New(const speciesTable& species," - " const HashPtrTable& thermoDatabase, Istream&)", - is - ) << "Reaction type not specified" << endl << endl - << "Valid Reaction types are :" << endl - << IstreamConstructorTablePtr_->sortedToc() - << exit(FatalIOError); - } - - word reactionTypeName(is); - - typename IstreamConstructorTable::iterator cstrIter - = IstreamConstructorTablePtr_->find(reactionTypeName); - - if (cstrIter == IstreamConstructorTablePtr_->end()) - { - FatalIOErrorIn - ( - "Reaction::New(const speciesTable& species," - " const HashPtrTable& thermoDatabase, Istream&)", - is - ) << "Unknown reaction type " << reactionTypeName << endl << endl - << "Valid reaction types are :" << endl - << IstreamConstructorTablePtr_->sortedToc() - << exit(FatalIOError); - } - - return autoPtr > - ( - cstrIter()(species, thermoDatabase, is) - ); -} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -template -void Reaction::write(Ostream& os) const -{ - os << type() << nl << " "; - - forAll(lhs_, i) - { - const typename Reaction::specieCoeffs& sc = lhs_[i]; - - if (sc.stoichCoeff != 1) - { - os << sc.stoichCoeff; - } - - os << species_[sc.index]; - - if (sc.exponent != sc.stoichCoeff) - { - os << '^' << sc.exponent; - } - - if (i < lhs_.size() - 1) - { - os << " + "; - } - } - - os << " = "; - - forAll(rhs_, i) - { - const typename Reaction::specieCoeffs& sc = rhs_[i]; - - if (sc.stoichCoeff != 1) - { - os << sc.stoichCoeff; - } - - os << species_[sc.index]; - - if (sc.exponent != sc.stoichCoeff) - { - os << '^' << sc.exponent; - } - - if (i < rhs_.size() - 1) - { - os << " + "; - } - } - - os << endl << " "; -} - - -template -scalar Reaction::kf -( - const scalar T, - const scalar p, - const scalarField& c -) const -{ - return 0.0; -} - - -template -scalar Reaction::kr -( - const scalar kfwd, - const scalar T, - const scalar p, - const scalarField& c -) const -{ - return 0.0; -} - -template -scalar Reaction::kr -( - const scalar T, - const scalar p, - const scalarField& c -) const -{ - return 0.0; -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// ************************************************************************* // diff --git a/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.H b/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.H deleted file mode 100644 index 1d826bb52..000000000 --- a/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.H +++ /dev/null @@ -1,317 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | foam-extend: Open Source CFD - \\ / O peration | Version: 3.2 - \\ / A nd | Web: http://www.foam-extend.org - \\/ M anipulation | For copyright notice see file Copyright -------------------------------------------------------------------------------- -License - This file is part of foam-extend. - - foam-extend 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. - - foam-extend 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 foam-extend. If not, see . - -Class - Foam::Reaction - -Description - Simple extension of ReactionThermo to handle reaction kinetics in addition - to the equilibrium thermodynamics already handled. - -SourceFiles - ReactionI.H - Reaction.C - -\*---------------------------------------------------------------------------*/ - -#ifndef Reaction_H -#define Reaction_H - -#include "speciesTable.H" -#include "HashPtrTable.H" -#include "scalarField.H" -#include "typeInfo.H" -#include "runTimeSelectionTables.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// Forward declaration of friend functions and operators - -template -class Reaction; - -template -inline Ostream& operator<<(Ostream&, const Reaction&); - - -/*---------------------------------------------------------------------------*\ - Class Reaction Declaration -\*---------------------------------------------------------------------------*/ - -template -class Reaction -: - public ReactionThermo -{ - -public: - - // Public data types - - //- Class to hold the specie index and its coefficients in the - // reaction rate expression - struct specieCoeffs - { - label index; - scalar stoichCoeff; - scalar exponent; - - specieCoeffs() - : - index(-1), - stoichCoeff(0), - exponent(1) - {} - - specieCoeffs(const speciesTable& species, Istream& is); - - bool operator==(const specieCoeffs& sc) const - { - return index == sc.index; - } - - bool operator!=(const specieCoeffs& sc) const - { - return index != sc.index; - } - - friend Ostream& operator<<(Ostream& os, const specieCoeffs& sc) - { - os << sc.index << token::SPACE - << sc.stoichCoeff << token::SPACE - << sc.exponent; - return os; - } - }; - - -private: - - // Private data - - //- List of specie names present in reaction system - const speciesTable& species_; - - //- Specie info for the left-hand-side of the reaction - List lhs_; - - //- Specie info for the right-hand-side of the reaction - List rhs_; - - - // Private member functions - - void setLRhs(Istream&); - void setThermo(const HashPtrTable& thermoDatabase); - - //- Disallow default bitwise assignment - void operator=(const Reaction&); - - -public: - - //- Runtime type information - TypeName("Reaction"); - - - // Declare run-time constructor selection tables - - declareRunTimeSelectionTable - ( - autoPtr, - Reaction, - Istream, - ( - const speciesTable& species, - const HashPtrTable& thermoDatabase, - Istream& is - ), - (species, thermoDatabase, is) - ); - - - // Public classes - - //- Class used for the read-construction of PtrLists of reaction - class iNew - { - const speciesTable& species_; - const HashPtrTable& thermoDatabase_; - - public: - - iNew - ( - const speciesTable& species, - const HashPtrTable& thermoDatabase - ) - : - species_(species), - thermoDatabase_(thermoDatabase) - {} - - autoPtr operator()(Istream& is) const - { - return autoPtr - ( - Reaction::New(species_, thermoDatabase_, is) - ); - } - }; - - - // Constructors - - //- Construct from components - Reaction - ( - const speciesTable& species, - const List& lhs, - const List& rhs, - const HashPtrTable& thermoDatabase - ); - - //- Construct as copy given new speciesTable - Reaction(const Reaction&, const speciesTable& species); - - //- Construct from Istream - Reaction - ( - const speciesTable& species, - const HashPtrTable& thermoDatabase, - Istream& is - ); - - //- Construct and return a clone - virtual autoPtr > clone() const - { - return autoPtr > - ( - new Reaction(*this) - ); - } - - //- Construct and return a clone with new speciesTable - virtual autoPtr > clone - ( - const speciesTable& species - ) const - { - return autoPtr > - ( - new Reaction(*this, species) - ); - } - - - // Selectors - - //- Return a pointer to a new patchField created on freestore from input - static autoPtr > New - ( - const speciesTable& species, - const HashPtrTable& thermoDatabase, - Istream& - ); - - - // Destructor - - virtual ~Reaction() - {} - - - // Member Functions - - // Access - - inline const List& lhs() const; - inline const List& rhs() const; - - - // Reaction rate coefficients - - //- Forward rate constant - virtual scalar kf - ( - const scalar T, - const scalar p, - const scalarField& c - ) const; - - //- Reverse rate constant from the given forward rate constant - virtual scalar kr - ( - const scalar kfwd, - const scalar T, - const scalar p, - const scalarField& c - ) const; - - //- Reverse rate constant. - // Note this evaluates the forward rate constant and divides by the - // equilibrium constant - virtual scalar kr - ( - const scalar T, - const scalar p, - const scalarField& c - ) const; - - - //- Write - virtual void write(Ostream&) const; - - - // Ostream Operator - - friend Ostream& operator<< - ( - Ostream&, - const Reaction& - ); -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "ReactionI.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#ifdef NoRepository -# include "Reaction.C" -#endif - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/thermophysicalModels/specie/reaction/Reactions/Reaction/ReactionI.H b/src/thermophysicalModels/specie/reaction/Reactions/Reaction/ReactionI.H deleted file mode 100644 index 11a060e73..000000000 --- a/src/thermophysicalModels/specie/reaction/Reactions/Reaction/ReactionI.H +++ /dev/null @@ -1,65 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | foam-extend: Open Source CFD - \\ / O peration | Version: 3.2 - \\ / A nd | Web: http://www.foam-extend.org - \\/ M anipulation | For copyright notice see file Copyright -------------------------------------------------------------------------------- -License - This file is part of foam-extend. - - foam-extend 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. - - foam-extend 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 foam-extend. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "Reaction.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -template -inline const List::specieCoeffs>& -Reaction::lhs() const -{ - return lhs_; -} - - -template -inline const List::specieCoeffs>& -Reaction::rhs() const -{ - return rhs_; -} - - -// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * // - -template -inline Ostream& operator<<(Ostream& os, const Reaction& r) -{ - r.write(os); - return os; -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// ************************************************************************* // diff --git a/src/thermophysicalModels/specie/reaction/Reactions/ReversibleReaction/ReversibleReaction.C b/src/thermophysicalModels/specie/reaction/Reactions/ReversibleReaction/ReversibleReaction.C deleted file mode 100644 index 9838eb244..000000000 --- a/src/thermophysicalModels/specie/reaction/Reactions/ReversibleReaction/ReversibleReaction.C +++ /dev/null @@ -1,131 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | foam-extend: Open Source CFD - \\ / O peration | Version: 3.2 - \\ / A nd | Web: http://www.foam-extend.org - \\/ M anipulation | For copyright notice see file Copyright -------------------------------------------------------------------------------- -License - This file is part of foam-extend. - - foam-extend 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. - - foam-extend 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 foam-extend. If not, see . - -Description - -\*---------------------------------------------------------------------------*/ - -#include "ReversibleReaction.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -// Construct from components -template -ReversibleReaction::ReversibleReaction -( - const Reaction& reaction, - const ReactionRate& k -) -: - Reaction(reaction), - k_(k) -{} - - -// Construct from components -template -ReversibleReaction::ReversibleReaction -( - const speciesTable& species, - const HashPtrTable& thermoDatabase, - Istream& is -) -: - Reaction(species, thermoDatabase, is), - k_(species, is) -{} - - -// Construct as copy given new speciesTable -template -ReversibleReaction::ReversibleReaction -( - const ReversibleReaction& rr, - const speciesTable& species -) -: - Reaction(rr, species), - k_(rr.k_) -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -template -scalar ReversibleReaction::kf -( - const scalar T, - const scalar p, - const scalarField& c -) const -{ - return k_(T, p, c); -} - - -template -scalar ReversibleReaction::kr -( - const scalar kfwd, - const scalar T, - const scalar p, - const scalarField& c -) const -{ - return kfwd/this->Kc(T); -} - - -template -scalar ReversibleReaction::kr -( - const scalar T, - const scalar p, - const scalarField& c -) const -{ - return kr(kf(T, p, c), T, p, c); -} - - -template -void ReversibleReaction::write -( - Ostream& os -) const -{ - Reaction::write(os); - os << token::SPACE << k_; -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// ************************************************************************* // diff --git a/src/thermophysicalModels/specie/reaction/Reactions/ReversibleReaction/ReversibleReaction.H b/src/thermophysicalModels/specie/reaction/Reactions/ReversibleReaction/ReversibleReaction.H deleted file mode 100644 index 9d63ffedc..000000000 --- a/src/thermophysicalModels/specie/reaction/Reactions/ReversibleReaction/ReversibleReaction.H +++ /dev/null @@ -1,179 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | foam-extend: Open Source CFD - \\ / O peration | Version: 3.2 - \\ / A nd | Web: http://www.foam-extend.org - \\/ M anipulation | For copyright notice see file Copyright -------------------------------------------------------------------------------- -License - This file is part of foam-extend. - - foam-extend 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. - - foam-extend 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 foam-extend. If not, see . - -Class - Foam::ReversibleReaction - -Description - Simple extension of Reaction to handle reversible reactions using - equilibrium thermodynamics. - -SourceFiles - ReversibleReaction.C - -\*---------------------------------------------------------------------------*/ - -#ifndef ReversibleReaction_H -#define ReversibleReaction_H - -#include "Reaction.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class ReversibleReaction Declaration -\*---------------------------------------------------------------------------*/ - -template -class ReversibleReaction -: - public Reaction -{ - // Private data - - ReactionRate k_; - - - // Private Member Functions - - //- Disallow default bitwise assignment - void operator=(const ReversibleReaction&); - - -public: - - //- Runtime type information - TypeName("reversible"); - - - // Constructors - - //- Construct from components - ReversibleReaction - ( - const Reaction& reaction, - const ReactionRate& k - ); - - //- Construct as copy given new speciesTable - ReversibleReaction - ( - const ReversibleReaction&, - const speciesTable& species - ); - - //- Construct from Istream - ReversibleReaction - ( - const speciesTable& species, - const HashPtrTable& thermoDatabase, - Istream& is - ); - - //- Construct and return a clone - virtual autoPtr > clone() const - { - return autoPtr > - ( - new ReversibleReaction(*this) - ); - } - - //- Construct and return a clone with new speciesTable - virtual autoPtr > clone - ( - const speciesTable& species - ) const - { - return autoPtr > - ( - new ReversibleReaction - ( - *this, - species - ) - ); - } - - - // Destructor - - virtual ~ReversibleReaction() - {} - - - // Member Functions - - // ReversibleReaction rate coefficients - - //- Forward rate constant - virtual scalar kf - ( - const scalar T, - const scalar p, - const scalarField& c - ) const; - - //- Reverse rate constant from the given formard rate constant - virtual scalar kr - ( - const scalar kfwd, - const scalar T, - const scalar p, - const scalarField& c - ) const; - - //- Reverse rate constant. - // Note this evaluates the forward rate constant and divides by the - // equilibrium constant - virtual scalar kr - ( - const scalar T, - const scalar p, - const scalarField& c - ) const; - - - //- Write - virtual void write(Ostream&) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#ifdef NoRepository -# include "ReversibleReaction.C" -#endif - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // -- 2.11.4.GIT