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());
7 
8  volVectorField HbyA("HbyA", U);
9  HbyA = rAU*UEqn().H();
10  UEqn.clear();
11 
13 
15  (
16  "phiHbyA",
17  (fvc::interpolate(rho*HbyA) & mesh.Sf())
18  );
19 
20  MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
21 
22  bool closedVolume = adjustPhi(phiHbyA, U, p_rgh);
23 
25 
26  // Update the fixedFluxPressure BCs to ensure flux consistency
28  (
29  p_rgh.boundaryField(),
30  (
31  phiHbyA.boundaryField()
32  - MRF.relative(mesh.Sf().boundaryField() & U.boundaryField())
33  *rho.boundaryField()
34  )/(mesh.magSf().boundaryField()*rhorAUf.boundaryField())
35  );
36 
37  while (simple.correctNonOrthogonal())
38  {
39  fvScalarMatrix p_rghEqn
40  (
42  );
43 
44  p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
45  p_rghEqn.solve();
46 
47  if (simple.finalNonOrthogonalIter())
48  {
49  // Calculate the conservative fluxes
50  phi = phiHbyA - p_rghEqn.flux();
51 
52  // Explicitly relax pressure for momentum corrector
53  p_rgh.relax();
54 
55  // Correct the momentum source with the pressure gradient flux
56  // calculated from the relaxed pressure
57  U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/rhorAUf);
58  U.correctBoundaryConditions();
59  fvOptions.correct(U);
60  }
61  }
62 
63  #include "continuityErrs.H"
64 
65  p = p_rgh + rho*gh;
66 
67  // For closed-volume cases adjust the pressure level
68  // to obey overall mass continuity
69  if (closedVolume)
70  {
73  p_rgh = p - rho*gh;
74  }
75 
76  rho = thermo.rho();
77  rho.relax();
78  Info<< "rho max/min : " << max(rho).value() << " " << min(rho).value()
79  << endl;
80 }
phi
Definition: pEqn.H:20
setSnGrad< fixedFluxPressureFvPatchScalarField >(p_rgh.boundaryField(),( phiHbyA.boundaryField() -MRF.relative(mesh.Sf().boundaryField()&U.boundaryField()) *rho.boundaryField() )/(mesh.magSf().boundaryField()*rhorAUf.boundaryField()))
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> reconstruct(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
tmp< GeometricField< Type, fvPatchField, volMesh > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvcLaplacian.C:45
volScalarField & p_rgh
messageStream Info
tmp< surfaceScalarField > interpolate(const RhoType &rho)
dynamicFvMesh & mesh
surfaceScalarField phig(-rhorAUf *ghf *fvc::snGrad(rho)*mesh.magSf())
p
Definition: pEqn.H:59
fv::IOoptionList & fvOptions
fvMatrix< scalar > fvScalarMatrix
Definition: fvMatricesFwd.H:42
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
IOMRFZoneList & MRF
fvVectorMatrix UEqn(fvm::ddt(rho, U)+fvm::div(phi, U)+turbulence->divDevRhoReff(U)==fvOptions(rho, U))
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho *rAU))
const volScalarField & psi
Definition: createFields.H:24
phiHbyA
Definition: pEqn.H:21
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > snGrad(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvcSnGrad.C:45
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:55
adjustPhi(phiHbyA, U, p_rgh)
scalar getRefCellValue(const volScalarField &field, const label refCelli)
Return the current value of field in the reference cell.
Definition: findRefCell.C:154
volScalarField rAU(1.0/UEqn.A())
dimensionedScalar initialMass
Definition: createFields.H:83
dimensioned< Type > domainIntegrate(const GeometricField< Type, fvPatchField, volMesh > &vf)
const label pRefCell
const dictionary & simple
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcDiv.C:47
rho
Definition: pEqn.H:1
psiReactionThermo & thermo
Definition: createFields.H:32
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
U
Definition: pEqn.H:82
const surfaceScalarField & ghf
HbyA
Definition: pEqn.H:7
const volScalarField & gh