streamFunction.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) 2016 OpenFOAM Foundation
9  Copyright (C) 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::streamFunction
29 
30 Group
31  grpFieldFunctionObjects
32 
33 Description
34  Computes the stream function (i.e. https://w.wiki/Ncm).
35 
36  Operands:
37  \table
38  Operand | Type | Location
39  input | surfaceScalarField | $FOAM_CASE/<time>/<inpField>
40  output file | - | -
41  output field | pointScalarField | $FOAM_CASE/<time>/<outField>
42  \endtable
43 
44 Usage
45  Minimal example by using \c system/controlDict.functions:
46  \verbatim
47  streamFunction1
48  {
49  // Mandatory entries (unmodifiable)
50  type streamFunction;
51  libs (fieldFunctionObjects);
52 
53  // Optional (inherited) entries
54  ...
55  }
56  \endverbatim
57 
58  where the entries mean:
59  \table
60  Property | Description | Type | Req'd | Dflt
61  type | Type name: streamFunction | word | yes | -
62  libs | Library name: fieldFunctionObjects | word | yes | -
63  \endtable
64 
65  The inherited entries are elaborated in:
66  - \link functionObject.H \endlink
67  - \link fieldExpression.H \endlink
68 
69  Minimal example by using the \c postProcess utility:
70  \verbatim
71  postProcess -func streamFunction
72  \endverbatim
73 
74 See also
75  - Foam::functionObject
76  - Foam::functionObjects::fieldExpression
77  - Foam::functionObjects::fvMeshFunctionObject
78  - ExtendedCodeGuide::functionObjects::field::streamFunction
79 
80 SourceFiles
81  streamFunction.C
82 
83 \*---------------------------------------------------------------------------*/
84 
85 #ifndef functionObjects_streamFunction_H
86 #define functionObjects_streamFunction_H
87 
88 #include "fieldExpression.H"
89 #include "surfaceFieldsFwd.H"
90 #include "pointFieldsFwd.H"
91 
92 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
93 
94 namespace Foam
95 {
96 namespace functionObjects
97 {
98 
99 /*---------------------------------------------------------------------------*\
100  Class streamFunction Declaration
101 \*---------------------------------------------------------------------------*/
102 
103 class streamFunction
104 :
105  public fieldExpression
106 {
107  // Private Member Functions
108 
109  //- Return the stream function field
110  tmp<pointScalarField> calc(const surfaceScalarField& phi) const;
111 
112  //- Calculate the stream-function and return true if successful
113  virtual bool calc();
114 
115 
116 public:
117 
118  //- Runtime type information
119  TypeName("streamFunction");
120 
121 
122  // Constructors
123 
124  //- Construct for given objectRegistry and dictionary.
125  // Allow the possibility to load fields from files
127  (
128  const word& name,
129  const Time& runTime,
130  const dictionary& dict
131  );
132 
133  //- No copy construct
134  streamFunction(const streamFunction&) = delete;
135 
136  //- No copy assignment
137  void operator=(const streamFunction&) = delete;
138 
139 
140  //- Destructor
141  virtual ~streamFunction() = default;
142 };
143 
144 
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 
147 } // End namespace functionObjects
148 } // End namespace Foam
149 
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151 
152 #endif
153 
154 // ************************************************************************* //
runTime
engineTime & runTime
Definition: createEngineTime.H:13
Foam::functionObjects::streamFunction::TypeName
TypeName("streamFunction")
Runtime type information.
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:73
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::streamFunction::streamFunction
streamFunction(const word &name, const Time &runTime, const dictionary &dict)
Construct for given objectRegistry and dictionary.
Definition: streamFunction.C:422
phi
surfaceScalarField & phi
Definition: setRegionFluidFields.H:8
Foam::functionObjects::streamFunction::~streamFunction
virtual ~streamFunction()=default
Destructor.
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::streamFunction::operator=
void operator=(const streamFunction &)=delete
No copy assignment.
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
Foam::surfaceScalarField
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Definition: surfaceFieldsFwd.H:54
pointFieldsFwd.H
Forwards and collection of common point field types.
surfaceFieldsFwd.H
fieldExpression.H
Foam::GeometricField< scalar, fvsPatchField, surfaceMesh >
Foam::functionObjects::streamFunction
Computes the stream function (i.e. https://w.wiki/Ncm).
Definition: streamFunction.H:136