Commit e57016a2 authored by Andreas Lauser's avatar Andreas Lauser
Browse files

fluid states: fix massFraction() method for the case where the average molar mass is negative

yeah, that's really exotic, but this occationally happens to me. (if i
force all mole fractions to be positive, I get worse convergence
rates.)

git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@7443 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent cfa53135
......@@ -87,10 +87,10 @@ public:
Scalar massFraction(int phaseIdx, int compIdx) const
{
return
sumMoleFractions_[phaseIdx]
std::abs(sumMoleFractions_[phaseIdx])
* moleFraction_[phaseIdx][compIdx]
* FluidSystem::molarMass(compIdx)
/ std::max(1e-10, averageMolarMass_[phaseIdx]);
/ std::max(1e-40, std::abs(averageMolarMass_[phaseIdx]));
}
/*!
......
......@@ -86,10 +86,10 @@ public:
Scalar massFraction(int phaseIdx, int compIdx) const
{
return
sumMoleFractions_[phaseIdx]
std::abs(sumMoleFractions_[phaseIdx])
* moleFraction_[phaseIdx][compIdx]
* FluidSystem::molarMass(compIdx)
/ std::max(1e-10, averageMolarMass_[phaseIdx]);
/ std::max(1e-40, std::abs(averageMolarMass_[phaseIdx]));
}
/*!
......
Supports Markdown
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