pEqn.H
Go to the documentation of this file.
1 {
2  if (correctPhi)
3  {
4  rAU.ref() = 1.0/UEqn.A();
5  }
6  else
7  {
8  rAU = 1.0/UEqn.A();
9  }
10 
12 
13  volVectorField HbyA("HbyA", U);
14  HbyA = rAU()*UEqn.H();
15 
17  (
18  "phiHbyA",
19  (fvc::interpolate(HbyA) & mesh.Sf())
21  );
22 
23  if (p_rgh.needReference())
24  {
28  }
29 
31  (
32  (
33  fluid.surfaceTensionForce()
35  )*rAUf*mesh.magSf()
36  );
37 
39 
40  // Update the fixedFluxPressure BCs to ensure flux consistency
42 
43  while (pimple.correctNonOrthogonal())
44  {
45 
46  fvScalarMatrix p_rghEqn
47  (
50  );
51 
52  if (fluid.includeVolChange())
53  {
54  p_rghEqn += fluid.volTransfer(p_rgh);
55  }
56 
57  p_rghEqn.setReference(pRefCell, pRefValue);
58 
59  p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));
60 
61  if (pimple.finalNonOrthogonalIter())
62  {
63  phi = phiHbyA + p_rghEqn.flux();
64 
65  p_rgh.relax();
66 
67  U = HbyA + rAU()*fvc::reconstruct((phig + p_rghEqn.flux())/rAUf);
68 
69  U.correctBoundaryConditions();
70  fvOptions.correct(U);
71  K = 0.5*magSqr(U);
72  }
73  }
74 
75  #include "continuityErrs.H"
76 
77  // Correct Uf if the mesh is moving
79 
80  // Make the fluxes relative to the mesh motion
82 
83  p == p_rgh + rho*gh;
84 
85  if (p_rgh.needReference())
86  {
88  (
89  "p",
90  p.dimensions(),
92  );
93  p_rgh = p - rho*gh;
94  }
95 
96  if (!correctPhi)
97  {
98  rAU.clear();
99  }
100 }
Foam::fvc::reconstruct
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> reconstruct(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcReconstruct.C:56
Foam::fvc::snGrad
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > snGrad(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvcSnGrad.C:47
ghf
const surfaceScalarField & ghf
Definition: setRegionFluidFields.H:18
phiHbyA
phiHbyA
Definition: pEqn.H:20
fluid
twoPhaseSystem & fluid
Definition: setRegionFluidFields.H:3
correctPhi
correctPhi
Definition: readDyMControls.H:3
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
Foam::magSqr
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
K
CGAL::Exact_predicates_exact_constructions_kernel K
Definition: CGALTriangulation3DKernel.H:58
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::fvc::correctUf
void correctUf(autoPtr< surfaceVectorField > &Uf, const volVectorField &U, const surfaceScalarField &phi)
Definition: fvcMeshPhi.C:225
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
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
adjustPhi
adjustPhi(phiHbyA, U, p_rgh)
rho
rho
Definition: pEqn.H:1
interpolate
mesh interpolate(rAU)
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