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 
19  fvc::makeRelative(phi, U);
20 
22 
23  phi -= phiGradp/rhof;
24 
26 
27  while (pimple.correctNonOrthogonal())
28  {
29  fvScalarMatrix pEqn
30  (
31  fvc::ddt(rho)
33  + fvc::div(phi, rho)
36  );
37 
38  pEqn.solve();
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(rho0 + psi*p, rhoMin);
50 
51  #include "alphavPsi.H"
52 
53  p =
54  (
55  rho
56  - alphal*rhol0
57  - ((alphav*psiv + alphal*psil) - psi)*pSat
58  )/psi;
59 
60  p.correctBoundaryConditions();
61 
62  Info<< "Phase-change corrected p max-min : " << max(p).value()
63  << " " << min(p).value() << endl;
64 
65  // Correct velocity
66 
67  U = HbyA - rAU*fvc::grad(p);
68 
69  // Remove the swirl component of velocity for "wedge" cases
70  if (pimple.dict().found("removeSwirl"))
71  {
72  label swirlCmpt(pimple.dict().lookup<label>("removeSwirl"));
73 
74  Info<< "Removing swirl component-" << swirlCmpt << " of U" << endl;
75  U.field().replace(swirlCmpt, 0.0);
76  }
77 
78  U.correctBoundaryConditions();
79 
80  Info<< "max(U) " << max(mag(U)).value() << endl;
81 
82  // Correct Uf if the mesh is moving
83  fvc::correctUf(Uf, U, phi);
84 }
tmp< fvMatrix< Type > > correction(const fvMatrix< Type > &)
Return the correction form of the given matrix.
rAU
Definition: pEqn.H:1
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
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
rho
Definition: pEqn.H:1
pimpleNoLoopControl & pimple
p
Definition: pEqn.H:50
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcDiv.C:47
tmp< GeometricField< typename flux< Type >::type, fvsPatchField, surfaceMesh > > ddtCorr(const GeometricField< Type, fvPatchField, volMesh > &U, const GeometricField< Type, fvsPatchField, surfaceMesh > &Uf)
Definition: fvcDdt.C:170
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
surfaceScalarField phiGradp(rhorAUf *mesh.magSf() *fvc::snGrad(p))
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:58
tmp< GeometricField< Type, fvPatchField, volMesh > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvcLaplacian.C:45
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:57
dynamicFvMesh & mesh
alphal
Definition: alphavPsi.H:12
void correctUf(autoPtr< surfaceVectorField > &Uf, const volVectorField &U, const surfaceScalarField &phi)
Definition: fvcMeshPhi.C:223
tmp< volVectorField > constrainHbyA(const tmp< volVectorField > &tHbyA, const volVectorField &U, const volScalarField &p)
Definition: constrainHbyA.C:34
autoPtr< surfaceVectorField > Uf
volScalarField rho0(rho - psi *p)
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
static tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > interpolate(const GeometricField< Type, fvPatchField, volMesh > &tvf, const surfaceScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.
U
Definition: pEqn.H:72
volVectorField & HbyA
Definition: pEqn.H:13
fvVectorMatrix & UEqn
Definition: UEqn.H:11
surfaceScalarField rhof(fvc::interpolate(rho, "div(phi,rho)"))
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
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho *rAU))
MRF makeRelative(fvc::interpolate(rho), phiHbyA)
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > snGrad(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvcSnGrad.C:45