pEqn.H
Go to the documentation of this file.
1 {
2  rAU = 1.0/UEqn.A();
3  //mesh.interpolate(rAU);
4 
5  surfaceScalarField faceMask(localMin<scalar>(mesh).interpolate(cellMask));
6 
8 
9  volVectorField H("H", UEqn.H());
10 
11  volVectorField HbyA("HbyA", U);
12  //HbyA = rAU*UEqn.H();
14 
16  {
17  #include "interpolatedFaces.H"
18  }
19 
21 
22  if (ddtCorr)
23  {
24  surfaceScalarField faceMaskOld
25  (
26  localMin<scalar>(mesh).interpolate(cellMask.oldTime())
27  );
28  phiHbyA +=
29  fvc::interpolate(rho*rAU)*faceMaskOld*fvc::ddtCorr(U, Uf);
30  }
31  MRF.makeRelative(phiHbyA);
32 
33  if (p_rgh.needReference())
34  {
38  }
39 
41  {
45  }
46 
48  (
49  (
50  mixture.surfaceTensionForce()
52  )*faceMask*rAUf*mesh.magSf()
53  );
54 
56 
57  if (adjustFringe)
58  {
62  }
63 
64  // Update the pressure BCs to ensure flux consistency
66 
67  while (pimple.correctNonOrthogonal())
68  {
69  fvScalarMatrix p_rghEqn
70  (
72  );
73 
74  p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
75 
76  p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));
77 
78  if (pimple.finalNonOrthogonalIter())
79  {
80  phi = phiHbyA - p_rghEqn.flux();
81 
82  p_rgh.relax();
83 
84  U =
85  cellMask*
86  (
87  HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/rAUf)
88  );
89 
90  U.correctBoundaryConditions();
91  fvOptions.correct(U);
92  }
93  }
94 
95  #include "continuityErrs.H"
96 
97  {
99  surfaceVectorField n(mesh.Sf()/mesh.magSf());
100  Uf += n*(phi/mesh.magSf() - (n & Uf));
101  }
102 
103  // Make the fluxes relative to the mesh motion
105 
106  // Zero faces H-I for transport Eq after pEq
107  phi *= faceMask;
108 
109  p == p_rgh + rho*gh;
110 
111  if (p_rgh.needReference())
112  {
114  (
115  "p_rgh",
116  p.dimensions(),
118  );
119  p == p_rgh + rho*gh;
120  }
121 }
Foam::fvc::reconstruct
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> reconstruct(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcReconstruct.C:56
Foam::constrainHbyA
tmp< volVectorField > constrainHbyA(const tmp< volVectorField > &tHbyA, const volVectorField &U, const volScalarField &p)
Definition: constrainHbyA.C:35
Foam::fvc::snGrad
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > snGrad(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvcSnGrad.C:47
Foam::fvc::flux
tmp< surfaceScalarField > flux(const volVectorField &vvf)
Return the face-flux field obtained from the given volVectorField.
ghf
const surfaceScalarField & ghf
Definition: setRegionFluidFields.H:18
phiHbyA
phiHbyA
Definition: pEqn.H:20
interpolatedFaces.H
faceMask
surfaceScalarField faceMask(localMin< scalar >(mesh).interpolate(cellMask))
gh
const volScalarField & gh
Definition: setRegionFluidFields.H:17
Foam::fac::div
tmp< GeometricField< Type, faPatchField, areaMesh > > div(const GeometricField< Type, faePatchField, edgeMesh > &ssf)
Definition: facDiv.C:50
continuityErrs.H
Calculates and prints the continuity errors.
MRF
IOMRFZoneList & MRF
Definition: setRegionFluidFields.H:22
pimple
pimpleControl & pimple
Definition: setRegionFluidFields.H:56
HbyA
HbyA
Definition: pEqn.H:4
Foam::fvScalarMatrix
fvMatrix< scalar > fvScalarMatrix
Definition: fvMatricesFwd.H:44
fvOptions
fv::options & fvOptions
Definition: setRegionFluidFields.H:23
Foam::dimensionedScalar
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Definition: dimensionedScalarFwd.H:42
makeRelative
MRF makeRelative(fvc::interpolate(rho), phiHbyA)
ddtCorr
ddtCorr
Definition: readControls.H:9
massFluxInterpolation
massFluxInterpolation
Definition: readControls.H:7
p
p
Definition: pEqn.H:50
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
rAU
volScalarField rAU(1.0/UEqn.A())
Foam::volVectorField
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:62
H
volVectorField H("H", UEqn.H())
U
U
Definition: pEqn.H:72
Foam::oversetAdjustPhi
bool oversetAdjustPhi(surfaceScalarField &phi, const volVectorField &U)
Adjust the balance of fluxes to obey continuity.
Definition: oversetAdjustPhi.C:38
phig
surfaceScalarField phig("phig", -rhorAUf *ghf *fvc::snGrad(rho) *mesh.magSf())
Foam::getRefCellValue
scalar getRefCellValue(const volScalarField &field, const label refCelli)
Return the current value of field in the reference cell.
Definition: findRefCell.C:134
adjustFringe
adjustFringe
Definition: readControls.H:16
Foam::surfaceScalarField
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Definition: surfaceFieldsFwd.H:54
phi
phi
Definition: pEqn.H:18
UEqn
fvVectorMatrix & UEqn
Definition: UEqn.H:13
Uf
Uf
Definition: pEqn.H:107
p_rgh
p_rgh
Definition: pEqn.H:139
Foam::fac::laplacian
tmp< GeometricField< Type, faPatchField, areaMesh > > laplacian(const GeometricField< Type, faPatchField, areaMesh > &vf, const word &name)
Definition: facLaplacian.C:47
Foam::fvc::makeAbsolute
void makeAbsolute(surfaceScalarField &phi, const volVectorField &U)
Make the given flux absolute.
Definition: fvcMeshPhi.C:116
Foam::surfaceVectorField
GeometricField< vector, fvsPatchField, surfaceMesh > surfaceVectorField
Definition: surfaceFieldsFwd.H:59
adjustPhi
adjustPhi(phiHbyA, U, p_rgh)
rho
rho
Definition: pEqn.H:1
mixture
Info<< "Creating temperaturePhaseChangeTwoPhaseMixture\n"<< endl;autoPtr< temperaturePhaseChangeTwoPhaseMixture > mixture
Definition: createFields.H:39
interpolate
mesh interpolate(rAU)
n
surfaceVectorField n(mesh.Sf()/mesh.magSf())
pRefCell
const label pRefCell
Definition: setRegionFluidFields.H:36
constrainPressure
constrainPressure(p_rgh, rho, U, phiHbyA, rhorAUf, MRF)
rAUf
surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU))
pRefValue
const scalar pRefValue
Definition: setRegionFluidFields.H:37