pEqn.H
Go to the documentation of this file.
1 {
2  rAU = 1.0/UEqn.A();
4 
5  volVectorField HbyA("HbyA", U);
6  HbyA = rAU*UEqn.H();
7 
9  (
10  "phiHbyA",
11  (fvc::interpolate(HbyA) & mesh.Sf())
13  );
14 
15  if (p_rgh.needReference())
16  {
20  }
21 
23  (
24  (
25  interface.surfaceTensionForce()
27  )*rAUf*mesh.magSf()
28  );
29 
31 
32  // Update the fixedFluxPressure BCs to ensure flux consistency
34  (
35  p_rgh.boundaryField(),
36  (
37  phiHbyA.boundaryField()
38  - (mesh.Sf().boundaryField() & U.boundaryField())
39  )/(mesh.magSf().boundaryField()*rAUf.boundaryField())
40  );
41 
42  Pair<tmp<volScalarField> > vDotP = mixture->vDotP();
43  const volScalarField& vDotcP = vDotP[0]();
44  const volScalarField& vDotvP = vDotP[1]();
45 
46  while (pimple.correctNonOrthogonal())
47  {
48  fvScalarMatrix p_rghEqn
49  (
51  - (vDotvP - vDotcP)*(pSat - rho*gh) + fvm::Sp(vDotvP - vDotcP, p_rgh)
52  );
53 
54  p_rghEqn.setReference(pRefCell, pRefValue);
55 
56  p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));
57 
58  if (pimple.finalNonOrthogonalIter())
59  {
60  phi = phiHbyA + p_rghEqn.flux();
61 
62  U = HbyA + rAU*fvc::reconstruct((phig + p_rghEqn.flux())/rAUf);
63  U.correctBoundaryConditions();
64  fvOptions.correct(U);
65  }
66  }
67 
68  {
70  surfaceVectorField n(mesh.Sf()/mesh.magSf());
71  Uf += n*(phi/mesh.magSf() - (n & Uf));
72  }
73 
74  // Make the fluxes relative to the mesh motion
76 
77  p == p_rgh + rho*gh;
78 
79  if (p_rgh.needReference())
80  {
82  (
83  "p",
84  p.dimensions(),
86  );
87  p_rgh = p - rho*gh;
88  }
89 }
Foam::fvc::reconstruct
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> reconstruct(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcReconstruct.C:54
pRefCell
const label pRefCell
Definition: setRegionFluidFields.H:27
Foam::fvc::snGrad
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > snGrad(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvcSnGrad.C:45
p
p
Definition: pEqn.H:62
ghf
const surfaceScalarField & ghf
Definition: setRegionFluidFields.H:35
phig
surfaceScalarField phig(-rAUf *ghf *fvc::snGrad(rhok) *mesh.magSf())
Foam::MULES::interpolate
tmp< surfaceScalarField > interpolate(const RhoType &rho)
Definition: IMULESTemplates.C:40
Foam::fvc::div
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcDiv.C:47
setSnGrad< fixedFluxPressureFvPatchScalarField >
setSnGrad< fixedFluxPressureFvPatchScalarField >(p_rgh.boundaryField(),(phiHbyA.boundaryField() - MRF.relative(mesh.Sf().boundaryField() &U.boundaryField()))/(mesh.magSf().boundaryField() *rAUf.boundaryField()))
phi
phi
Definition: pEqn.H:20
mixture
Info<< "Reading field p_rgh\n"<< endl;volScalarField p_rgh(IOobject("p_rgh", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);Info<< "Reading field U\n"<< endl;volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);Info<< "Creating phaseChangeTwoPhaseMixture\n"<< endl;autoPtr< phaseChangeTwoPhaseMixture > mixture
Definition: createFields.H:33
U
U
Definition: pEqn.H:46
interface
interfaceProperties interface(alpha1, U, mixture())
Foam::fvc::laplacian
tmp< GeometricField< Type, fvPatchField, volMesh > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvcLaplacian.C:45
vDotvP
const volScalarField & vDotvP
Definition: pEqn.H:44
vDotP
Pair< tmp< volScalarField > > vDotP
Definition: pEqn.H:42
Foam::fvScalarMatrix
fvMatrix< scalar > fvScalarMatrix
Definition: fvMatricesFwd.H:42
Foam::fvc::ddtCorr
tmp< GeometricField< typename flux< Type >::type, fvsPatchField, surfaceMesh > > ddtCorr(const GeometricField< Type, fvPatchField, volMesh > &U, const GeometricField< Type, fvsPatchField, surfaceMesh > &Uf)
Definition: fvcDdt.C:155
UEqn
tmp< fvVectorMatrix > UEqn(fvm::div(phi, U)+MRF.DDt(U)+turbulence->divDevReff(U)==fvOptions(U))
Foam::dimensionedScalar
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Definition: dimensionedScalarFwd.H:41
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
n
surfaceVectorField n(mesh.Sf()/mesh.magSf())
pSat
const dimensionedScalar & pSat
Definition: createFields.H:41
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
gh
const volScalarField & gh
Definition: setRegionFluidFields.H:34
vDotcP
const volScalarField & vDotcP
Definition: pEqn.H:43
rho
rho
Definition: pEqn.H:3
Foam::volVectorField
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:55
rAU
volScalarField rAU("rAU", 1.0/UEqn().A())
adjustPhi
adjustPhi(phiHbyA, U, p)
Foam::getRefCellValue
scalar getRefCellValue(const volScalarField &field, const label refCelli)
Return the current value of field in the reference cell.
Definition: findRefCell.C:130
HbyA
HbyA
Definition: pEqn.H:4
makeRelative
MRF makeRelative(phiHbyA)
Foam::surfaceScalarField
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Definition: surfaceFieldsFwd.H:52
pimple
const dictionary & pimple
Definition: readFluidMultiRegionPIMPLEControls.H:1
phiHbyA
phiHbyA
Definition: pEqn.H:21
Foam::fvc::Sp
tmp< GeometricField< Type, fvPatchField, volMesh > > Sp(const volScalarField &sp, const GeometricField< Type, fvPatchField, volMesh > &vf)
Definition: fvcSup.C:67
Foam::fvc::makeAbsolute
void makeAbsolute(surfaceScalarField &phi, const volVectorField &U)
Make the given flux absolute.
Definition: fvcMeshPhi.C:113
Foam::surfaceVectorField
GeometricField< vector, fvsPatchField, surfaceMesh > surfaceVectorField
Definition: surfaceFieldsFwd.H:55
Uf
Uf
Definition: pEqn.H:78
pRefValue
const scalar pRefValue
Definition: setRegionFluidFields.H:28
p_rgh
volScalarField & p_rgh
Definition: setRegionFluidFields.H:31
fvOptions
fv::options & fvOptions
Definition: setRegionFluidFields.H:16
rAUf
surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU))