pEqn.H
Go to the documentation of this file.
1 {
2  if (pimple.nCorrPIMPLE() == 1)
3  {
4  p =
5  (
6  rho
7  - alphal*rhol0
8  - ((alphav*psiv + alphal*psil) - psi)*pSat
9  )/psi;
10  }
11 
13 
14  volScalarField rAU(1.0/UEqn.A());
17 
21 
23 
24  phi -= phiGradp/rhof;
25 
27 
28  while (pimple.correctNonOrthogonal())
29  {
30  fvScalarMatrix pEqn
31  (
32  fvc::ddt(rho)
34  + fvc::div(phi, rho)
37  );
38 
39  pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
40 
41  if (pimple.finalNonOrthogonalIter())
42  {
43  phi += (phiGradp + pEqn.flux())/rhof;
44  }
45  }
46 
47  Info<< "Predicted p max-min : " << max(p).value()
48  << " " << min(p).value() << endl;
49 
50  rho == max(rho0 + psi*p, rhoMin);
51 
52  #include "alphavPsi.H"
53 
54  p =
55  (
56  rho
57  - alphal*rhol0
58  - ((alphav*psiv + alphal*psil) - psi)*pSat
59  )/psi;
60 
61  p.correctBoundaryConditions();
62 
63  Info<< "Phase-change corrected p max-min : " << max(p).value()
64  << " " << min(p).value() << endl;
65 
66  // Correct velocity
67 
68  U = HbyA - rAU*fvc::grad(p);
69 
70  // Remove the swirl component of velocity for "wedge" cases
71  if (pimple.dict().found("removeSwirl"))
72  {
73  label swirlCmpt(pimple.dict().get<label>("removeSwirl"));
74 
75  Info<< "Removing swirl component-" << swirlCmpt << " of U" << endl;
76  U.field().replace(swirlCmpt, Zero);
77  }
78 
79  U.correctBoundaryConditions();
80 
81  Info<< "max(U) " << max(mag(U)).value() << endl;
82 
83  {
85  surfaceVectorField n(mesh.Sf()/mesh.magSf());
86  Uf += n*(phi/mesh.magSf() - (n & Uf));
87  }
88 }
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.
Foam::Zero
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:131
Foam::fac::grad
tmp< GeometricField< typename outerProduct< vector, Type >::type, faPatchField, areaMesh >> grad(const GeometricField< Type, faePatchField, edgeMesh > &ssf)
Definition: facGrad.C:56
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:369
Foam::correction
tmp< fvMatrix< Type > > correction(const fvMatrix< Type > &)
rho0
volScalarField rho0(rho - psi *p)
phiGradp
surfaceScalarField phiGradp(rhorAUf *mesh.magSf() *fvc::snGrad(p))
Foam::fac::div
tmp< GeometricField< Type, faPatchField, areaMesh > > div(const GeometricField< Type, faePatchField, edgeMesh > &ssf)
Definition: facDiv.C:50
Foam::min
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:33
alphavPsi.H
pimple
pimpleControl & pimple
Definition: setRegionFluidFields.H:56
HbyA
HbyA
Definition: pEqn.H:4
Foam::fvScalarMatrix
fvMatrix< scalar > fvScalarMatrix
Definition: fvMatricesFwd.H:44
Foam::Info
messageStream Info
Information stream (stdout output on master, null elsewhere)
rhorAUf
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho *rAU))
rhoMin
const dimensionedScalar rhoMin
Definition: setRegionFluidFields.H:67
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:57
makeRelative
MRF makeRelative(fvc::interpolate(rho), phiHbyA)
ddtCorr
ddtCorr
Definition: readControls.H:9
Foam::max
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:47
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
Foam::surfaceScalarField
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Definition: surfaceFieldsFwd.H:54
Foam::mag
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Foam::fac::ddt
tmp< GeometricField< Type, faPatchField, areaMesh > > ddt(const dimensioned< Type > dt, const faMesh &mesh)
Definition: facDdt.C:47
phi
phi
Definition: pEqn.H:18
alphal
alphal
Definition: alphavPsi.H:12
UEqn
fvVectorMatrix & UEqn
Definition: UEqn.H:13
Uf
Uf
Definition: pEqn.H:107
Foam::fac::laplacian
tmp< GeometricField< Type, faPatchField, areaMesh > > laplacian(const GeometricField< Type, faPatchField, areaMesh > &vf, const word &name)
Definition: facLaplacian.C:47
Foam::surfaceVectorField
GeometricField< vector, fvsPatchField, surfaceMesh > surfaceVectorField
Definition: surfaceFieldsFwd.H:59
rhof
surfaceScalarField rhof(fvc::interpolate(rho, "div(phi,rho)"))
psi
const volScalarField & psi
Definition: createFieldRefs.H:1
rho
rho
Definition: pEqn.H:1
interpolate
mesh interpolate(rAU)
n
surfaceVectorField n(mesh.Sf()/mesh.magSf())