correctPhi.H
Go to the documentation of this file.
2 
3 {
5  (
6  IOobject
7  (
8  "pcorr",
9  runTime.timeName(),
10  mesh,
11  IOobject::NO_READ,
12  IOobject::NO_WRITE
13  ),
14  mesh,
15  dimensionedScalar(p.dimensions(), Zero),
17  );
18 
19  surfaceScalarField rhof(fvc::interpolate(rho, "div(phi,rho)"));
20  dimensionedScalar rAUf("rAUf", dimTime, 1.0);
21 
22  mesh.setFluxRequired(pcorr.name());
23 
24  while (pimple.correctNonOrthogonal())
25  {
26  fvScalarMatrix pcorrEqn
27  (
29  );
30 
31  pcorrEqn.solve();
32 
33  if (pimple.finalNonOrthogonalIter())
34  {
35  phi -= pcorrEqn.flux()/rhof;
36  }
37  }
38 }
rAUf
dimensionedScalar rAUf("rAUf", dimTime, 1.0)
runTime
engineTime & runTime
Definition: createEngineTime.H:13
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::Zero
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:131
Foam::fac::div
tmp< GeometricField< Type, faPatchField, areaMesh > > div(const GeometricField< Type, faePatchField, edgeMesh > &ssf)
Definition: facDiv.C:50
rho
rho
Definition: readInitialConditions.H:88
pcorr
volScalarField pcorr(IOobject("pcorr", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), mesh, dimensionedScalar(p.dimensions(), Zero), pcorrTypes)
pimple
pimpleControl & pimple
Definition: setRegionFluidFields.H:56
Foam::dimTime
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Definition: dimensionSets.H:54
Foam::fvScalarMatrix
fvMatrix< scalar > fvScalarMatrix
Definition: fvMatricesFwd.H:44
pcorrTypes
wordList pcorrTypes(p.boundaryField().size(), zeroGradientFvPatchScalarField::typeName)
correctUphiBCs
correctUphiBCs(U, phi)
Foam::dimensionedScalar
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Definition: dimensionedScalarFwd.H:43
phi
surfaceScalarField & phi
Definition: setRegionFluidFields.H:8
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:57
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
U
U
Definition: pEqn.H:72
Foam::surfaceScalarField
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Definition: surfaceFieldsFwd.H:54
Foam::fac::ddt
tmp< GeometricField< Type, faPatchField, areaMesh > > ddt(const dimensioned< Type > dt, const faMesh &mesh)
Definition: facDdt.C:47
Foam::fac::laplacian
tmp< GeometricField< Type, faPatchField, areaMesh > > laplacian(const GeometricField< Type, faPatchField, areaMesh > &vf, const word &name)
Definition: facLaplacian.C:47
rhof
surfaceScalarField rhof(fvc::interpolate(rho, "div(phi,rho)"))
Foam::fac::interpolate
static tmp< GeometricField< Type, faePatchField, edgeMesh > > interpolate(const GeometricField< Type, faPatchField, areaMesh > &tvf, const edgeScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.