From 3d4f910bc3b35266299291a35e3967dfa0082712 Mon Sep 17 00:00:00 2001 From: andy Date: Fri, 10 Jul 2009 11:58:51 +0100 Subject: [PATCH] moving correctMassFractions() to multiComponentMixture --- .../basicMultiComponentMixture.C | 21 ++--------------- .../basicMultiComponentMixture.H | 6 ----- .../multiComponentMixture.C | 23 ++++++++++++++++++- 3 files changed, 24 insertions(+), 26 deletions(-) diff --git a/src/thermophysicalModels/reactionThermo/mixtures/basicMultiComponentMixture/basicMultiComponentMixture.C b/src/thermophysicalModels/reactionThermo/mixtures/basicMultiComponentMixture/basicMultiComponentMixture.C index 1016a33a97..984c06bdf2 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/basicMultiComponentMixture/basicMultiComponentMixture.C +++ b/src/thermophysicalModels/reactionThermo/mixtures/basicMultiComponentMixture/basicMultiComponentMixture.C @@ -26,24 +26,6 @@ License #include "basicMultiComponentMixture.H" -// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // - -void Foam::basicMultiComponentMixture::correctMassFractions() -{ - volScalarField Yt = Y_[0]; - - for(label n=1; n Y_; - // Protected member functions - - //- Correct the mass fractions to sum to 1 - void correctMassFractions(); - - public: // Constructors diff --git a/src/thermophysicalModels/reactionThermo/mixtures/multiComponentMixture/multiComponentMixture.C b/src/thermophysicalModels/reactionThermo/mixtures/multiComponentMixture/multiComponentMixture.C index 521959a2e9..62458df464 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/multiComponentMixture/multiComponentMixture.C +++ b/src/thermophysicalModels/reactionThermo/mixtures/multiComponentMixture/multiComponentMixture.C @@ -47,6 +47,23 @@ const ThermoType& Foam::multiComponentMixture::constructSpeciesData } +template +void Foam::multiComponentMixture::correctMassFractions() +{ + volScalarField Yt = Y_[0]; + + for (label n=1; n @@ -70,6 +87,8 @@ Foam::multiComponentMixture::multiComponentMixture new ThermoType(*specieThermoData[species_[i]]) ); } + + correctMassFractions(); } @@ -83,7 +102,9 @@ Foam::multiComponentMixture::multiComponentMixture basicMultiComponentMixture(thermoDict, thermoDict.lookup("species"), mesh), speciesData_(species_.size()), mixture_("mixture", constructSpeciesData(thermoDict)) -{} +{ + correctMassFractions(); +} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //