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