Skip to content
Snippets Groups Projects
Commit 3d4f910b authored by Andrew Heather's avatar Andrew Heather
Browse files

moving correctMassFractions() to multiComponentMixture

parent fd8ef1c0
Branches
Tags
No related merge requests found
......@@ -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
}
......
......@@ -63,12 +63,6 @@ protected:
PtrList<volScalarField> Y_;
// Protected member functions
//- Correct the mass fractions to sum to 1
void correctMassFractions();
public:
// Constructors
......
......@@ -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 * * * * * * * * * * * * * //
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment