pEqn.H
Go to the documentation of this file.
1 {
2  rho = thermo.rho();
3 
4  // Thermodynamic density needs to be updated by psi*d(p) after the
5  // pressure solution - done in 2 parts. Part 1:
6  thermo.rho() -= psi*p;
7 
8  volScalarField rAU(1.0/UEqn.A());
10 
11  volVectorField HbyA("HbyA", U);
12  HbyA = rAU*UEqn.H();
13 
15  (
16  "phiHbyA",
17  (
18  (fvc::interpolate(rho*HbyA) & mesh.Sf())
20  )
21  );
22 
23  MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
24 
26  (
28  + fvc::div(phiHbyA)
29  ==
30  parcels.Srho()
31  + fvOptions(psi, p, rho.name())
32  );
33 
34  while (pimple.correctNonOrthogonal())
35  {
36  fvScalarMatrix pEqn
37  (
38  pDDtEqn
40  );
41 
42  pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
43 
44  if (pimple.finalNonOrthogonalIter())
45  {
46  phi = phiHbyA + pEqn.flux();
47  }
48  }
49 
50  p.relax();
51 
52  // Second part of thermodynamic density update
53  thermo.rho() += psi*p;
54 
55  #include "rhoEqn.H" // NOTE: flux and time scales now inconsistent
56  #include "compressibleContinuityErrs.H"
57 
59  U.correctBoundaryConditions();
60  fvOptions.correct(U);
61  K = 0.5*magSqr(U);
62 
63  if (thermo.dpdt())
64  {
65  dpdt = fvc::ddt(p);
66  }
67 
68  rho = thermo.rho();
69  rho = max(rho, rhoMin);
70  rho = min(rho, rhoMax);
71 
72  Info<< "p min/max = " << min(p).value() << ", " << max(p).value() << endl;
73 }
Foam::fvc::grad
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcGrad.C:52
p
p
Definition: pEqn.H:62
Foam::MULES::interpolate
tmp< surfaceScalarField > interpolate(const RhoType &rho)
Definition: IMULESTemplates.C:40
thermo
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
Foam::fvc::div
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcDiv.C:47
rhoEqn.H
Solve the continuity for density.
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
Foam::correction
tmp< fvMatrix< Type > > correction(const fvMatrix< Type > &)
Return the correction form of the given matrix.
Foam::dimensioned::value
const Type & value() const
Return const reference to value.
Definition: dimensionedType.C:261
dpdt
volScalarField & dpdt
Definition: setRegionFluidFields.H:12
phi
phi
Definition: pEqn.H:20
U
U
Definition: pEqn.H:46
K
CGAL::Exact_predicates_exact_constructions_kernel K
Definition: CGALTriangulation3DKernel.H:56
pDDtEqn
fvScalarMatrix pDDtEqn(fvc::ddt(rho)+psi *correction(fvm::ddt(p))+fvc::div(phiHbyA)==fvOptions(psi, p, rho.name()))
Foam::fvc::laplacian
tmp< GeometricField< Type, fvPatchField, volMesh > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvcLaplacian.C:45
rhoMin
PtrList< dimensionedScalar > rhoMin(fluidRegions.size())
Foam::fvScalarMatrix
fvMatrix< scalar > fvScalarMatrix
Definition: fvMatricesFwd.H:42
Foam::Info
messageStream Info
Foam::fvc::ddtCorr
tmp< GeometricField< typename flux< Type >::type, fvsPatchField, surfaceMesh > > ddtCorr(const GeometricField< Type, fvPatchField, volMesh > &U, const GeometricField< Type, fvsPatchField, surfaceMesh > &Uf)
Definition: fvcDdt.C:155
UEqn
tmp< fvVectorMatrix > UEqn(fvm::div(phi, U)+MRF.DDt(U)+turbulence->divDevReff(U)==fvOptions(U))
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
MRF
IOMRFZoneList & MRF
Definition: setRegionFluidFields.H:15
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
rhorAUf
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho *rAU))
rho
rho
Definition: pEqn.H:3
Foam::volVectorField
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:55
rAU
volScalarField rAU("rAU", 1.0/UEqn().A())
Foam::max
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
HbyA
HbyA
Definition: pEqn.H:4
psi
const volScalarField & psi
Definition: setRegionFluidFields.H:13
Foam::surfaceScalarField
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Definition: surfaceFieldsFwd.H:52
rhoMax
PtrList< dimensionedScalar > rhoMax(fluidRegions.size())
pimple
const dictionary & pimple
Definition: readFluidMultiRegionPIMPLEControls.H:1
phiHbyA
phiHbyA
Definition: pEqn.H:21
Foam::fvc::ddt
tmp< GeometricField< Type, fvPatchField, volMesh > > ddt(const dimensioned< Type > dt, const fvMesh &mesh)
Definition: fvcDdt.C:45
Foam::min
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
Foam::magSqr
dimensioned< scalar > magSqr(const dimensioned< Type > &)
fvOptions
fv::options & fvOptions
Definition: setRegionFluidFields.H:16