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-2015 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::CourantNo
26 
27 Group
28  grpUtilitiesFunctionObjects
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 SourceFiles
36  CourantNo.C
37  IOCourantNo.H
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef CourantNo_H
42 #define CourantNo_H
43 
44 #include "volFields.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 // Forward declaration of classes
52 class objectRegistry;
53 class dictionary;
54 class polyMesh;
55 class mapPolyMesh;
56 
57 /*---------------------------------------------------------------------------*\
58  Class CourantNo Declaration
59 \*---------------------------------------------------------------------------*/
60 
61 class CourantNo
62 {
63  // Private data
64 
65  //- Name of this set of CourantNo objects
66  word name_;
67 
68  //- Reference to the database
69  const objectRegistry& obr_;
70 
71  //- On/off switch
72  bool active_;
73 
74  //- Name of flux field, default is "phi"
75  word phiName_;
76 
77  //- Name of density field (optional)
78  word rhoName_;
79 
80 
81  // Private Member Functions
82 
83  //- Divide Co by rho if required
85  (
87  ) const;
88 
89  //- Disallow default bitwise copy construct
90  CourantNo(const CourantNo&);
91 
92  //- Disallow default bitwise assignment
93  void operator=(const CourantNo&);
94 
95 
96 public:
97 
98  //- Runtime type information
99  TypeName("CourantNo");
100 
101 
102  // Constructors
103 
104  //- Construct for given objectRegistry and dictionary.
105  // Allow the possibility to load fields from files
106  CourantNo
107  (
108  const word& name,
109  const objectRegistry&,
110  const dictionary&,
111  const bool loadFromFiles = false
112  );
113 
114 
115  //- Destructor
116  virtual ~CourantNo();
117 
118 
119  // Member Functions
120 
121  //- Return name of the set of CourantNo
122  virtual const word& name() const
123  {
124  return name_;
125  }
126 
127  //- Read the CourantNo data
128  virtual void read(const dictionary&);
129 
130  //- Execute, currently does nothing
131  virtual void execute();
132 
133  //- Execute at the final time-loop, currently does nothing
134  virtual void end();
135 
136  //- Called when time was set at the end of the Time::operator++
137  virtual void timeSet();
138 
139  //- Calculate the CourantNo and write
140  virtual void write();
141 
142  //- Update for changes of mesh
143  virtual void updateMesh(const mapPolyMesh&)
144  {}
145 
146  //- Update for changes of mesh
147  virtual void movePoints(const polyMesh&)
148  {}
149 };
150 
151 
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 
154 } // End namespace Foam
155 
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 
158 #endif
159 
160 // ************************************************************************* //
virtual void read(const dictionary &)
Read the CourantNo data.
Definition: CourantNo.C:127
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:158
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
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
Namespace for OpenFOAM.
virtual void updateMesh(const mapPolyMesh &)
Update for changes of mesh.
Definition: CourantNo.H:142
virtual void movePoints(const polyMesh &)
Update for changes of mesh.
Definition: CourantNo.H:146
virtual const word & name() const
Return name of the set of CourantNo.
Definition: CourantNo.H:121
virtual ~CourantNo()
Destructor.
Definition: CourantNo.C:121
virtual void write()
Calculate the CourantNo and write.
Definition: CourantNo.C:176
virtual void execute()
Execute, currently does nothing.
Definition: CourantNo.C:137
TypeName("CourantNo")
Runtime type information.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
Registry of regIOobjects.
virtual void end()
Execute at the final time-loop, currently does nothing.
Definition: CourantNo.C:163
A class for managing temporary objects.
Definition: PtrList.H:118
virtual void timeSet()
Called when time was set at the end of the Time::operator++.
Definition: CourantNo.C:172