CourantNo.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2013-2019 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::functionObjects::CourantNo
26 
27 Description
28  Calculates and outputs the Courant number as a volScalarField. The field is
29  stored on the mesh database so that it can be retrieved and used for other
30  applications.
31 
32 See also
33  Foam::functionObjects::fieldExpression
34  Foam::functionObjects::fvMeshFunctionObject
35 
36 SourceFiles
37  CourantNo.C
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef functionObjects_CourantNo_H
42 #define functionObjects_CourantNo_H
43 
44 #include "fieldExpression.H"
45 #include "volFields.H"
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 namespace functionObjects
52 {
53 
54 /*---------------------------------------------------------------------------*\
55  Class CourantNo Declaration
56 \*---------------------------------------------------------------------------*/
57 
58 class CourantNo
59 :
60  public fieldExpression
61 {
62  // Private Data
63 
64  //- Name of flux field, default is "phi"
65  word phiName_;
66 
67  //- Name of density field (optional)
68  word rhoName_;
69 
70 
71  // Private Member Functions
72 
73  //- Divide the Courant number by rho if required
75  (
77  ) const;
78 
79  //- Calculate the Courant number field and return true if successful
80  virtual bool calc();
81 
82 
83 public:
84 
85  //- Runtime type information
86  TypeName("CourantNo");
87 
88 
89  // Constructors
90 
91  //- Construct from Time and dictionary
92  CourantNo
93  (
94  const word& name,
95  const Time&,
96  const dictionary&
97  );
98 
99 
100  //- Destructor
101  virtual ~CourantNo();
102 
103 
104  // Member Functions
105 
106  //- Read the CourantNo data
107  virtual bool read(const dictionary&);
108 };
109 
110 
111 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
112 
113 } // End namespace functionObjects
114 } // End namespace Foam
115 
116 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
117 
118 #endif
119 
120 // ************************************************************************* //
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:76
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
const word & name() const
Return the name of this functionObject.
Calculates and outputs the Courant number as a volScalarField. The field is stored on the mesh databa...
Definition: CourantNo.H:60
TypeName("CourantNo")
Runtime type information.
CourantNo(const word &name, const Time &, const dictionary &)
Construct from Time and dictionary.
Definition: CourantNo.C:111
virtual ~CourantNo()
Destructor.
Definition: CourantNo.C:125
virtual bool read(const dictionary &)
Read the CourantNo data.
Definition: CourantNo.C:131
A class for managing temporary objects.
Definition: tmp.H:55
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.