MCPcopy Create free account
hub / github.com/OpenFOAM/OpenFOAM-dev / limit

Function limit

src/finiteVolume/fvMatrices/solvers/MULES/MULESTemplates.C:520–595  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

518
519template<class RdeltaTType, class RhoType, class SpType, class SuType>
520void Foam::MULES::limit
521(
522 const RdeltaTType& rDeltaT,
523 const RhoType& rho,
524 const volScalarField& psi,
525 const surfaceScalarField& phi,
526 surfaceScalarField& phiPsi,
527 const SpType& Sp,
528 const SuType& Su,
529 const scalar psiMax,
530 const scalar psiMin,
531 const bool returnCorr
532)
533{
534 const fvMesh& mesh = psi.mesh();
535
536 surfaceScalarField phiBD(upwind<scalar>(psi.mesh(), phi).flux(psi));
537
538 surfaceScalarField::Boundary& phiBDBf = phiBD.boundaryFieldRef();
539 const surfaceScalarField::Boundary& phiPsiBf = phiPsi.boundaryField();
540
541 forAll(phiBDBf, patchi)
542 {
543 fvsPatchScalarField& phiBDPf = phiBDBf[patchi];
544
545 if (!phiBDPf.coupled())
546 {
547 phiBDPf = phiPsiBf[patchi];
548 }
549 }
550
551 surfaceScalarField& phiCorr = phiPsi;
552 phiCorr -= phiBD;
553
554 scalarField allLambda(mesh.nFaces(), 1.0);
555
556 slicedSurfaceScalarField lambda
557 (
558 IOobject
559 (
560 "lambda",
561 mesh.time().timeName(),
562 mesh,
563 IOobject::NO_READ,
564 IOobject::NO_WRITE,
565 false
566 ),
567 mesh,
568 dimless,
569 allLambda,
570 false // Use slices for the couples
571 );
572
573 limiter
574 (
575 allLambda,
576 rDeltaT,
577 rho,

Callers 1

MULESTemplates.CFile · 0.70

Calls 5

fluxClass · 0.85
limiterFunction · 0.85
forAllFunction · 0.50
boundaryFieldMethod · 0.45
coupledMethod · 0.45

Tested by

no test coverage detected