pEqn.H
Go to the documentation of this file.
1 {
2  volScalarField rAU("rAU", 1.0/UEqn.A());
5  tUEqn.clear();
6 
8 
10  (
11  "phiHbyA",
13  );
14 
15  MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
16 
18 
20 
21  // Update the pressure BCs to ensure flux consistency
23 
25  bool compressible = (compressibility.value() > SMALL);
26 
27  while (simple.correctNonOrthogonal())
28  {
29  fvScalarMatrix p_rghEqn
30  (
32  );
33 
34  p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
35 
36  p_rghEqn.solve();
37 
38  if (simple.finalNonOrthogonalIter())
39  {
40  // Calculate the conservative fluxes
41  phi = phiHbyA - p_rghEqn.flux();
42 
43  // Explicitly relax pressure for momentum corrector
44  p_rgh.relax();
45 
46  // Correct the momentum source with the pressure gradient flux
47  // calculated from the relaxed pressure
48  U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/rhorAUf);
49  U.correctBoundaryConditions();
50  fvOptions.correct(U);
51  }
52  }
53 
54  p = p_rgh + rho*gh;
55 
56  #include "continuityErrs.H"
57 
58  // For closed-volume cases adjust the pressure level
59  // to obey overall mass continuity
61  {
62  if(!compressible)
63  {
65  (
66  "p",
67  p.dimensions(),
69  );
70  }
71  else
72  {
75 
76  }
77  p_rgh = p - rho*gh;
78  }
79 
80  rho = thermo.rho();
81  rho.relax();
82  Info<< "rho min/max : " << min(rho).value() << " " << max(rho).value()
83  << endl;
84 }
fvMatrix< scalar > fvScalarMatrix
Definition: fvMatricesFwd.H:37
rho
Definition: pEqn.H:1
dimensionedScalar initialMass
Definition: createFields.H:57
p
Definition: pEqn.H:50
volScalarField rAU(1.0/UEqn.A())
phiHbyA
Definition: pEqn.H:20
tmp< surfaceScalarField > flux(const volVectorField &vvf)
Return the face-flux field obtained from the given volVectorField.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:40
surfaceScalarField phig("phig", -rhorAUf *ghf *fvc::snGrad(rho) *mesh.magSf())
tmp< GeometricField< Type, faPatchField, areaMesh > > div(const GeometricField< Type, faePatchField, edgeMesh > &ssf)
Definition: facDiv.C:43
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:487
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)
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:82
scalar getRefCellValue(const volScalarField &field, const label refCelli)
Return the current value of field in the reference cell.
Definition: findRefCell.C:127
fv::options & fvOptions
dimensionedScalar compressibility
Definition: pEqn.H:1
const surfaceScalarField & ghf
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:81
psiReactionThermo & thermo
Definition: createFields.H:28
dynamicFvMesh & mesh
IOMRFZoneList & MRF
tmp< GeometricField< Type, faPatchField, areaMesh > > laplacian(const GeometricField< Type, faPatchField, areaMesh > &vf, const word &name)
Definition: facLaplacian.C:40
tmp< volVectorField > constrainHbyA(const tmp< volVectorField > &tHbyA, const volVectorField &U, const volScalarField &p)
Definition: constrainHbyA.C:28
HbyA
Definition: pEqn.H:4
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:26
p_rgh
Definition: pEqn.H:139
bool compressible
Definition: pEqn.H:2
adjustPhi(phiHbyA, U, p_rgh)
const scalar pRefValue
const label pRefCell
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> reconstruct(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
const dictionary & simple
U
Definition: pEqn.H:72
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
mesh interpolate(rAU)
fvVectorMatrix & UEqn
Definition: UEqn.H:13
const volScalarField & gh
messageStream Info
Information stream (stdout output on master, null elsewhere)
constrainPressure(p_rgh, rho, U, phiHbyA, rhorAUf, MRF)
phi
Definition: pEqn.H:18
const volScalarField & psi
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:40
bool closedVolume
Definition: pEqn.H:10