Merge branch 'master' of ssh://noisy/home/noisy3/OpenFOAM/OpenFOAM-dev

This commit is contained in:
henry 2009-07-10 12:04:45 +01:00
commit 66ed15f2c3
3 changed files with 24 additions and 26 deletions

View File

@ -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_.size(); n++)
{
Yt += Y_[n];
}
forAll (Y_, n)
{
Y_[n] /= Yt;
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::basicMultiComponentMixture::basicMultiComponentMixture
@ -120,7 +102,8 @@ Foam::basicMultiComponentMixture::basicMultiComponentMixture
}
}
correctMassFractions();
// Do not enforce constraint of sum of mass fractions to equal 1 here
// - not applicable to all models
}

View File

@ -63,12 +63,6 @@ protected:
PtrList<volScalarField> Y_;
// Protected member functions
//- Correct the mass fractions to sum to 1
void correctMassFractions();
public:
// Constructors

View File

@ -47,6 +47,23 @@ const ThermoType& Foam::multiComponentMixture<ThermoType>::constructSpeciesData
}
template<class ThermoType>
void Foam::multiComponentMixture<ThermoType>::correctMassFractions()
{
volScalarField Yt = Y_[0];
for (label n=1; n<Y_.size(); n++)
{
Yt += Y_[n];
}
forAll (Y_, n)
{
Y_[n] /= Yt;
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class ThermoType>
@ -70,6 +87,8 @@ Foam::multiComponentMixture<ThermoType>::multiComponentMixture
new ThermoType(*specieThermoData[species_[i]])
);
}
correctMassFractions();
}
@ -83,7 +102,9 @@ Foam::multiComponentMixture<ThermoType>::multiComponentMixture
basicMultiComponentMixture(thermoDict, thermoDict.lookup("species"), mesh),
speciesData_(species_.size()),
mixture_("mixture", constructSpeciesData(thermoDict))
{}
{
correctMassFractions();
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //