36 template<
class RdeltaTType,
class RhoType,
class SpType,
class SuType>
39 const RdeltaTType& rDeltaT,
61 mesh.
Vsc0()().field()*rho.oldTime().field()
62 *psi0*rDeltaT/mesh.
Vsc()().field()
65 )/(rho.field()*rDeltaT - Sp.field());
71 rho.oldTime().field()*psi0*rDeltaT
74 )/(rho.field()*rDeltaT - Sp.field());
81 template<
class RhoType,
class SpType,
class SuType>
93 if (fv::localEulerDdt::enabled(mesh))
95 const volScalarField& rDeltaT = fv::localEulerDdt::localRDeltaT(mesh);
106 template<
class RhoType,
class SpType,
class SuType>
123 if (fv::localEulerDdt::enabled(mesh))
125 const volScalarField& rDeltaT = fv::localEulerDdt::localRDeltaT(mesh);
166 template<
class RdeltaTType,
class RhoType,
class SpType,
class SuType>
170 const RdeltaTType& rDeltaT,
188 const label nLimiterIter
193 const scalar smoothLimiter
198 const scalar extremaCoeff
211 const surfaceScalarField::Boundary& phiBDBf =
215 const surfaceScalarField::Boundary& phiCorrBf =
248 const label own = owner[facei];
249 const label nei = neighb[facei];
251 psiMaxn[own] =
max(psiMaxn[own], psiIf[nei]);
252 psiMinn[own] =
min(psiMinn[own], psiIf[nei]);
254 psiMaxn[nei] =
max(psiMaxn[nei], psiIf[own]);
255 psiMinn[nei] =
min(psiMinn[nei], psiIf[own]);
257 sumPhiBD[own] += phiBDIf[facei];
258 sumPhiBD[nei] -= phiBDIf[facei];
260 const scalar phiCorrf = phiCorrIf[facei];
264 sumPhip[own] += phiCorrf;
265 mSumPhim[nei] += phiCorrf;
269 mSumPhim[own] -= phiCorrf;
270 sumPhip[nei] -= phiCorrf;
288 const label pfCelli = pFaceCells[pFacei];
290 psiMaxn[pfCelli] =
max(psiMaxn[pfCelli], psiPNf[pFacei]);
291 psiMinn[pfCelli] =
min(psiMinn[pfCelli], psiPNf[pFacei]);
298 const label pfCelli = pFaceCells[pFacei];
300 psiMaxn[pfCelli] =
max(psiMaxn[pfCelli], psiPf[pFacei]);
301 psiMinn[pfCelli] =
min(psiMinn[pfCelli], psiPf[pFacei]);
308 const label pfCelli = pFaceCells[pFacei];
310 psiMaxn[pfCelli] =
max(psiMaxn[pfCelli], psiMax);
311 psiMinn[pfCelli] =
min(psiMinn[pfCelli], psiMin);
317 const label pfCelli = pFaceCells[pFacei];
319 sumPhiBD[pfCelli] += phiBDPf[pFacei];
321 const scalar phiCorrf = phiCorrPf[pFacei];
325 sumPhip[pfCelli] += phiCorrf;
329 mSumPhim[pfCelli] -= phiCorrf;
334 psiMaxn =
min(psiMaxn + extremaCoeff*(psiMax - psiMin), psiMax);
335 psiMinn =
max(psiMinn - extremaCoeff*(psiMax - psiMin), psiMin);
337 if (smoothLimiter > SMALL)
340 min(smoothLimiter*psiIf + (1.0 - smoothLimiter)*psiMaxn, psiMax);
342 max(smoothLimiter*psiIf + (1.0 - smoothLimiter)*psiMinn, psiMin);
352 (rho.field()*rDeltaT - Sp.field())*psiMaxn
355 - (V0().field()*rDeltaT)*rho.oldTime().field()*psi0
362 - (rho.field()*rDeltaT - Sp.field())*psiMinn
364 + (V0().field()*rDeltaT)*rho.oldTime().field()*psi0
372 (rho.field()*rDeltaT - Sp.field())*psiMaxn
374 - (rho.oldTime().field()*rDeltaT)*psi0
382 - (rho.field()*rDeltaT - Sp.field())*psiMinn
383 + (rho.oldTime().field()*rDeltaT)*psi0
391 for (
int j=0; j<nLimiterIter; j++)
398 const label own = owner[facei];
399 const label nei = neighb[facei];
401 scalar lambdaPhiCorrf = lambdaIf[facei]*phiCorrIf[facei];
403 if (lambdaPhiCorrf > 0)
405 sumlPhip[own] += lambdaPhiCorrf;
406 mSumlPhim[nei] += lambdaPhiCorrf;
410 mSumlPhim[own] -= lambdaPhiCorrf;
411 sumlPhip[nei] -= lambdaPhiCorrf;
424 const label pfCelli = pFaceCells[pFacei];
425 const scalar lambdaPhiCorrf =
426 lambdaPf[pFacei]*phiCorrfPf[pFacei];
428 if (lambdaPhiCorrf > 0)
430 sumlPhip[pfCelli] += lambdaPhiCorrf;
434 mSumlPhim[pfCelli] -= lambdaPhiCorrf;
444 (sumlPhip[celli] + psiMaxn[celli])
445 /(mSumPhim[celli] + ROOTVSMALL),
452 (mSumlPhim[celli] + psiMinn[celli])
453 /(sumPhip[celli] + ROOTVSMALL),
463 if (phiCorrIf[facei] > 0)
465 lambdaIf[facei] =
min 468 min(lambdap[owner[facei]], lambdam[neighb[facei]])
473 lambdaIf[facei] =
min 476 min(lambdam[owner[facei]], lambdap[neighb[facei]])
498 const label pfCelli = pFaceCells[pFacei];
500 if (phiCorrfPf[pFacei] > 0)
503 min(lambdaPf[pFacei], lambdap[pfCelli]);
508 min(lambdaPf[pFacei], lambdam[pfCelli]);
519 template<
class RdeltaTType,
class RhoType,
class SpType,
class SuType>
522 const RdeltaTType& rDeltaT,
531 const bool returnCorr
539 const surfaceScalarField::Boundary& phiPsiBf = phiPsi.
boundaryField();
547 phiBDPf = phiPsiBf[
patchi];
593 phiPsi = phiBD + lambda*phiCorr;
598 template<
class SurfaceScalarFieldList>
611 const surfaceScalarField::Boundary& bfld =
612 phiPsiCorrs[0].boundaryField();
616 if (bfld[
patchi].coupled())
Surface integrate surfaceField creating a volField. Surface sum a surfaceField creating a volField...
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 scalar psiMax, const scalar psiMin)
#define forAll(list, i)
Loop across all elements in list.
const GeometricField< Type, PatchField, GeoMesh > & oldTime() const
Return old time field.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const word & name() const
Return name.
void surfaceIntegrate(Field< Type > &ivf, const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
bool moving() const
Is mesh moving.
virtual bool fixesValue() const
Return true if this patch field fixes a value.
A list of keyword definitions, which are a keyword followed by any number of values (e...
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
const Boundary & boundaryField() const
Return const-reference to the boundary field.
void size(const label)
Override size to be inconsistent with allocated storage.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
const Time & time() const
Return the top-level database.
const dictionary & solverDict(const word &name) const
Return the solver controls dictionary for the given field.
const labelUList & neighbour() const
Internal face neighbour.
tmp< DimensionedField< scalar, volMesh > > Vsc() const
Return sub-cycle cell volumes.
void limitSum(UPtrList< scalarField > &phiPsiCorrs)
void limit(const RdeltaTType &rDeltaT, const RhoType &rho, const volScalarField &psi, const surfaceScalarField &phi, surfaceScalarField &phiPsi, const SpType &Sp, const SuType &Su, const scalar psiMax, const scalar psiMin, const bool returnCorr)
virtual bool coupled() const
Return true if this patch field is coupled.
virtual tmp< Field< Type > > patchNeighbourField() const
Return patchField on the opposite patch of a coupled patch.
scalar deltaTValue() const
Return time step value.
virtual bool coupled() const
Return true if this patch field is coupled.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
tmp< DimensionedField< scalar, volMesh > > Vsc0() const
Return sub-cycl old-time cell volumes.
const Mesh & mesh() const
Return mesh.
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
const labelUList & owner() const
Internal face owner.
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
Boundary & boundaryFieldRef()
Return a reference to the boundary field.
Upwind differencing scheme class.
Mesh data needed to do the Finite Volume discretisation.
dimensionedScalar lambda(laminarTransport.lookup("lambda"))
void correctBoundaryConditions()
Correct boundary field.
MULES: Multidimensional universal limiter for explicit solution.
const volScalarField & psi
A class for managing temporary objects.
tmp< surfaceScalarField > flux(const volVectorField &vvf)
Return the face-flux field obtained from the given volVectorField.
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)
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
An abstract base class with a fat-interface to all derived classes covering all possible ways in whic...
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.