pEqn.H
Go to the documentation of this file.
1 {
2  rAU = 1.0/UEqn.A();
6  (
7  "phiHbyA",
9  );
10 
11 
12  if (ddtCorr)
13  {
14  surfaceScalarField faceMaskOld
15  (
16  localMin<scalar>(mesh).interpolate(cellMask.oldTime())
17  );
18  phiHbyA += faceMaskOld*fvc::ddtCorr(U, Uf);
19  }
20 
21  if (p_rgh.needReference())
22  {
26  }
27 
29  (
30  (
31  interface.surfaceTensionForce()
33  )*faceMask*rAUf*mesh.magSf()
34  );
35 
37 
38  // Update the pressure BCs to ensure flux consistency
40 
41  Pair<tmp<volScalarField>> vDotP = mixture->vDotP();
42  const volScalarField& vDotcP = vDotP[0]();
43  const volScalarField& vDotvP = vDotP[1]();
44 
45  while (pimple.correctNonOrthogonal())
46  {
47  fvScalarMatrix p_rghEqn
48  (
50  - (vDotvP - vDotcP)*(mixture->pSat() - rho*gh)
52  );
53 
54 
55  //p_rghEqn.setReference(pRefCell, pRefValue);
56  p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
57 
58  p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));
59 
60  if (pimple.finalNonOrthogonalIter())
61  {
62  phi = phiHbyA + p_rghEqn.flux();
63 
64  p_rgh.relax();
65 
66  U =
67  cellMask
68  *(HbyA + rAU*fvc::reconstruct((phig + p_rghEqn.flux())/rAUf));
69 
70  U.correctBoundaryConditions();
71  fvOptions.correct(U);
72  }
73  }
74 
75  #include "continuityErrs.H"
76 
77  {
79  surfaceVectorField n(mesh.Sf()/mesh.magSf());
80  Uf += n*(phi/mesh.magSf() - (n & Uf));
81  }
82 
83  // Make the fluxes relative to the mesh motion
85 
86  // Zero faces H-I for transport Eq after pEq
87  phi *= faceMask;
88 
89  p == p_rgh + rho*gh;
90 
91  if (p_rgh.needReference())
92  {
94  (
95  "p",
96  p.dimensions(),
98  );
99  p_rgh = p - rho*gh;
100  }
101 }
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
vDotcP
const volScalarField & vDotcP
Definition: pEqn.H:33
vDotvP
const volScalarField & vDotvP
Definition: pEqn.H:34
interface
interfaceProperties interface(alpha1, U, thermo->transportPropertiesDict())
phiHbyA
phiHbyA
Definition: pEqn.H:20
Sp
zeroField Sp
Definition: alphaSuSp.H:2
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
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
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:57
makeRelative
MRF makeRelative(fvc::interpolate(rho), phiHbyA)
ddtCorr
ddtCorr
Definition: readControls.H:9
vDotP
Pair< tmp< volScalarField > > vDotP
Definition: pEqn.H:32
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
U
U
Definition: pEqn.H:72
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
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