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 }
runTime
engineTime & runTime
Definition: createEngineTime.H:13
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:369
Foam::fac::div
tmp< GeometricField< Type, faPatchField, areaMesh > > div(const GeometricField< Type, faePatchField, edgeMesh > &ssf)
Definition: facDiv.C:50
Foam::Info
messageStream Info
Information stream (stdout output on master, null elsewhere)
sumLocalContErr
scalar sumLocalContErr
Definition: volContinuity.H:9
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:57
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::mag
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
globalContErr
scalar globalContErr
Definition: volContinuity.H:12