Loading...
Searching...
No Matches
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-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::functionObjects::CourantNo
29
30Group
31 grpFieldFunctionObjects
32
33Description
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 | <time>/outputField
42 \endtable
43
44Usage
45 Minimal example by using \c system/controlDict.functions:
46 \verbatim
47 CourantNoFO
48 {
49 // Mandatory entries
50 type CourantNo;
51 libs (fieldFunctionObjects);
52
53 // Optional entries
54 rho <word>;
55
56 // Inherited entries
57 ...
58 }
59 \endverbatim
60
61 where the entries mean:
62 \table
63 Property | Description | Type | Reqd | Deflt
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 fieldExpression.H \endlink
71
72SourceFiles
73 CourantNo.C
74
75\*---------------------------------------------------------------------------*/
76
77#ifndef Foam_functionObjects_CourantNo_H
78#define Foam_functionObjects_CourantNo_H
79
80#include "fieldExpression.H"
81#include "volFields.H"
82
83// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
84
85namespace Foam
86{
87namespace functionObjects
88{
89
90/*---------------------------------------------------------------------------*\
91 Class CourantNo Declaration
92\*---------------------------------------------------------------------------*/
93
94class CourantNo
95:
96 public fieldExpression
97{
98 // Private Data
99
100 //- Name of density field
101 word rhoName_;
102
103
104 // Private Member Functions
105
106 //- Calculate the Courant number field and return true if successful
107 virtual bool calc();
108
109
110public:
111
112 //- Runtime type information
113 TypeName("CourantNo");
114
115
116 // Constructors
117
118 //- Construct from name, Time and dictionary
120 (
121 const word& name,
122 const Time& runTime,
123 const dictionary& dict
124 );
125
126 //- No copy construct
127 CourantNo(const CourantNo&) = delete;
128
129 //- No copy assignment
130 void operator=(const CourantNo&) = delete;
131
132
133 //- Destructor
134 virtual ~CourantNo() = default;
135
136
137 // Member Functions
138
139 //- Read the function-object dictionary
140 virtual bool read(const dictionary& dict);
141};
142
143
144// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145
146} // End namespace functionObjects
147} // End namespace Foam
148
149// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150
151#endif
152
153// ************************************************************************* //
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition Time.H:75
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
const word & name() const noexcept
Return the name of this functionObject.
Computes the Courant number field for time-variant simulations.
Definition CourantNo.H:132
TypeName("CourantNo")
Runtime type information.
CourantNo(const CourantNo &)=delete
No copy construct.
virtual bool read(const dictionary &dict)
Read the function-object dictionary.
Definition CourantNo.C:112
virtual ~CourantNo()=default
Destructor.
void operator=(const CourantNo &)=delete
No copy assignment.
CourantNo(const word &name, const Time &runTime, const dictionary &dict)
Construct from name, Time and dictionary.
Definition CourantNo.C:96
Intermediate class for handling field expression function objects (e.g. blendingFactor etc....
fieldExpression(const word &name, const Time &runTime, const dictionary &dict, const word &fieldName=word::null, const word &resultName=word::null)
Construct from name, Time and dictionary.
virtual bool calc()=0
Calculate the components of the field and return true if successful.
A class for handling words, derived from Foam::string.
Definition word.H:66
engineTime & runTime
Function objects are OpenFOAM utilities to ease workflow configurations and enhance workflows.
Namespace for OpenFOAM.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition exprTraits.C:127
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68