39 template<
class RdeltaTType,
class RhoType,
class SpType,
class SuType>
42 const RdeltaTType& rDeltaT,
68 )/(
rho.field()*rDeltaT -
Sp.field());
74 rho.oldTime().field()*psi0*rDeltaT
77 )/(
rho.field()*rDeltaT -
Sp.field());
80 psi.correctBoundaryConditions();
84 template<
class RhoType>
96 template<
class RhoType,
class SpType,
class SuType>
108 if (fv::localEulerDdt::enabled(
mesh))
115 const scalar rDeltaT = 1.0/
mesh.time().deltaTValue();
121 template<
class RhoType,
class PsiMaxType,
class PsiMinType>
128 const PsiMaxType& psiMax,
129 const PsiMinType& psiMin
162 const PsiMaxType& psiMax,
163 const PsiMinType& psiMin
168 psi.correctBoundaryConditions();
170 if (fv::localEulerDdt::enabled(
mesh))
178 const scalar rDeltaT = 1.0/
mesh.time().deltaTValue();
197 const RdeltaTType& rDeltaT,
204 const PsiMaxType& psiMax,
205 const PsiMinType& psiMin
215 const label nLimiterIter
220 const scalar smoothLimiter
225 const scalar extremaCoeff
230 const scalar boundaryExtremaCoeff
234 "boundaryExtremaCoeff",
239 const scalar boundaryDeltaExtremaCoeff
241 max(boundaryExtremaCoeff - extremaCoeff, 0)
264 mesh.time().timeName(),
268 IOobject::NO_REGISTER
292 const label own = owner[facei];
293 const label nei = neighb[facei];
295 psiMaxn[own] =
max(psiMaxn[own], psiIf[nei]);
296 psiMinn[own] =
min(psiMinn[own], psiIf[nei]);
298 psiMaxn[nei] =
max(psiMaxn[nei], psiIf[own]);
299 psiMinn[nei] =
min(psiMinn[nei], psiIf[own]);
301 sumPhiBD[own] += phiBDIf[facei];
302 sumPhiBD[nei] -= phiBDIf[facei];
304 const scalar phiCorrf = phiCorrIf[facei];
308 sumPhip[own] += phiCorrf;
309 mSumPhim[nei] += phiCorrf;
313 mSumPhim[own] -= phiCorrf;
314 sumPhip[nei] -= phiCorrf;
324 const labelList& pFaceCells =
mesh.boundary()[patchi].faceCells();
332 const label pfCelli = pFaceCells[pFacei];
334 psiMaxn[pfCelli] =
max(psiMaxn[pfCelli], psiPNf[pFacei]);
335 psiMinn[pfCelli] =
min(psiMinn[pfCelli], psiPNf[pFacei]);
342 const label pfCelli = pFaceCells[pFacei];
344 psiMaxn[pfCelli] =
max(psiMaxn[pfCelli], psiPf[pFacei]);
345 psiMinn[pfCelli] =
min(psiMinn[pfCelli], psiPf[pFacei]);
351 if (boundaryDeltaExtremaCoeff > 0)
355 const label pfCelli = pFaceCells[pFacei];
357 const scalar extrema =
358 boundaryDeltaExtremaCoeff
359 *(psiMax[pfCelli] - psiMin[pfCelli]);
361 psiMaxn[pfCelli] += extrema;
362 psiMinn[pfCelli] -= extrema;
369 const label pfCelli = pFaceCells[pFacei];
371 sumPhiBD[pfCelli] += phiBDPf[pFacei];
373 const scalar phiCorrf = phiCorrPf[pFacei];
377 sumPhip[pfCelli] += phiCorrf;
381 mSumPhim[pfCelli] -= phiCorrf;
386 psiMaxn =
min(psiMaxn + extremaCoeff*(psiMax - psiMin), psiMax);
387 psiMinn =
max(psiMinn - extremaCoeff*(psiMax - psiMin), psiMin);
389 if (smoothLimiter > SMALL)
392 min(smoothLimiter*psiIf + (1.0 - smoothLimiter)*psiMaxn, psiMax);
394 max(smoothLimiter*psiIf + (1.0 - smoothLimiter)*psiMinn, psiMin);
404 (
rho.field()*rDeltaT -
Sp.field())*psiMaxn
407 - (V0().field()*rDeltaT)*
rho.oldTime().field()*psi0
414 - (
rho.field()*rDeltaT -
Sp.field())*psiMinn
416 + (V0().field()*rDeltaT)*
rho.oldTime().field()*psi0
424 (
rho.field()*rDeltaT -
Sp.field())*psiMaxn
426 - (
rho.oldTime().field()*rDeltaT)*psi0
434 - (
rho.field()*rDeltaT -
Sp.field())*psiMinn
435 + (
rho.oldTime().field()*rDeltaT)*psi0
443 for (
int j=0; j<nLimiterIter; j++)
450 const label own = owner[facei];
451 const label nei = neighb[facei];
453 scalar lambdaPhiCorrf = lambdaIf[facei]*phiCorrIf[facei];
455 if (lambdaPhiCorrf > 0)
457 sumlPhip[own] += lambdaPhiCorrf;
458 mSumlPhim[nei] += lambdaPhiCorrf;
462 mSumlPhim[own] -= lambdaPhiCorrf;
463 sumlPhip[nei] -= lambdaPhiCorrf;
472 const labelList& pFaceCells =
mesh.boundary()[patchi].faceCells();
476 const label pfCelli = pFaceCells[pFacei];
477 const scalar lambdaPhiCorrf =
478 lambdaPf[pFacei]*phiCorrfPf[pFacei];
480 if (lambdaPhiCorrf > 0)
482 sumlPhip[pfCelli] += lambdaPhiCorrf;
486 mSumlPhim[pfCelli] -= lambdaPhiCorrf;
496 (sumlPhip[celli] + psiMaxn[celli])
497 /(mSumPhim[celli] + ROOTVSMALL),
504 (mSumlPhim[celli] + psiMinn[celli])
505 /(sumPhip[celli] + ROOTVSMALL),
515 if (phiCorrIf[facei] > 0)
517 lambdaIf[facei] =
min 520 min(lambdap[owner[facei]], lambdam[neighb[facei]])
525 lambdaIf[facei] =
min 528 min(lambdam[owner[facei]], lambdap[neighb[facei]])
539 if (isA<wedgeFvPatch>(
mesh.boundary()[patchi]))
546 mesh.boundary()[patchi].faceCells();
550 const label pfCelli = pFaceCells[pFacei];
552 if (phiCorrfPf[pFacei] > 0)
555 min(lambdaPf[pFacei], lambdap[pfCelli]);
560 min(lambdaPf[pFacei], lambdam[pfCelli]);
582 const RdeltaTType& rDeltaT,
589 const PsiMaxType& psiMax,
590 const PsiMinType& psiMin,
591 const bool returnCorr
607 phiBDPf = phiPsiBf[patchi];
621 mesh.time().timeName(),
625 IOobject::NO_REGISTER
653 phiPsi = phiBD +
lambda*phiCorr;
674 const PsiMaxType& psiMax,
675 const PsiMinType& psiMin,
681 if (fv::localEulerDdt::enabled(
mesh))
688 const scalar rDeltaT = 1.0/
mesh.time().deltaTValue();
694 template<
class SurfaceScalarFieldList>
698 UPtrList<scalarField> phiPsiCorrsInternal(phiPsiCorrs.size());
707 const surfaceScalarField::Boundary& bfld =
708 phiPsiCorrs[0].boundaryField();
714 UPtrList<scalarField> phiPsiCorrsPatch(phiPsiCorrs.size());
730 template<
class SurfaceScalarFieldList>
733 const SurfaceScalarFieldList& alphas,
734 SurfaceScalarFieldList& phiPsiCorrs,
739 UPtrList<const scalarField> alphasInternal(alphas.size());
744 UPtrList<scalarField> phiPsiCorrsInternal(phiPsiCorrs.size());
753 const surfaceScalarField::Boundary& bfld =
754 phiPsiCorrs[0].boundaryField();
760 UPtrList<const scalarField> alphasPatch(alphas.size());
766 &alphas[
phasei].boundaryField()[patchi]
769 UPtrList<scalarField> phiPsiCorrsPatch(phiPsiCorrs.size());
void limit(const RdeltaTType &rDeltaT, const RhoType &rho, const volScalarField &psi, const surfaceScalarField &phi, surfaceScalarField &phiPsi, const SpType &Sp, const SuType &Su, const PsiMaxType &psiMax, const PsiMinType &psiMin, const bool returnCorr)
Surface integrate surfaceField creating a volField. Surface sum a surfaceField creating a volField...
virtual bool coupled() const
True if the patch field is coupled.
void size(const label n)
Older name for setAddressableSize.
void surfaceIntegrate(Field< Type > &ivf, const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
tmp< surfaceScalarField > flux(const volVectorField &vvf)
Return the face-flux field obtained from the given volVectorField.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const dimensionSet dimless
Dimensionless.
IOstream & fixed(IOstream &io)
tmp< areaScalarField > limiter(const areaScalarField &phi)
#define forAll(list, i)
Loop across all elements in list.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
void limitSum(UPtrList< scalarField > &phiPsiCorrs)
void limiter(scalarField &allLambda, const RdeltaTType &rDeltaT, const RhoType &rho, const volScalarField &psi, const surfaceScalarField &phiBD, const surfaceScalarField &phiCorr, const SpType &Sp, const SuType &Su, const PsiMaxType &psiMax, const PsiMinType &psiMin)
dimensionedScalar lambda("lambda", dimTime/sqr(dimLength), laminarTransport)
virtual tmp< Field< Type > > patchNeighbourField() const
Return patchField on the opposite patch of a coupled patch.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Us boundaryFieldRef().evaluateCoupled< coupledFaPatch >()
virtual bool coupled() const
True if the patch field is coupled.
Upwind differencing scheme class.
Mesh data needed to do the Finite Volume discretisation.
virtual bool fixesValue() const
True if the patch field fixes a value.
messageStream Info
Information stream (stdout output on master, null elsewhere)
MULES: Multidimensional universal limiter for explicit solution.
const volScalarField & psi
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a T, or return the given default value. FatalIOError if it is found and the number of...
A class for managing temporary objects.
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Specialization of GeometricField which holds slices of given complete fields in a form that they act ...
void explicitSolve(const RdeltaTType &rDeltaT, const RhoType &rho, volScalarField &psi, const surfaceScalarField &phiPsi, const SpType &Sp, const SuType &Su)
Defines the attributes of an object for which implicit objectRegistry management is supported...
An abstract base class with a fat-interface to all derived classes covering all possible ways in whic...
const Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.
static constexpr const zero Zero
Global zero (0)