correctPhi.H
Go to the documentation of this file.
1 // Calculate absolute flux from the mapped surface velocity
2 phi = mesh.Sf() & Uf();
3 
4 correctUphiBCs(U, phi, true);
5 
6 {
7  volScalarField pcorr
8  (
9  IOobject
10  (
11  "pcorr",
12  runTime.timeName(),
13  mesh,
14  IOobject::NO_READ,
15  IOobject::NO_WRITE
16  ),
17  mesh,
18  dimensionedScalar(p.dimensions(), 0),
20  );
21 
22  surfaceScalarField rhof(fvc::interpolate(rho, "div(phi,rho)"));
23  dimensionedScalar rAUf("rAUf", dimTime, 1.0);
24 
25  mesh.schemes().setFluxRequired(pcorr.name());
26 
27  while (pimple.correctNonOrthogonal())
28  {
29  fvScalarMatrix pcorrEqn
30  (
32  );
33 
34  pcorrEqn.solve();
35 
36  if (pimple.finalNonOrthogonalIter())
37  {
38  phi -= pcorrEqn.flux()/rhof;
39  }
40  }
41 }
42 
43 // Make the flux relative to the mesh motion
fvMatrix< scalar > fvScalarMatrix
Definition: fvMatricesFwd.H:42
pimpleNoLoopControl & pimple
U
Definition: pEqn.H:72
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcDiv.C:47
fvMesh & mesh
tmp< GeometricField< Type, fvPatchField, volMesh > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvcLaplacian.C:45
tmp< GeometricField< Type, fvPatchField, volMesh > > ddt(const dimensioned< Type > dt, const fvMesh &mesh)
Definition: fvcDdt.C:45
dimensionedScalar rAUf("rAUf", dimTime, 1.0)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:58
const dimensionSet dimTime
phi
Definition: correctPhi.H:3
autoPtr< surfaceVectorField > Uf
static tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > interpolate(const GeometricField< Type, fvPatchField, volMesh > &tvf, const surfaceScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.
correctUphiBCs(rho, U, phi, true)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
wordList pcorrTypes(p.boundaryField().size(), zeroGradientFvPatchScalarField::typeName)
surfaceScalarField rhof(fvc::interpolate(rho, "div(phi,rho)"))
volScalarField & p
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
void makeRelative(surfaceScalarField &phi, const volVectorField &U)
Make the given flux relative.
Definition: fvcMeshPhi.C:89