continuityErrsPython.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2 
3  DAFoam : Discrete Adjoint with OpenFOAM
4  Version : v3
5 
6  This file is modified from OpenFOAM's source code
7  src/finiteVolume/cfdTools/incompressible/continuityErrs.H
8 
9  OpenFOAM: The Open Source CFD Toolbox
10 
11  Copyright (C): 2011-2016 OpenFOAM Foundation
12 
13  OpenFOAM License:
14 
15  OpenFOAM is free software: you can redistribute it and/or modify it
16  under the terms of the GNU General Public License as published by
17  the Free Software Foundation, either version 3 of the License, or
18  (at your option) any later version.
19 
20  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
21  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
22  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23  for more details.
24 
25  You should have received a copy of the GNU General Public License
26  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
27 
28 \*---------------------------------------------------------------------------*/
29 
30 // Calculates and prints the continuity errors.
31 
32 {
33  volScalarField contErr(fvc::div(phi));
34 
35  scalar sumLocalContErr = runTime.deltaTValue() * mag(contErr)().weightedAverage(mesh.V()).value();
36 
37  scalar globalContErr = runTime.deltaTValue() * contErr.weightedAverage(mesh.V()).value();
39 
40  Info << "Time step continuity errors : sum local = " << sumLocalContErr << endl
41  << " global = " << globalContErr << endl
42  << " cumulative = " << cumulativeContErr << endl;
43 }
mesh
fvMesh & mesh
Definition: createRefsHeatTransfer.H:4
phi
surfaceScalarField & phi
Definition: createRefsPimple.H:8
globalContErr
scalar globalContErr
Definition: continuityErrsPython.H:37
cumulativeContErr
cumulativeContErr
Definition: continuityErrsPython.H:38
sumLocalContErr
scalar sumLocalContErr
Definition: continuityErrsPython.H:35
runTime
Time & runTime
Definition: createRefsHeatTransfer.H:1