pEqn.H
Go to the documentation of this file.
1 {
2  rho = thermo.rho();
3  rho.relax();
4 
5  volScalarField rAU("rAU", 1.0/UEqn.A());
8  tUEqn.clear();
9 
11 
13  (
14  "phiHbyA",
16  );
17 
18  MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
19 
20  bool closedVolume = adjustPhi(phiHbyA, U, p_rgh);
21 
23 
24  // Update the pressure BCs to ensure flux consistency
26 
27  while (simple.correctNonOrthogonal())
28  {
29  fvScalarMatrix p_rghEqn
30  (
32  );
33 
34  p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
35  p_rghEqn.solve();
36 
37  if (simple.finalNonOrthogonalIter())
38  {
39  // Calculate the conservative fluxes
40  phi = phiHbyA - p_rghEqn.flux();
41 
42  // Explicitly relax pressure for momentum corrector
43  p_rgh.relax();
44 
45  // Correct the momentum source with the pressure gradient flux
46  // calculated from the relaxed pressure
47  U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/rhorAUf);
48  U.correctBoundaryConditions();
49  fvOptions.correct(U);
50  }
51  }
52 
53  #include "continuityErrs.H"
54 
55  p = p_rgh + rho*gh;
56 
57  // For closed-volume cases adjust the pressure level
58  // to obey overall mass continuity
59  if (!thermo.incompressible() && closedVolume)
60  {
63  p_rgh = p - rho*gh;
64  }
65 
66  rho = thermo.rho();
67  rho.relax();
68  Info<< "rho max/min : " << max(rho).value() << " " << min(rho).value()
69  << endl;
70 }
fvMatrix< scalar > fvScalarMatrix
Definition: fvMatricesFwd.H:42
fv::options & fvOptions
rho
Definition: pEqn.H:1
dimensionedScalar initialMass
Definition: createFields.H:57
p
Definition: pEqn.H:50
volScalarField rAU(1.0/UEqn.A())
IOMRFZoneList & MRF
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
phiHbyA
Definition: pEqn.H:20
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcDiv.C:47
surfaceScalarField phig("phig", -rhorAUf *ghf *fvc::snGrad(rho) *mesh.magSf())
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:256
tmp< fvVectorMatrix > tUEqn(fvm::ddt(rho, U)+fvm::div(phi, U)+MRF.DDt(rho, U)+turbulence->divDevRhoReff(U)==fvOptions(rho, U))
dimensioned< Type > domainIntegrate(const GeometricField< Type, fvPatchField, volMesh > &vf)
rhoReactionThermo & thermo
Definition: createFields.H:28
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
scalar getRefCellValue(const volScalarField &field, const label refCelli)
Return the current value of field in the reference cell.
Definition: findRefCell.C:136
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
dynamicFvMesh & mesh
tmp< volVectorField > constrainHbyA(const tmp< volVectorField > &tHbyA, const volVectorField &U, const volScalarField &p)
Definition: constrainHbyA.C:33
p_rgh
Definition: pEqn.H:152
const surfaceScalarField & ghf
bool closedVolume
Definition: pEqn.H:6
adjustPhi(phiHbyA, U, p_rgh)
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.
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> reconstruct(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
U
Definition: pEqn.H:72
volVectorField & HbyA
Definition: pEqn.H:13
label pRefCell
Definition: createFields.H:106
fvVectorMatrix & UEqn
Definition: UEqn.H:13
const volScalarField & gh
messageStream Info
constrainPressure(p_rgh, rho, U, phiHbyA, rhorAUf, MRF)
phi
Definition: pEqn.H:18
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))
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > snGrad(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvcSnGrad.C:45
simpleControl simple(mesh)