volContinuity.H
Go to the documentation of this file.
1 {
2  volScalarField conserve(-fvc::div(mesh.phi()));
3  // The ddt term constructed by hand because it would be wrong for
4  // Backward Differencing in time.
5 
6  conserve.primitiveFieldRef() +=
7  (1.0 - mesh.V0()/mesh.V())/runTime.deltaTValue();
8 
9  scalar sumLocalContErr = runTime.deltaTValue()*
10  mag(conserve)().weightedAverage(mesh.V()).value();
11 
12  scalar globalContErr = runTime.deltaTValue()*
13  conserve.weightedAverage(mesh.V()).value();
14 
15  Info<< "volume continuity errors : sum local = " << sumLocalContErr
16  << ", global = " << globalContErr << endl;
17 }
const DimensionedField< scalar, volMesh > & V() const
Return cell volumes.
const surfaceScalarField & phi() const
Return cell face motion fluxes.
const DimensionedField< scalar, volMesh > & V0() const
Return old-time cell volumes.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
tmp< VolField< Type > > div(const SurfaceField< Type > &ssf)
Definition: fvcDiv.C:47
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:258
messageStream Info
void mag(LagrangianPatchField< scalar > &f, const LagrangianPatchField< Type > &f1)
VolField< scalar > volScalarField
Definition: volFieldsFwd.H:62
scalar sumLocalContErr
Definition: volContinuity.H:9
scalar globalContErr
Definition: volContinuity.H:12