mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of ssh://noisy/home/noisy3/OpenFOAM/OpenFOAM-dev
This commit is contained in:
@ -26,24 +26,6 @@ License
|
|||||||
|
|
||||||
#include "basicMultiComponentMixture.H"
|
#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 * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::basicMultiComponentMixture::basicMultiComponentMixture
|
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_;
|
PtrList<volScalarField> Y_;
|
||||||
|
|
||||||
|
|
||||||
// Protected member functions
|
|
||||||
|
|
||||||
//- Correct the mass fractions to sum to 1
|
|
||||||
void correctMassFractions();
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Constructors
|
// 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 * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class ThermoType>
|
template<class ThermoType>
|
||||||
@ -70,6 +87,8 @@ Foam::multiComponentMixture<ThermoType>::multiComponentMixture
|
|||||||
new ThermoType(*specieThermoData[species_[i]])
|
new ThermoType(*specieThermoData[species_[i]])
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
correctMassFractions();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -83,7 +102,9 @@ Foam::multiComponentMixture<ThermoType>::multiComponentMixture
|
|||||||
basicMultiComponentMixture(thermoDict, thermoDict.lookup("species"), mesh),
|
basicMultiComponentMixture(thermoDict, thermoDict.lookup("species"), mesh),
|
||||||
speciesData_(species_.size()),
|
speciesData_(species_.size()),
|
||||||
mixture_("mixture", constructSpeciesData(thermoDict))
|
mixture_("mixture", constructSpeciesData(thermoDict))
|
||||||
{}
|
{
|
||||||
|
correctMassFractions();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|||||||
Reference in New Issue
Block a user