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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2013-2016 OpenFOAM Foundation
9  Copyright (C) 2015-2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM 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  OpenFOAM 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 OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::functionObjects::CourantNo
29 
30 Group
31  grpFieldFunctionObjects
32 
33 Description
34  Computes the Courant number field for time-variant simulations.
35 
36  Operands:
37  \table
38  Operand | Type | Location
39  input | - | -
40  output file | - | -
41  output field | volScalarField | $FOAM_CASE/<time>/<outField>
42  \endtable
43 
44 Usage
45  Minimal example by using \c system/controlDict.functions:
46  \verbatim
47  CourantNo1
48  {
49  // Mandatory entries (unmodifiable)
50  type CourantNo;
51  libs (fieldFunctionObjects);
52 
53  // Optional entries (runtime modifiable)
54  rho rho;
55 
56  // Optional (inherited) entries
57  ...
58  }
59  \endverbatim
60 
61  where the entries mean:
62  \table
63  Property | Description | Type | Req'd | Dflt
64  type | Type name: CourantNo | word | yes | -
65  libs | Library name: fieldFunctionObjects | word | yes | -
66  rho | Name of density field | word | no | rho
67  \endtable
68 
69  The inherited entries are elaborated in:
70  - \link functionObject.H \endlink
71  - \link fieldExpression.H \endlink
72 
73  Minimal example by using the \c postProcess utility:
74  \verbatim
75  postProcess -func CourantNo
76  \endverbatim
77 
78 See also
79  - Foam::functionObject
80  - Foam::functionObjects::fieldExpression
81  - Foam::functionObjects::fvMeshFunctionObject
82  - ExtendedCodeGuide::functionObjects::field::CourantNo
83 
84 SourceFiles
85  CourantNo.C
86 
87 \*---------------------------------------------------------------------------*/
88 
89 #ifndef functionObjects_CourantNo_H
90 #define functionObjects_CourantNo_H
91 
92 #include "fieldExpression.H"
93 #include "volFields.H"
94 
95 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
96 
97 namespace Foam
98 {
99 namespace functionObjects
100 {
101 
102 /*---------------------------------------------------------------------------*\
103  Class CourantNo Declaration
104 \*---------------------------------------------------------------------------*/
105 
106 class CourantNo
107 :
108  public fieldExpression
109 {
110  // Private Data
111 
112  //- Name of density field
113  word rhoName_;
114 
115 
116  // Private Member Functions
117 
118  //- Divide the Courant number by rho if required
119  tmp<volScalarField::Internal> byRho
120  (
121  const tmp<volScalarField::Internal>& Co
122  ) const;
123 
124  //- Calculate the Courant number field and return true if successful
125  virtual bool calc();
126 
127 
128 public:
129 
130  //- Runtime type information
131  TypeName("CourantNo");
132 
133 
134  // Constructors
135 
136  //- Construct from Time and dictionary
137  CourantNo
138  (
139  const word& name,
140  const Time& runTime,
141  const dictionary& dict
142  );
143 
144  //- No copy construct
145  CourantNo(const CourantNo&) = delete;
146 
147  //- No copy assignment
148  void operator=(const CourantNo&) = delete;
149 
150 
151  //- Destructor
152  virtual ~CourantNo() = default;
153 
154 
155  // Member Functions
156 
157  //- Read the CourantNo data
158  virtual bool read(const dictionary&);
159 };
160 
161 
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 
164 } // End namespace functionObjects
165 } // End namespace Foam
166 
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 
169 #endif
170 
171 // ************************************************************************* //
volFields.H
runTime
engineTime & runTime
Definition: createEngineTime.H:13
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:73
Foam::functionObjects::CourantNo::operator=
void operator=(const CourantNo &)=delete
No copy assignment.
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::functionObjects::CourantNo::CourantNo
CourantNo(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
Definition: CourantNo.C:120
Foam::functionObjects::CourantNo::~CourantNo
virtual ~CourantNo()=default
Destructor.
Foam::functionObjects::CourantNo
Computes the Courant number field for time-variant simulations.
Definition: CourantNo.H:145
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::functionObjects::CourantNo::read
virtual bool read(const dictionary &)
Read the CourantNo data.
Definition: CourantNo.C:136
Foam::functionObjects::CourantNo::TypeName
TypeName("CourantNo")
Runtime type information.
Foam::functionObject::name
const word & name() const noexcept
Return the name of this functionObject.
Definition: functionObject.C:143
Foam::functionObjects::fieldExpression
Intermediate class for handling field expression function objects (e.g. blendingFactor etc....
Definition: fieldExpression.H:120
fieldExpression.H