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());
16 
17  volVectorField HbyA("HbyA", U);
18  HbyA = rAU*UEqn.H();
19 
20  phi = (fvc::interpolate(HbyA) & mesh.Sf())
21  + rhorAUf*fvc::ddtCorr(U, phi);
22 
24 
25  phi -= phiGradp/rhof;
26 
27  while (pimple.correctNonOrthogonal())
28  {
29  fvScalarMatrix pEqn
30  (
31  fvm::ddt(psi, p)
32  - (rhol0 + (psil - psiv)*pSat)*fvc::ddt(alphav) - pSat*fvc::ddt(psi)
33  + fvc::div(phi, rho)
36  );
37 
38  pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
39 
40  if (pimple.finalNonOrthogonalIter())
41  {
42  phi += (phiGradp + pEqn.flux())/rhof;
43  }
44  }
45 
46  Info<< "Predicted p max-min : " << max(p).value()
47  << " " << min(p).value() << endl;
48 
49  rho == max
50  (
51  psi*p
52  + alphal*rhol0
53  + ((alphav*psiv + alphal*psil) - psi)*pSat,
54  rhoMin
55  );
56 
57  #include "alphavPsi.H"
58 
59  p =
60  (
61  rho
62  - alphal*rhol0
63  - ((alphav*psiv + alphal*psil) - psi)*pSat
64  )/psi;
65 
66  p.correctBoundaryConditions();
67 
68  Info<< "Phase-change corrected p max-min : " << max(p).value()
69  << " " << min(p).value() << endl;
70 
71  // Correct velocity
72 
73  U = HbyA - rAU*fvc::grad(p);
74 
75  // Remove the swirl component of velocity for "wedge" cases
76  if (pimple.dict().found("removeSwirl"))
77  {
78  label swirlCmpt(readLabel(pimple.dict().lookup("removeSwirl")));
79 
80  Info<< "Removing swirl component-" << swirlCmpt << " of U" << endl;
81  U.field().replace(swirlCmpt, 0.0);
82  }
83 
84  U.correctBoundaryConditions();
85 
86  Info<< "max(U) " << max(mag(U)).value() << endl;
87 }
dimensioned< scalar > mag(const dimensioned< Type > &)
const dimensionedScalar & pSat
Definition: createFields.H:41
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
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
tmp< GeometricField< Type, fvPatchField, volMesh > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvcLaplacian.C:45
messageStream Info
tmp< surfaceScalarField > interpolate(const RhoType &rho)
tmp< GeometricField< Type, fvPatchField, volMesh > > ddt(const dimensioned< Type > dt, const fvMesh &mesh)
Definition: fvcDdt.C:45
dynamicFvMesh & mesh
const dictionary & pimple
p
Definition: pEqn.H:59
label readLabel(Istream &is)
Definition: label.H:64
fvMatrix< scalar > fvScalarMatrix
Definition: fvMatricesFwd.H:42
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
alphal
Definition: alphavPsi.H:12
fvVectorMatrix UEqn(fvm::ddt(rho, U)+fvm::div(phi, U)+turbulence->divDevRhoReff(U)==fvOptions(rho, U))
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho *rAU))
const volScalarField & psi
Definition: createFields.H:24
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > snGrad(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvcSnGrad.C:45
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:55
volScalarField rAU(1.0/UEqn.A())
PtrList< dimensionedScalar > rhoMin(fluidRegions.size())
surfaceScalarField rhof(fvc::interpolate(rho,"div(phi,rho)"))
surfaceScalarField phiGradp(rhorAUf *mesh.magSf()*fvc::snGrad(p))
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcDiv.C:47
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcGrad.C:52
rho
Definition: pEqn.H:1
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
U
Definition: pEqn.H:82
HbyA
Definition: pEqn.H:7