CourantNo.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2013-2016 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 Group
28  grpFieldFunctionObjects
29 
30 Description
31  This function object calculates and outputs the Courant number as a
32  volScalarField. The field is stored on the mesh database so that it can
33  be retrieved and used for other applications.
34 
35 See also
36  Foam::functionObjects::fieldExpression
37  Foam::functionObjects::fvMeshFunctionObject
38 
39 SourceFiles
40  CourantNo.C
41 
42 \*---------------------------------------------------------------------------*/
43 
44 #ifndef functionObjects_CourantNo_H
45 #define functionObjects_CourantNo_H
46 
47 #include "fieldExpression.H"
48 #include "volFields.H"
49 
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 
52 namespace Foam
53 {
54 namespace functionObjects
55 {
56 
57 /*---------------------------------------------------------------------------*\
58  Class CourantNo Declaration
59 \*---------------------------------------------------------------------------*/
60 
61 class CourantNo
62 :
63  public fieldExpression
64 {
65  // Private data
66 
67  //- Name of flux field, default is "phi"
68  word phiName_;
69 
70  //- Name of density field (optional)
71  word rhoName_;
72 
73 
74  // Private Member Functions
75 
76  //- Divide the Courant number by rho if required
78  (
80  ) const;
81 
82  //- Calculate the Courant number field and return true if successful
83  virtual bool calc();
84 
85 
86 public:
87 
88  //- Runtime type information
89  TypeName("CourantNo");
90 
91 
92  // Constructors
93 
94  //- Construct from Time and dictionary
95  CourantNo
96  (
97  const word& name,
98  const Time&,
99  const dictionary&
100  );
101 
102 
103  //- Destructor
104  virtual ~CourantNo();
105 
106 
107  // Member Functions
108 
109  //- Read the CourantNo data
110  virtual bool read(const dictionary&);
111 };
112 
113 
114 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
115 
116 } // End namespace functionObjects
117 } // End namespace Foam
118 
119 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
120 
121 #endif
122 
123 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:68
virtual bool read(const dictionary &)
Read the CourantNo data.
Definition: CourantNo.C:156
const word & name() const
Return the name of this functionObject.
A class for handling words, derived from string.
Definition: word.H:59
This function object calculates and outputs the Courant number as a volScalarField. The field is stored on the mesh database so that it can be retrieved and used for other applications.
Definition: CourantNo.H:60
virtual ~CourantNo()
Destructor.
Definition: CourantNo.C:150
TypeName("CourantNo")
Runtime type information.
A class for managing temporary objects.
Definition: PtrList.H:54
CourantNo(const word &name, const Time &, const dictionary &)
Construct from Time and dictionary.
Definition: CourantNo.C:135
Namespace for OpenFOAM.