immersedBoundaryCourantNo.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | foam-extend: Open Source CFD
4  \\ / O peration | Version: 3.2
5  \\ / A nd | Web: http://www.foam-extend.org
6  \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
8 License
9  This file is part of foam-extend.
10 
11  foam-extend is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by the
13  Free Software Foundation, either version 3 of the License, or (at your
14  option) any later version.
15 
16  foam-extend is distributed in the hope that it will be useful, but
17  WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  General Public License for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
23 
24 Global
25  CourantNo
26 
27 Description
28  Calculates and outputs the mean and maximum Courant Numbers with
29  immersed boundary correction.
30 
31 \*---------------------------------------------------------------------------*/
32 
33 scalar CoNum = 0.0;
34 scalar meanCoNum = 0.0;
35 scalar velMag = 0.0;
36 
37 if (mesh.nInternalFaces())
38 {
39  surfaceScalarField magPhi = mag(faceIbMask*phi);
40 
41  surfaceScalarField SfUfbyDelta =
42  mesh.surfaceInterpolation::deltaCoeffs()*magPhi;
43 
44  CoNum = max(SfUfbyDelta/mesh.magSf())
45  .value()*runTime.deltaT().value();
46 
47  meanCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf()))
48  .value()*runTime.deltaT().value();
49 
50  velMag = max(magPhi/mesh.magSf()).value();
51 }
52 
53 Info<< "Courant Number mean: " << meanCoNum
54  << " max: " << CoNum
55  << " velocity magnitude: " << velMag
56  << endl;
57 
58 // ************************************************************************* //
phi
surfaceScalarField & phi
Definition: setRegionFluidFields.H:8
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
Foam::dimensioned::value
const Type & value() const
Return const reference to value.
Definition: dimensionedType.C:261
Foam::mag
dimensioned< scalar > mag(const dimensioned< Type > &)
Foam::Info
messageStream Info
CoNum
scalar CoNum
Definition: immersedBoundaryCourantNo.H:30
velMag
scalar velMag
Definition: immersedBoundaryCourantNo.H:32
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
meanCoNum
scalar meanCoNum
Definition: immersedBoundaryCourantNo.H:31
Foam::max
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
Foam::surfaceScalarField
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Definition: surfaceFieldsFwd.H:52
Foam::sum
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
Definition: DimensionedFieldFunctions.C:333