From 21b3d19575ca622bb8a68df7424815d69bb2e47b Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Fri, 15 Jun 2018 16:15:42 +0100 Subject: [PATCH] thermophysicalModels::Reaction: Refactored to remove unnecessary solid reaction specific functions --- .../solvers/combustion/fireFoam/Make/options | 1 + .../pyrolysisChemistryModel.C | 16 +++++++++--- .../reaction/Reactions/Reaction/Reaction.C | 26 ------------------- .../reaction/Reactions/Reaction/Reaction.H | 9 ------- 4 files changed, 14 insertions(+), 38 deletions(-) diff --git a/applications/solvers/combustion/fireFoam/Make/options b/applications/solvers/combustion/fireFoam/Make/options index 2c5162642..b50245d7e 100644 --- a/applications/solvers/combustion/fireFoam/Make/options +++ b/applications/solvers/combustion/fireFoam/Make/options @@ -6,6 +6,7 @@ EXE_INC = \ -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ -I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/solidSpecie/lnInclude \ -I$(LIB_SRC)/transportModels/compressible/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/solidThermo/lnInclude \ diff --git a/src/thermophysicalModels/solidChemistryModel/pyrolysisChemistryModel/pyrolysisChemistryModel.C b/src/thermophysicalModels/solidChemistryModel/pyrolysisChemistryModel/pyrolysisChemistryModel.C index 6fea87184..bfba92e00 100644 --- a/src/thermophysicalModels/solidChemistryModel/pyrolysisChemistryModel/pyrolysisChemistryModel.C +++ b/src/thermophysicalModels/solidChemistryModel/pyrolysisChemistryModel/pyrolysisChemistryModel.C @@ -37,7 +37,13 @@ pyrolysisChemistryModel ) : solidChemistryModel(thermo), - pyrolisisGases_(this->reactions_[0].gasSpecies()), + pyrolisisGases_ + ( + dynamic_cast&> + ( + this->reactions_[0] + ).gasSpecies() + ), gasThermo_(pyrolisisGases_.size()), nGases_(pyrolisisGases_.size()), nSpecie_(this->Ys_.size() + nGases_), @@ -156,7 +162,7 @@ pyrolysisChemistryModel Info<< indent << "Number of gases = " << nGases_ << nl; forAll(this->reactions_, i) { - Info<< dynamic_cast& > + Info<< dynamic_cast&> ( this->reactions_[i] ) << nl; @@ -193,7 +199,11 @@ pyrolysisChemistryModel::omega forAll(this->reactions_, i) { - const Reaction& R = this->reactions_[i]; + const SolidReaction& R = + dynamic_cast&> + ( + this->reactions_[i] + ); scalar omegai = omega ( diff --git a/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.C b/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.C index f17036f37..c33789ec9 100644 --- a/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.C +++ b/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.C @@ -806,30 +806,4 @@ const Foam::speciesTable& Foam::Reaction::species() const } -template -const Foam::speciesTable& Foam::Reaction::gasSpecies() const -{ - NotImplemented; - return NullObjectRef(); -} - - -template -const Foam::List::specieCoeffs>& -Foam::Reaction::glhs() const -{ - NotImplemented; - return NullObjectRef>(); -} - - -template -const Foam::List::specieCoeffs>& -Foam::Reaction::grhs() const -{ - NotImplemented; - return NullObjectRef>(); -} - - // ************************************************************************* // diff --git a/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.H b/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.H index dce5e7688..8a3fa54c5 100644 --- a/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.H +++ b/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.H @@ -249,18 +249,9 @@ public: //- Access to the components of the right hand side inline const List& rhs() const; - //- Access to the gas components of the left hand side - virtual const List& grhs() const; - - //- Access to the gas components of the right hand side - virtual const List& glhs() const; - //- Access to specie list const speciesTable& species() const; - //- Access to gas specie list - virtual const speciesTable& gasSpecies() const; - //- Construct the left- and right-hand-side reaction coefficients void setLRhs (