pEqn.H
Go to the documentation of this file.
1 {
2  volScalarField rAU(1.0/UEqn.A());
3  volVectorField HbyA("HbyA", U);
4  HbyA = rAU*UEqn.H();
5 
6 
7  // Define coefficients and pseudo-velocities for RCM interpolation
8  // M[U] = AU - H = -grad(p)
9  // U = H/A - 1/A grad(p)
10  // H/A = U + 1/A grad(p)
12  (
13  "rhorAUf",
15  );
16 
18  (
19  "rhoHbyAf",
22  );
23 
24  #include "resetBoundaries.H"
25 
26  if (pimple.nCorrPISO() <= 1)
27  {
28  tUEqn.clear();
29  }
30 
31  if (pimple.transonic())
32  {
34  << "\nTransonic option not available for " << args.executable()
35  << exit(FatalError);
36  }
37  else
38  {
39  // Rhie & Chow interpolation (part 1)
41  (
42  "phiHbyA",
43  (
44  (rhoHbyAf & mesh.Sf())
47  * fvc::alphaCorr(U, phiByRho, pimple.finalInnerIter())
48  )
49  );
50 
51  MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
52 
53  // Non-orthogonal pressure corrector loop
54  while (pimple.correctNonOrthogonal())
55  {
56  // Pressure corrector
57  fvScalarMatrix pEqn
58  (
59  fvm::ddt(psi, p)
60  + fvc::div(phiHbyA)
62  ==
63  fvOptions(psi, p, rho.name())
64  );
65 
66  pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
67 
68  // Rhie & Chow interpolation (part 2)
69  if (pimple.finalNonOrthogonalIter())
70  {
71  phi = phiHbyA + pEqn.flux();
72  }
73  }
74  }
75 
77 
78  #include "rhoEqn.H"
79  #include "compressibleContinuityErrs.H"
80 
81  // Explicitly relax pressure for momentum corrector
82  p.relax();
83 
85  U.correctBoundaryConditions();
86  fvOptions.correct(U);
87 }
88 
89 rho = thermo.rho();
rhoHbyAf
surfaceVectorField rhoHbyAf("rhoHbyAf", fvc::interpolate(rho) *fvc::interpolate(U)+rhorAUf *fvc::interpolate(fvc::grad(p)))
phiHbyA
phiHbyA
Definition: pEqn.H:20
Foam::fac::grad
tmp< GeometricField< typename outerProduct< vector, Type >::type, faPatchField, areaMesh >> grad(const GeometricField< Type, faePatchField, edgeMesh > &ssf)
Definition: facGrad.C:56
thermo
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
Foam::fac::div
tmp< GeometricField< Type, faPatchField, areaMesh > > div(const GeometricField< Type, faePatchField, edgeMesh > &ssf)
Definition: facDiv.C:50
phiByRho
phiByRho
Definition: pEqn.H:76
MRF
IOMRFZoneList & MRF
Definition: setRegionFluidFields.H:22
pimple
pimpleControl & pimple
Definition: setRegionFluidFields.H:56
HbyA
HbyA
Definition: pEqn.H:4
Foam::argList::executable
const word & executable() const
Name of executable without the path.
Definition: argListI.H:51
tUEqn
tmp< fvVectorMatrix > tUEqn(fvm::ddt(rho, U)+fvm::div(phi, U)+MRF.DDt(rho, U)+turbulence->divDevRhoReff(U)==fvOptions(rho, U))
Foam::fvScalarMatrix
fvMatrix< scalar > fvScalarMatrix
Definition: fvMatricesFwd.H:44
fvOptions
fv::options & fvOptions
Definition: setRegionFluidFields.H:23
resetBoundaries.H
rhorAUf
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho *rAU))
Foam::fvc::alphaCorr
tmp< GeometricField< scalar, fvsPatchField, surfaceMesh > > alphaCorr(const GeometricField< vector, fvPatchField, volMesh > &U, const GeometricField< scalar, fvsPatchField, surfaceMesh > &phiU, const bool finalIter)
Definition: fvcCorrectAlpha.C:54
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:57
ddtCorr
ddtCorr
Definition: readControls.H:9
Foam::FatalError
error FatalError
p
p
Definition: pEqn.H:50
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
rAU
volScalarField rAU(1.0/UEqn.A())
Foam::exit
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:130
Foam::volVectorField
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:62
U
U
Definition: pEqn.H:72
Foam::surfaceScalarField
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Definition: surfaceFieldsFwd.H:54
Foam::fac::ddt
tmp< GeometricField< Type, faPatchField, areaMesh > > ddt(const dimensioned< Type > dt, const faMesh &mesh)
Definition: facDdt.C:47
phi
phi
Definition: pEqn.H:18
UEqn
fvVectorMatrix & UEqn
Definition: UEqn.H:13
Foam::fac::laplacian
tmp< GeometricField< Type, faPatchField, areaMesh > > laplacian(const GeometricField< Type, faPatchField, areaMesh > &vf, const word &name)
Definition: facLaplacian.C:47
Foam::surfaceVectorField
GeometricField< vector, fvsPatchField, surfaceMesh > surfaceVectorField
Definition: surfaceFieldsFwd.H:59
psi
const volScalarField & psi
Definition: createFieldRefs.H:1
args
Foam::argList args(argc, argv)
rho
rho
Definition: pEqn.H:1
interpolate
mesh interpolate(rAU)