pEqn.H
Go to the documentation of this file.
1 {
2  const volScalarField& psi = thermo.psi();
3 
4  tmp<volVectorField> tHbyA;
6  {
7  tHbyA = constrainHbyA(trTU()&UEqn.H(), U, p);
8  }
9  else
10  {
11  tHbyA = constrainHbyA(trAU()*UEqn.H(), U, p);
12  }
13  volVectorField& HbyA = tHbyA.ref();
14 
15  tUEqn.clear();
16 
17  bool closedVolume = false;
18 
19  surfaceScalarField phiHbyA("phiHbyA", fvc::flux(rho*HbyA));
20  MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
21 
22  closedVolume = adjustPhi(phiHbyA, U, p);
23 
24  while (simple.correctNonOrthogonal())
25  {
26  tmp<fvScalarMatrix> tpEqn;
27 
29  {
30  tpEqn =
31  (
33  + fvOptions(psi, p, rho.name())
34  ==
36  );
37  }
38  else
39  {
40  tpEqn =
41  (
43  + fvOptions(psi, p, rho.name())
44  ==
46  );
47  }
48 
49  fvScalarMatrix& pEqn = tpEqn.ref();
50 
51  pEqn.setReference(pRefCell, pRefValue);
52 
53  pEqn.solve();
54 
55  if (simple.finalNonOrthogonalIter())
56  {
57  phi = phiHbyA - pEqn.flux();
58  }
59  }
60 
62 
63  // Explicitly relax pressure for momentum corrector
64  p.relax();
65 
67  {
68  U = HbyA - (trTU() & fvc::grad(p));
69  }
70  else
71  {
72  U = HbyA - trAU()*fvc::grad(p);
73  }
74 
75  U.correctBoundaryConditions();
76  fvOptions.correct(U);
77 
78  // For closed-volume cases adjust the pressure and density levels
79  // to obey overall mass continuity
80  if (closedVolume)
81  {
84  }
85 
86  rho = thermo.rho();
87  rho = max(rho, rhoMin);
88  rho = min(rho, rhoMax);
89  rho.relax();
90  Info<< "rho max/min : "
91  << max(rho).value() << " "
92  << min(rho).value() << endl;
93 }
PtrList< dimensionedScalar > rhoMax(fluidRegions.size())
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcGrad.C:52
fvMatrix< scalar > fvScalarMatrix
Definition: fvMatricesFwd.H:42
U
Definition: pEqn.H:83
dimensionedScalar initialMass
Definition: createFields.H:82
p
Definition: pEqn.H:50
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
PtrList< dimensionedScalar > rhoMin(fluidRegions.size())
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:253
tmp< fvVectorMatrix > tUEqn(fvm::ddt(rho, U)+fvm::div(phi, U)+MRF.DDt(rho, U)+turbulence->divDevRhoReff(U)==fvOptions(rho, U))
Calculates and prints the continuity errors.
dimensioned< Type > domainIntegrate(const GeometricField< Type, fvPatchField, volMesh > &vf)
tmp< surfaceScalarField > interpolate(const RhoType &rho)
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
tmp< volTensorField > trTU
Definition: UEqn.H:22
fv::options & fvOptions
tmp< volVectorField > tHbyA
Definition: pEqn.H:1
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
psiReactionThermo & thermo
Definition: createFields.H:31
IOMRFZoneList & MRF
tmp< volVectorField > constrainHbyA(const tmp< volVectorField > &tHbyA, const volVectorField &U, const volScalarField &p)
Definition: constrainHbyA.C:33
adjustPhi(phiHbyA, U, p_rgh)
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
const scalar pRefValue
Internal & ref()
Return a reference to the dimensioned internal field.
const label pRefCell
const dictionary & simple
fvVectorMatrix & UEqn
Definition: UEqn.H:13
messageStream Info
phi
Definition: pEqn.H:18
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
rho
Definition: pEqn.H:1
Switch pressureImplicitPorosity(false)
tmp< volScalarField > trAU
Definition: UEqn.H:21