35 template<
class RdeltaTType,
class RhoType,
class SpType,
class SuType>
38 const RdeltaTType& rDeltaT,
60 )/(rho.field()*rDeltaT - Sp.field());
69 )/(rho.field()*rDeltaT - Sp.field());
76 template<
class RhoType>
88 template<
class RhoType,
class SpType,
class SuType>
100 if (fv::localEulerDdt::enabled(mesh))
102 const volScalarField& rDeltaT = fv::localEulerDdt::localRDeltaT(mesh);
103 correct(rDeltaT, rho, psi, phiCorr, Sp, Su);
108 correct(rDeltaT, rho, psi, phiCorr, Sp, Su);
113 template<
class RhoType,
class PsiMaxType,
class PsiMinType>
120 const PsiMaxType& psiMax,
121 const PsiMinType& psiMin
144 const PsiMaxType& psiMax,
145 const PsiMinType& psiMin
150 if (fv::localEulerDdt::enabled(mesh))
152 const volScalarField& rDeltaT = fv::localEulerDdt::localRDeltaT(mesh);
167 correct(rDeltaT, rho, psi, phiCorr, Sp, Su);
186 correct(rDeltaT, rho, psi, phiCorr, Sp, Su);
203 const RdeltaTType& rDeltaT,
210 const PsiMaxType& psiMax,
211 const PsiMinType& psiMin
221 const label nLimiterIter
226 const scalar smoothLimiter
231 const scalar extremaCoeff
236 const scalar boundaryExtremaCoeff
240 "boundaryExtremaCoeff",
245 const scalar boundaryDeltaExtremaCoeff
247 max(boundaryExtremaCoeff - extremaCoeff, 0)
255 const surfaceScalarField::Boundary& phiBf =
259 const surfaceScalarField::Boundary& phiCorrBf =
280 surfaceScalarField::Boundary& lambdaBf =
294 const label own = owner[facei];
295 const label nei = neighb[facei];
297 psiMaxn[own] =
max(psiMaxn[own], psiIf[nei]);
298 psiMinn[own] =
min(psiMinn[own], psiIf[nei]);
300 psiMaxn[nei] =
max(psiMaxn[nei], psiIf[own]);
301 psiMinn[nei] =
min(psiMinn[nei], psiIf[own]);
303 const scalar phiCorrf = phiCorrIf[facei];
307 sumPhip[own] += phiCorrf;
308 mSumPhim[nei] += phiCorrf;
312 mSumPhim[own] -= phiCorrf;
313 sumPhip[nei] -= phiCorrf;
330 label pfCelli = pFaceCells[pFacei];
332 psiMaxn[pfCelli] =
max(psiMaxn[pfCelli], psiPNf[pFacei]);
333 psiMinn[pfCelli] =
min(psiMinn[pfCelli], psiPNf[pFacei]);
340 const label pfCelli = pFaceCells[pFacei];
342 psiMaxn[pfCelli] =
max(psiMaxn[pfCelli], psiPf[pFacei]);
343 psiMinn[pfCelli] =
min(psiMinn[pfCelli], psiPf[pFacei]);
349 if (boundaryDeltaExtremaCoeff > 0)
353 const label pfCelli = pFaceCells[pFacei];
355 const scalar extrema =
356 boundaryDeltaExtremaCoeff
357 *(psiMax[pfCelli] - psiMin[pfCelli]);
359 psiMaxn[pfCelli] += extrema;
360 psiMinn[pfCelli] -= extrema;
367 const label pfCelli = pFaceCells[pFacei];
369 const scalar phiCorrf = phiCorrPf[pFacei];
373 sumPhip[pfCelli] += phiCorrf;
377 mSumPhim[pfCelli] -= phiCorrf;
382 psiMaxn =
min(psiMaxn + extremaCoeff*(psiMax - psiMin), psiMax);
383 psiMinn =
max(psiMinn - extremaCoeff*(psiMax - psiMin), psiMin);
385 if (smoothLimiter > small)
388 min(smoothLimiter*psiIf + (1.0 - smoothLimiter)*psiMaxn, psiMax);
390 max(smoothLimiter*psiIf + (1.0 - smoothLimiter)*psiMinn, psiMin);
396 (rho.field()*rDeltaT - Sp.field())*psiMaxn
405 - (rho.field()*rDeltaT - Sp.field())*psiMinn
412 for (
int j=0; j<nLimiterIter; j++)
419 const label own = owner[facei];
420 const label nei = neighb[facei];
422 const scalar lambdaPhiCorrf = lambdaIf[facei]*phiCorrIf[facei];
424 if (lambdaPhiCorrf > 0)
426 sumlPhip[own] += lambdaPhiCorrf;
427 mSumlPhim[nei] += lambdaPhiCorrf;
431 mSumlPhim[own] -= lambdaPhiCorrf;
432 sumlPhip[nei] -= lambdaPhiCorrf;
445 label pfCelli = pFaceCells[pFacei];
447 scalar lambdaPhiCorrf = lambdaPf[pFacei]*phiCorrfPf[pFacei];
449 if (lambdaPhiCorrf > 0)
451 sumlPhip[pfCelli] += lambdaPhiCorrf;
455 mSumlPhim[pfCelli] -= lambdaPhiCorrf;
465 (sumlPhip[celli] + psiMaxn[celli])
466 /(mSumPhim[celli] + rootVSmall),
473 (mSumlPhim[celli] + psiMinn[celli])
474 /(sumPhip[celli] + rootVSmall),
484 if (phiCorrIf[facei] > 0)
486 lambdaIf[facei] =
min 489 min(lambdap[owner[facei]], lambdam[neighb[facei]])
494 lambdaIf[facei] =
min 497 min(lambdam[owner[facei]], lambdap[neighb[facei]])
520 const label pfCelli = pFaceCells[pFacei];
522 if (phiCorrfPf[pFacei] > 0)
525 min(lambdaPf[pFacei], lambdap[pfCelli]);
530 min(lambdaPf[pFacei], lambdam[pfCelli]);
543 if ((phiPf[pFacei] + phiCorrfPf[pFacei]) > small*small)
545 const label pfCelli = pFaceCells[pFacei];
547 if (phiCorrfPf[pFacei] > 0)
550 min(lambdaPf[pFacei], lambdap[pfCelli]);
555 min(lambdaPf[pFacei], lambdam[pfCelli]);
578 const RdeltaTType& rDeltaT,
585 const PsiMaxType& psiMax,
586 const PsiMinType& psiMin
Surface integrate surfaceField creating a volField. Surface sum a surfaceField creating a volField...
#define forAll(list, i)
Loop across all elements in list.
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.
dimensionedScalar lambda(laminarTransport.lookup("lambda"))
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...
const Internal::FieldType & primitiveField() const
Return a const-reference to the internal field.
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
const dimensionSet dimless
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.
void correct(const RdeltaTType &rDeltaT, const RhoType &rho, volScalarField &psi, const surfaceScalarField &phiCorr, const SpType &Sp, const SuType &Su)
tmp< DimensionedField< scalar, volMesh > > Vsc() const
Return sub-cycle cell volumes.
A class representing the concept of a field of 0 used to avoid unnecessary manipulations for objects ...
virtual tmp< Field< Type > > patchNeighbourField() const
Return patchField on the opposite patch of a coupled patch.
Info<< "Predicted p max-min : "<< max(p).value()<< " "<< min(p).value()<< endl;rho==max(rho0+psi *p, rhoMin);# 1 "/home/ubuntu/OpenFOAM-9/applications/solvers/multiphase/cavitatingFoam/alphavPsi.H" 1{ alphav=max(min((rho - rholSat)/(rhovSat - rholSat), scalar(1)), scalar(0));alphal=1.0 - alphav;Info<< "max-min alphav: "<< max(alphav).value()<< " "<< min(alphav).value()<< endl;psiModel-> correct()
scalar deltaTValue() const
Return time step value.
virtual bool coupled() const
Return true if this patch field is coupled.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Internal::FieldType & primitiveFieldRef()
Return a reference to the internal field.
const Mesh & mesh() const
Return mesh.
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
const labelUList & owner() const
Internal face owner.
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)
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.
Mesh data needed to do the Finite Volume discretisation.
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 correctBoundaryConditions()
Correct boundary field.
const volScalarField & psi
A class for managing temporary objects.
Specialisation of GeometricField which holds slices of given complete fields in a form that they act ...
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...
CMULES: Multidimensional universal limiter for explicit corrected implicit solution.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.