CFDEMcoupling  2.4
 All Classes
compressibleContinuityErrsPU.H
1 /*---------------------------------------------------------------------------*\
2  CFDEMcoupling - Open Source CFD-DEM coupling
3 
4  CFDEMcoupling is part of the CFDEMproject
5  www.cfdem.com
6  Christoph Goniva, christoph.goniva@cfdem.com
7  Copyright (C) 1991-2009 OpenCFD Ltd.
8  Copyright (C) 2009-2012 JKU, Linz
9  Copyright (C) 2012- DCS Computing GmbH,Linz
10 -------------------------------------------------------------------------------
11 License
12  This file is part of CFDEMcoupling.
13 
14  CFDEMcoupling is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  CFDEMcoupling is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with CFDEMcoupling. If not, see <http://www.gnu.org/licenses/>.
26 
27 Global
28  continuityErrs
29 
30 Description
31  Calculates and prints the continuity errors.
32  The code is an evolution of compressibleContinuityErrs.H in OpenFOAM(R) 2.3.x,
33  where additional functionality for CFD-DEM coupling is added.
34 \*---------------------------------------------------------------------------*/
35 
36 {
37  dimensionedScalar totalMass = fvc::domainIntegrate(rho*voidfraction);
38 
39  scalar sumLocalContErr =
40  (fvc::domainIntegrate(mag(rho - thermo.rho())*voidfraction)/totalMass).value();
41 
42  scalar globalContErr =
43  (fvc::domainIntegrate((rho - thermo.rho())*voidfraction)/totalMass).value();
44 
45  cumulativeContErr += globalContErr;
46 
47  Info<< "time step continuity errors : sum local = " << sumLocalContErr
48  << ", global = " << globalContErr
49  << ", cumulative = " << cumulativeContErr
50  << endl;
51 }
52 
53 // ************************************************************************* //