32 forAll(phiPsiCorrs[0], facei)
39 if (phiPsiCorrs[
phasei][facei] > 0)
41 sumPos += phiPsiCorrs[
phasei][facei];
45 sumNeg += phiPsiCorrs[
phasei][facei];
49 scalar
sum = sumPos + sumNeg;
51 if (sum > 0 && sumPos > vSmall)
53 scalar
lambda = -sumNeg/sumPos;
57 if (phiPsiCorrs[
phasei][facei] > 0)
63 else if (sum < 0 && sumNeg < -vSmall)
65 scalar
lambda = -sumPos/sumNeg;
69 if (phiPsiCorrs[
phasei][facei] < 0)
89 forAll(phiPsiCorrs[0], facei)
91 scalar alphaNotFixed = 0, corrNotFixed = 0;
94 alphaNotFixed += alphas[iter.key()][facei];
95 corrNotFixed += phiPsiCorrs[iter.key()][facei];
101 corrFixed += phiPsiCorrs[iter.key()][facei];
104 const scalar sumCorr = corrNotFixed + corrFixed;
106 const scalar
lambda = - sumCorr/alphaNotFixed;
110 phiPsiCorrs[iter.key()][facei] += lambda*alphas[iter.key()][facei];
#define forAll(list, i)
Loop across all elements in list.
labelList identity(const label len)
Create identity map (map[i] == i) of given length.
IOstream & fixed(IOstream &io)
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
void limitSum(UPtrList< scalarField > &phiPsiCorrs)
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
label size() const
Return the number of elements in the UPtrList.
dimensionedScalar lambda(laminarTransport.lookup("lambda"))
MULES: Multidimensional universal limiter for explicit solution.