Go to the documentation of this file.
36 const label nPhases = phiPsiCorrs.
size();
38 forAll(phiPsiCorrs[0], facei)
45 if (phiPsiCorrs[
phasei][facei] > 0)
47 sumPos += phiPsiCorrs[
phasei][facei];
51 sumNeg += phiPsiCorrs[
phasei][facei];
55 scalar
sum = sumPos + sumNeg;
57 if (
sum > 0 && sumPos > VSMALL)
59 scalar
lambda = -sumNeg/sumPos;
63 if (phiPsiCorrs[
phasei][facei] > 0)
69 else if (
sum < 0 && sumNeg < -VSMALL)
71 scalar
lambda = -sumPos/sumNeg;
75 if (phiPsiCorrs[
phasei][facei] < 0)
87 const UPtrList<const scalarField>& alphas,
88 UPtrList<scalarField>& phiPsiCorrs,
95 forAll(phiPsiCorrs[0], facei)
97 scalar alphaNotFixed = 0, corrNotFixed = 0;
98 for (
const label
phasei : notFixed)
100 alphaNotFixed += alphas[
phasei][facei];
101 corrNotFixed += phiPsiCorrs[
phasei][facei];
104 scalar corrFixed = 0;
107 corrFixed += phiPsiCorrs[
phasei][facei];
110 const scalar sumCorr = corrNotFixed + corrFixed;
112 const scalar
lambda = - sumCorr/alphaNotFixed;
114 for (
const label
phasei : notFixed)
label size() const noexcept
A HashTable with keys but without contents that is similar to std::unordered_set.
void limitSum(UPtrList< scalarField > &phiPsiCorrs)
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
IOstream & fixed(IOstream &io)
dimensionedScalar lambda("lambda", dimTime/sqr(dimLength), laminarTransport)
labelList identity(const label len, label start=0)
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
HashSet< label, Hash< label > > labelHashSet
A HashSet with label keys and label hasher.
MULES: Multidimensional universal limiter for explicit solution.