Loading...
Searching...
No Matches
surfaceCourantNumber.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) 2024-2025 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::functionObjects::surfaceCourantNumber
28
29Description
30 Computes the surface Courant number field at finite-area face centres.
31
32 Operands:
33 \table
34 Operand | Type | Location
35 input | - | -
36 output file | dat <!--
37 --> | postProcessing/<FO>/<time>/<file>
38 output field | areaScalarField | <time>/<outField>
39 \endtable
40
41Usage
42 Minimal example by using \c system/controlDict.functions:
43 \verbatim
44 surfaceCourantNumber1
45 {
46 // Mandatory entries
47 type surfaceCourantNumber;
48 libs (regionFaModels);
49
50 // Optional entries
51 area <word>;
52 result <word>;
53 phis <word>;
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: surfaceCourantNumber | word | yes | -
65 libs | Library name: regionFaModels | word | yes | -
66 region | Name of finite-volume region | word | no | region0
67 area | Name of finite-area region | word | no |
68 result | Name of result field | word | no | surfaceCo
69 phis | Name of edge flux field | word | no | phis
70 rho | Name of density field | word | no | rho
71 \endtable
72
73 The inherited entries are elaborated in:
74 - \link fvMeshFunctionObject.H \endlink
75 - \link writeFile.H \endlink
76
77Note
78 - The \c surfaceCourantNumber calculates the Courant number at face centers,
79 rather than at edge centers.
80 - If the area region is not specified, the first region is taken
81
82SourceFiles
83 surfaceCourantNumber.C
84
85\*---------------------------------------------------------------------------*/
86
87#ifndef Foam_functionObjects_surfaceCourantNumber_H
88#define Foam_functionObjects_surfaceCourantNumber_H
89
91#include "writeFile.H"
92
93// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
94
95namespace Foam
96{
97
98// Forward Declarations
99class faMesh;
100
101namespace functionObjects
102{
103
104/*---------------------------------------------------------------------------*\
105 Class surfaceCourantNumber Declaration
106\*---------------------------------------------------------------------------*/
107
109:
110 public functionObjects::fvMeshFunctionObject,
111 public writeFile
112{
113 // Private Data
114
115 //- Name of result field
116 word resultName_;
117
118 //- Name of edge flux field
119 word phisName_;
120
121 //- Name of density field
122 word rhoName_;
123
124 //- Reference to finite-area object registry
125 const faMesh* faMeshPtr_;
126
127
128 // Private Member Functions
129
130 //- Output file header information
131 virtual void writeFileHeader(Ostream& os);
132
133
134public:
135
136 //- Runtime type information
137 TypeName("surfaceCourantNumber");
138
139
140 // Constructors
141
142 //- Construct from Time and dictionary
144 (
145 const word& name,
146 const Time& runTime,
147 const dictionary& dict
148 );
149
150 //- No copy construct
152
153 //- No copy assignment
154 void operator=(const surfaceCourantNumber&) = delete;
155
156
157 //- Destructor
158 virtual ~surfaceCourantNumber() = default;
159
160
161 // Member Functions
162
163 //- Read the surfaceCourantNumber data
164 virtual bool read(const dictionary&);
165
166 //- Calculate the Courant number field and return true if successful
167 virtual bool execute();
168
169 //- Write the result field
170 virtual bool write();
171};
172
173
174// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175
176} // End namespace functionObjects
177} // End namespace Foam
178
179// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180
181#endif
182
183// ************************************************************************* //
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
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
Finite area mesh (used for 2-D non-Euclidian finite area method) defined using a patch of faces on a ...
Definition faMesh.H:140
const word & name() const noexcept
Return the name of this functionObject.
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
Computes the surface Courant number field at finite-area face centres.
TypeName("surfaceCourantNumber")
Runtime type information.
surfaceCourantNumber(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
surfaceCourantNumber(const surfaceCourantNumber &)=delete
No copy construct.
virtual ~surfaceCourantNumber()=default
Destructor.
void operator=(const surfaceCourantNumber &)=delete
No copy assignment.
virtual bool execute()
Calculate the Courant number field and return true if successful.
virtual bool write()
Write the result field.
virtual bool read(const dictionary &)
Read the surfaceCourantNumber data.
Base class for writing single files from the function objects.
Definition writeFile.H:113
writeFile(const objectRegistry &obr, const fileName &prefix, const word &name="undefined", const bool writeToFile=true, const string &ext=".dat")
Construct from objectRegistry, prefix, fileName.
Definition writeFile.C:200
A class for handling words, derived from Foam::string.
Definition word.H:66
engineTime & runTime
OBJstream os(runTime.globalPath()/outputName)
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