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
241 const surfaceScalarField::Boundary& phiBf =
245 const surfaceScalarField::Boundary& phiCorrBf =
266 surfaceScalarField::Boundary& lambdaBf =
280 const label own = owner[facei];
281 const label nei = neighb[facei];
283 psiMaxn[own] =
max(psiMaxn[own], psiIf[nei]);
284 psiMinn[own] =
min(psiMinn[own], psiIf[nei]);
286 psiMaxn[nei] =
max(psiMaxn[nei], psiIf[own]);
287 psiMinn[nei] =
min(psiMinn[nei], psiIf[own]);
289 const scalar phiCorrf = phiCorrIf[facei];
293 sumPhip[own] += phiCorrf;
294 mSumPhim[nei] += phiCorrf;
298 mSumPhim[own] -= phiCorrf;
299 sumPhip[nei] -= phiCorrf;
316 label pfCelli = pFaceCells[pFacei];
318 psiMaxn[pfCelli] =
max(psiMaxn[pfCelli], psiPNf[pFacei]);
319 psiMinn[pfCelli] =
min(psiMinn[pfCelli], psiPNf[pFacei]);
326 const label pfCelli = pFaceCells[pFacei];
328 psiMaxn[pfCelli] =
max(psiMaxn[pfCelli], psiPf[pFacei]);
329 psiMinn[pfCelli] =
min(psiMinn[pfCelli], psiPf[pFacei]);
336 const label pfCelli = pFaceCells[pFacei];
338 psiMaxn[pfCelli] =
max(psiMaxn[pfCelli], psiMax[pfCelli]);
339 psiMinn[pfCelli] =
min(psiMinn[pfCelli], psiMin[pfCelli]);
345 const label pfCelli = pFaceCells[pFacei];
347 const scalar phiCorrf = phiCorrPf[pFacei];
351 sumPhip[pfCelli] += phiCorrf;
355 mSumPhim[pfCelli] -= phiCorrf;
360 psiMaxn =
min(psiMaxn + extremaCoeff*(psiMax - psiMin), psiMax);
361 psiMinn =
max(psiMinn - extremaCoeff*(psiMax - psiMin), psiMin);
363 if (smoothLimiter > small)
366 min(smoothLimiter*psiIf + (1.0 - smoothLimiter)*psiMaxn, psiMax);
368 max(smoothLimiter*psiIf + (1.0 - smoothLimiter)*psiMinn, psiMin);
374 (rho.field()*rDeltaT - Sp.field())*psiMaxn
383 - (rho.field()*rDeltaT - Sp.field())*psiMinn
390 for (
int j=0; j<nLimiterIter; j++)
397 const label own = owner[facei];
398 const label nei = neighb[facei];
400 const scalar lambdaPhiCorrf = lambdaIf[facei]*phiCorrIf[facei];
402 if (lambdaPhiCorrf > 0)
404 sumlPhip[own] += lambdaPhiCorrf;
405 mSumlPhim[nei] += lambdaPhiCorrf;
409 mSumlPhim[own] -= lambdaPhiCorrf;
410 sumlPhip[nei] -= lambdaPhiCorrf;
423 label pfCelli = pFaceCells[pFacei];
425 scalar lambdaPhiCorrf = lambdaPf[pFacei]*phiCorrfPf[pFacei];
427 if (lambdaPhiCorrf > 0)
429 sumlPhip[pfCelli] += lambdaPhiCorrf;
433 mSumlPhim[pfCelli] -= lambdaPhiCorrf;
443 (sumlPhip[celli] + psiMaxn[celli])
444 /(mSumPhim[celli] + rootVSmall),
451 (mSumlPhim[celli] + psiMinn[celli])
452 /(sumPhip[celli] + rootVSmall),
462 if (phiCorrIf[facei] > 0)
464 lambdaIf[facei] =
min 467 min(lambdap[owner[facei]], lambdam[neighb[facei]])
472 lambdaIf[facei] =
min 475 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]);
521 if ((phiPf[pFacei] + phiCorrfPf[pFacei]) > small*small)
523 const label pfCelli = pFaceCells[pFacei];
525 if (phiCorrfPf[pFacei] > 0)
528 min(lambdaPf[pFacei], lambdap[pfCelli]);
533 min(lambdaPf[pFacei], lambdam[pfCelli]);
556 const RdeltaTType& rDeltaT,
563 const PsiMaxType& psiMax,
564 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.
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 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.
scalar deltaTValue() const
Return time step value.
virtual bool coupled() const
Return true if this patch field is coupled.
label readLabel(Istream &is)
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.
Info<< "Predicted p max-min : "<< max(p).value()<< " "<< min(p).value()<< endl;rho==max(psi *p+alphal *rhol0+((alphav *psiv+alphal *psil) - psi) *pSat, rhoMin);# 1 "/home/ubuntu/OpenFOAM-6/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()
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)
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.
Mesh data needed to do the Finite Volume discretisation.
dimensionedScalar lambda(laminarTransport.lookup("lambda"))
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.
Specialization 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.