38template<
class RdeltaTType,
class RhoType,
class SpType,
class SuType>
41 const RdeltaTType& rDeltaT,
54 fvc::surfaceIntegrate(psiIf, phiCorr);
58 psi.primitiveFieldRef() =
60 rho.field()*
psi.primitiveField()*rDeltaT
63 )/(
rho.field()*rDeltaT -
Sp.field());
67 psi.primitiveFieldRef() =
69 rho.field()*
psi.primitiveField()*rDeltaT
72 )/(
rho.field()*rDeltaT -
Sp.field());
75 psi.correctBoundaryConditions();
79template<
class RhoType>
91template<
class RhoType,
class SpType,
class SuType>
103 if (fv::localEulerDdt::enabled(
mesh))
110 const scalar rDeltaT = 1.0/
mesh.time().deltaTValue();
116template<
class RhoType,
class PsiMaxType,
class PsiMinType>
123 const PsiMaxType& psiMax,
124 const PsiMinType& psiMin
147 const PsiMaxType& psiMax,
148 const PsiMinType& psiMin
153 if (fv::localEulerDdt::enabled(
mesh))
174 const scalar rDeltaT = 1.0/
mesh.time().deltaTValue();
206 const RdeltaTType& rDeltaT,
213 const PsiMaxType& psiMax,
214 const PsiMinType& psiMin
224 const label nLimiterIter
226 MULEScontrols.
get<label>(
"nLimiterIter")
229 const scalar smoothLimiter
234 const scalar extremaCoeff
239 const scalar boundaryExtremaCoeff
243 "boundaryExtremaCoeff",
248 const scalar boundaryDeltaExtremaCoeff
250 max(boundaryExtremaCoeff - extremaCoeff, 0)
270 mesh.time().timeName(),
284 lambda.boundaryFieldRef();
297 const label own = owner[facei];
298 const label nei = neighb[facei];
300 psiMaxn[own] =
max(psiMaxn[own], psiIf[nei]);
301 psiMinn[own] =
min(psiMinn[own], psiIf[nei]);
303 psiMaxn[nei] =
max(psiMaxn[nei], psiIf[own]);
304 psiMinn[nei] =
min(psiMinn[nei], psiIf[own]);
306 const scalar phiCorrf = phiCorrIf[facei];
310 sumPhip[own] += phiCorrf;
311 mSumPhim[nei] += phiCorrf;
315 mSumPhim[own] -= phiCorrf;
316 sumPhip[nei] -= phiCorrf;
325 const labelList& pFaceCells =
mesh.boundary()[patchi].faceCells();
333 label pfCelli = pFaceCells[pFacei];
335 psiMaxn[pfCelli] =
max(psiMaxn[pfCelli], psiPNf[pFacei]);
336 psiMinn[pfCelli] =
min(psiMinn[pfCelli], psiPNf[pFacei]);
343 const label pfCelli = pFaceCells[pFacei];
345 psiMaxn[pfCelli] =
max(psiMaxn[pfCelli], psiPf[pFacei]);
346 psiMinn[pfCelli] =
min(psiMinn[pfCelli], psiPf[pFacei]);
352 if (boundaryDeltaExtremaCoeff > 0)
356 const label pfCelli = pFaceCells[pFacei];
358 const scalar extrema =
359 boundaryDeltaExtremaCoeff
360 *(psiMax[pfCelli] - psiMin[pfCelli]);
362 psiMaxn[pfCelli] += extrema;
363 psiMinn[pfCelli] -= extrema;
370 const label pfCelli = pFaceCells[pFacei];
372 const scalar phiCorrf = phiCorrPf[pFacei];
376 sumPhip[pfCelli] += phiCorrf;
380 mSumPhim[pfCelli] -= phiCorrf;
385 psiMaxn =
min(psiMaxn + extremaCoeff*(psiMax - psiMin), psiMax);
386 psiMinn =
max(psiMinn - extremaCoeff*(psiMax - psiMin), psiMin);
388 if (smoothLimiter > SMALL)
391 min(smoothLimiter*psiIf + (1.0 - smoothLimiter)*psiMaxn, psiMax);
393 max(smoothLimiter*psiIf + (1.0 - smoothLimiter)*psiMinn, psiMin);
399 (
rho.field()*rDeltaT -
Sp.field())*psiMaxn
401 -
rho.field()*
psi.primitiveField()*rDeltaT
408 - (
rho.field()*rDeltaT -
Sp.field())*psiMinn
409 +
rho.field()*
psi.primitiveField()*rDeltaT
415 for (
int j=0; j<nLimiterIter; j++)
422 const label own = owner[facei];
423 const label nei = neighb[facei];
425 const scalar lambdaPhiCorrf = lambdaIf[facei]*phiCorrIf[facei];
427 if (lambdaPhiCorrf > 0)
429 sumlPhip[own] += lambdaPhiCorrf;
430 mSumlPhim[nei] += lambdaPhiCorrf;
434 mSumlPhim[own] -= lambdaPhiCorrf;
435 sumlPhip[nei] -= lambdaPhiCorrf;
444 const labelList& pFaceCells =
mesh.boundary()[patchi].faceCells();
448 label pfCelli = pFaceCells[pFacei];
450 scalar lambdaPhiCorrf = lambdaPf[pFacei]*phiCorrfPf[pFacei];
452 if (lambdaPhiCorrf > 0)
454 sumlPhip[pfCelli] += lambdaPhiCorrf;
458 mSumlPhim[pfCelli] -= lambdaPhiCorrf;
468 (sumlPhip[celli] + psiMaxn[celli])
469 /(mSumPhim[celli] + ROOTVSMALL),
476 (mSumlPhim[celli] + psiMinn[celli])
477 /(sumPhip[celli] + ROOTVSMALL),
487 if (phiCorrIf[facei] > 0)
489 lambdaIf[facei] =
min
492 min(lambdap[owner[facei]], lambdam[neighb[facei]])
497 lambdaIf[facei] =
min
500 min(lambdam[owner[facei]], lambdap[neighb[facei]])
512 if (isA<wedgeFvPatch>(
mesh.boundary()[patchi]))
519 mesh.boundary()[patchi].faceCells();
523 const label pfCelli = pFaceCells[pFacei];
525 if (phiCorrfPf[pFacei] > 0)
528 min(lambdaPf[pFacei], lambdap[pfCelli]);
533 min(lambdaPf[pFacei], lambdam[pfCelli]);
540 mesh.boundary()[patchi].faceCells();
546 if ((phiPf[pFacei] + phiCorrfPf[pFacei]) > SMALL*SMALL)
548 const label pfCelli = pFaceCells[pFacei];
550 if (phiCorrfPf[pFacei] > 0)
553 min(lambdaPf[pFacei], lambdap[pfCelli]);
558 min(lambdaPf[pFacei], lambdam[pfCelli]);
581 const RdeltaTType& rDeltaT,
588 const PsiMaxType& psiMax,
589 const PsiMinType& psiMin
601 mesh.time().timeName(),
CMULES: Multidimensional universal limiter for explicit corrected implicit solution.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Specialization of GeometricField which holds slices of given complete fields in a form that they act ...
void size(const label n)
Older name for setAddressableSize.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
Mesh data needed to do the Finite Volume discretisation.
virtual bool fixesValue() const
Return true if this patch field fixes a value.
virtual tmp< Field< Type > > patchNeighbourField() const
Return patchField on the opposite patch of a coupled patch.
virtual bool coupled() const
Return true if this patch field is coupled.
A class for managing temporary objects.
A class representing the concept of a field of 0 used to avoid unnecessary manipulations for objects ...
const volScalarField & psi
Surface integrate surfaceField creating a volField. Surface sum a surfaceField creating a volField.
void limiterCorr(scalarField &allLambda, const RdeltaTType &rDeltaT, const RhoType &rho, const volScalarField &psi, const surfaceScalarField &phi, const surfaceScalarField &phiCorr, const SpType &Sp, const SuType &Su, const PsiMaxType &psiMax, const PsiMinType &psiMin)
void limitCorr(const RdeltaTType &rDeltaT, const RhoType &rho, const volScalarField &psi, const surfaceScalarField &phi, surfaceScalarField &phiCorr, const SpType &Sp, const SuType &Su, const PsiMaxType &psiMax, const PsiMinType &psiMin)
void correct(const RdeltaTType &rDeltaT, const RhoType &rho, volScalarField &psi, const surfaceScalarField &phiCorr, const SpType &Sp, const SuType &Su)
const dimensionSet dimless
Dimensionless.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
dimensionedScalar lambda("lambda", dimTime/sqr(dimLength), laminarTransport)
#define forAll(list, i)
Loop across all elements in list.