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