momentumError.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) 2020-2021 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::momentumError
28
29Group
30 grpForcesFunctionObjects
31
32Description
33 Computes balance terms for the steady momentum equation.
34
35 Operands:
36 \table
37 Operand | Type | Location
38 input | - | -
39 output file | - | -
40 output field | volVectorField | $FOAM_CASE/<time>/<file>
41 \endtable
42
43Usage
44 Minimal example by using \c system/controlDict.functions:
45 \verbatim
46 momentumError1
47 {
48 // Mandatory entries (unmodifiable)
49 type momentumError;
50 libs (fieldFunctionObjects);
51
52 // Optional entries (runtime modifiable)
53 p <pName>;
54 U <UName>;
55 phi <phiName>;
56
57 // Inherited entries
58 ...
59 }
60 \endverbatim
61
62 where the entries mean:
63 \table
64 Property | Description | Type | Reqd | Deflt
65 type | Type name: momentumError | word | yes | -
66 libs | Library name: fieldFunctionObjects | word | yes | -
67 p | Name of pressure field | word | no | p
68 U | Name of velocity field | word | no | U
69 phi | Name of flux field | word | no | phi
70 \endtable
71
72 The inherited entries are elaborated in:
73 - \link functionObject.H \endlink
74 - \link zoneSubSet.H \endlink
75
76 Usage by the \c postProcess utility is not available.
77
78Note
79 - Optionally the user can specify \c cellZones to create a sub-mesh for the
80 \c momentumError calculation.
81
82See also
83 - Foam::functionObject
84 - Foam::functionObjects::fvMeshFunctionObject
85 - ExtendedCodeGuide::functionObjects::field::momentumError
86
87SourceFiles
88 momentumError.C
89
90\*---------------------------------------------------------------------------*/
91
92#ifndef functionObjects_momentumError_H
93#define functionObjects_momentumError_H
94
96#include "volFieldsFwd.H"
97#include "zoneSubSet.H"
98
99// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
100
101namespace Foam
102{
103namespace functionObjects
104{
105
106/*---------------------------------------------------------------------------*\
107 Class momentumError Declaration
108\*---------------------------------------------------------------------------*/
109
110class momentumError
111:
112 public fvMeshFunctionObject
113{
114protected:
115
116 // Protected Data
117
118 // Read from dictionary
119
120 //- Name of pressure field
121 word pName_;
122
123 //- Name of velocity field
124 word UName_;
125
126 //- Name of flux field
127 word phiName_;
128
129 //- Sub-set mesh
130 autoPtr<Detail::zoneSubSet> zoneSubSetPtr_;
131
132
133 // Protected Member Functions
134
135 //- Return the effective viscous stress (laminar + turbulent).
136 tmp<volVectorField> divDevRhoReff();
137
138
139public:
140
141 //- Runtime type information
142 TypeName("momentumError");
143
144
145 // Constructors
146
147 //- Construct from Time and dictionary
149 (
150 const word& name,
151 const Time& runTime,
152 const dictionary& dict
153 );
154
155 //- No copy construct
156 momentumError(const momentumError&) = delete;
157
158 //- No copy assignment
159 void operator=(const momentumError&) = delete;
160
162 //- Destructor
163 virtual ~momentumError() = default;
164
165
166 // Member Functions
167
168 //- Read the forces data
169 virtual bool read(const dictionary&);
170
171 //- Execute
172 virtual bool execute();
173
174 //- Write
175 virtual bool write();
176
177 //- Calculate the momentum error
179};
180
182// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183
184} // End namespace functionObjects
185} // End namespace Foam
186
187// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
188
189#endif
190
191// ************************************************************************* //
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:80
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
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 balance terms for the steady momentum equation.
word pName_
Name of pressure field.
word UName_
Name of velocity field.
void operator=(const momentumError &)=delete
No copy assignment.
TypeName("momentumError")
Runtime type information.
word phiName_
Name of flux field.
virtual ~momentumError()=default
Destructor.
tmp< volVectorField > divDevRhoReff()
Return the effective viscous stress (laminar + turbulent).
Definition: momentumError.C:52
momentumError(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
momentumError(const momentumError &)=delete
No copy construct.
void calcMomentError()
Calculate the momentum error.
autoPtr< Detail::zoneSubSet > zoneSubSetPtr_
Sub-set mesh.
virtual bool read(const dictionary &)
Read the forces data.
A class for managing temporary objects.
Definition: tmp.H:65
A class for handling words, derived from Foam::string.
Definition: word.H:68
engineTime & runTime
Namespace for OpenFOAM.
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73