50 smoothingCoeff = MULEScontrols.
lookupOrDefault<scalar>(
"smoothingCoeff", 0);
52 extremaCoeff = MULEScontrols.
lookupOrDefault<scalar>(
"extremaCoeff", 0);
54 boundaryExtremaCoeff =
57 if (
dict.found(
"MULES"))
80 forAll(phiPsiCorrs[0], facei)
85 forAll(phiPsiCorrs, phasei)
87 if (phiPsiCorrs[phasei][facei] > 0)
89 sumPos += phiPsiCorrs[phasei][facei];
93 sumNeg += phiPsiCorrs[phasei][facei];
97 const scalar
sum = sumPos + sumNeg;
99 if (
sum > 0 && sumPos > vSmall)
101 const scalar
lambda = -sumNeg/sumPos;
103 forAll(phiPsiCorrs, phasei)
105 if (phiPsiCorrs[phasei][facei] > 0)
107 phiPsiCorrs[phasei][facei] *=
lambda;
111 else if (
sum < 0 && sumNeg < -vSmall)
113 const scalar
lambda = -sumPos/sumNeg;
115 forAll(phiPsiCorrs, phasei)
117 if (phiPsiCorrs[phasei][facei] < 0)
119 phiPsiCorrs[phasei][facei] *=
lambda;
133 forAll(phiPsiCorrs[0], facei)
137 forAll(phiPsiFixedCorrs, i)
139 sumFixed += phiPsiFixedCorrs[i][facei];
147 if (phiPsiCorrs[i][facei] > 0)
149 sumPos += phiPsiCorrs[i][facei];
153 sumNeg += phiPsiCorrs[i][facei];
157 const scalar
sum = sumPos + sumNeg;
159 if (
sum > 0 && sumPos > vSmall)
161 const scalar
lambda = -(sumNeg + sumFixed)/sumPos;
165 if (phiPsiCorrs[i][facei] > 0)
167 phiPsiCorrs[i][facei] *=
lambda;
171 else if (
sum < 0 && sumNeg < -vSmall)
173 const scalar
lambda = -(sumPos + sumFixed)/sumNeg;
177 if (phiPsiCorrs[i][facei] < 0)
179 phiPsiCorrs[i][facei] *=
lambda;
197 forAll(psiPhiCorrsInternal, phasei)
199 psiPhiCorrsInternal.
set(phasei, &psiPhiCorrs[phasei]);
213 if (!psis[phasei].boundaryField()[
patchi].assignable())
223 forAll(psiPhiCorrsPatch, phasei)
228 &psiPhiCorrs[phasei].boundaryFieldRef()[
patchi]
234 else if (nFixed < psiPhiCorrs.
size())
242 forAll(psiPhiCorrsPatch, phasei)
244 if (!psis[phasei].boundaryField()[
patchi].assignable())
246 psiPhiCorrsFixedPatch.
set
249 &psiPhiCorrs[phasei].boundaryFieldRef()[
patchi]
257 &psiPhiCorrs[phasei].boundaryFieldRef()[
patchi]
263 psiPhiCorrsFixedPatch.
setSize(fixedi);
281 psiPhis[phasei] -= alphaPhiBDs[phasei];
288 psiPhis[phasei] += alphaPhiBDs[phasei];
311 limitSum(psis, alphaPhiBDs, psiPhis, phi);
MULES: Multidimensional universal limiter for explicit solution.
#define forAll(list, i)
Loop across all elements in list.
const Mesh & mesh() const
Return mesh.
Generic GeometricBoundaryField class.
Generic GeometricField class.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
bool set(const label) const
Is element set.
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
bool set(const label) const
Is element set.
label size() const
Return the number of elements in the UPtrList.
void setSize(const label)
Reset size of UPtrList. This can only be used to set the size.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
T lookupOrDefault(const word &, const T &, const bool writeDefault=writeOptionalEntries > 0) const
Find and return a T, if not found return the given default.
virtual tmp< SurfaceField< Type > > flux(const VolField< Type > &) const
Return the interpolation weighting factors.
dimensionedScalar lambda(viscosity->lookup("lambda"))
void limitSum(const UPtrList< const volScalarField > &psis, const PtrList< surfaceScalarField > &alphaPhiBDs, UPtrList< surfaceScalarField > &psiPhis, const surfaceScalarField &phi)
void limitSumCorr(UPtrList< scalarField > &psiPhiCorrs)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
defineTypeNameAndDebug(combustionModel, 0)
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
void read(const dictionary &dict)
Read dict and set the controls.
control()
Null constructor.