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
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
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
FvWallInfoData< WallInfo, label > label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
pimpleNoLoopControl & pimple
U
Definition: pEqn.H:72
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho *rAU))
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
MRF makeRelative(fvc::interpolate(rho), phiHbyA)
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:59
fvMesh & mesh
tmp< GeometricField< Type, fvPatchField, volMesh > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvcLaplacian.C:45
p
Definition: pEqn.H:125
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:58
alphal
Definition: alphavPsi.H:12
const volScalarField & psi
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
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)
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.
tmp< surfaceScalarField > absolute(const tmp< surfaceScalarField > &tphi, const volVectorField &U)
Return the given relative flux in absolute form.
Definition: fvcMeshPhi.C:202
volVectorField & HbyA
Definition: pEqn.H:13
surfaceScalarField rhof(fvc::interpolate(rho, "div(phi,rho)"))
void correctUf(autoPtr< surfaceVectorField > &Uf, const volVectorField &U, const surfaceScalarField &phi, const MRFType &MRF)
messageStream Info
dimensioned< scalar > mag(const dimensioned< Type > &)
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
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > snGrad(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvcSnGrad.C:45
rho
Definition: pEqn.H:1
fvVectorMatrix & UEqn
Definition: UEqn.H:13