Loading...
Searching...
No Matches
valueAverage.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) 2022 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::valueAverage
28
29Group
30 grpFieldFunctionObjects
31
32Description
33 Computes the ensemble- or time-based singular-value average values,
34 with optional windowing, from the output of function objects
35 that generate non-field type values (e.g. \c Cd of \c forceCoeffs or
36 \c momentum_x in \c momentum function objects).
37
38 Operands:
39 \table
40 Operand | Type | Location
41 input | - | -
42 output file | dat | postProcessing/<FO>/<time>/file
43 output field | - | -
44 \endtable
45
46Usage
47 Minimal example by using \c system/controlDict.functions:
48 \verbatim
49 valueAverageFO
50 {
51 // Mandatory entries
52 type valueAverage;
53 libs (fieldFunctionObjects);
54 functionObject <FO>; // forceCoeffs1;
55 fields (<field1> ... <fieldN>); // (Cm Cd Cl);
56
57 // Optional entries
58 resetOnRestart <bool>;
59 window <scalar>;
60
61 // Inherited entries
62 ...
63 }
64 \endverbatim
65
66 where the entries mean:
67 \table
68 Property | Description | Type | Reqd | Deflt
69 type | Type name: valueAverage | word | yes | -
70 libs | Library name: fieldFunctionObjects | word | yes | -
71 functionObject | Name of function object to retrieve data | word | yes | -
72 fields | Names of operand fields | wordList | yes | -
73 resetOnRestart | Reset the averaging on restart | bool | no | false
74 window | Averaging window | scalar | no | VGREAT
75 \endtable
76
77 The inherited entries are elaborated in:
78 - \link regionFunctionObject.H \endlink
79 - \link valueAverageBase.H \endlink
80
81SourceFiles
82 valueAverage.C
83 valueAverageTemplates.C
84
85\*---------------------------------------------------------------------------*/
86
87#ifndef Foam_functionObjects_valueAverage_H
88#define Foam_functionObjects_valueAverage_H
89
91#include "valueAverageBase.H"
92#include "writeFile.H"
93
94// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
95
96namespace Foam
97{
98namespace functionObjects
99{
100
101/*---------------------------------------------------------------------------*\
102 Class valueAverage Declaration
103\*---------------------------------------------------------------------------*/
104
105class valueAverage
106:
108 public valueAverageBase
109{
110public:
111
112 //- Runtime type information
113 TypeName("valueAverage");
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 valueAverage(const valueAverage&) = delete;
128
129 //- No copy assignment
130 void operator=(const valueAverage&) = delete;
131
132
133 //- Destructor
134 virtual ~valueAverage() = default;
135
136
137 // Public Member Functions
138
139 //- Read the function-object dictionary
140 virtual bool read(const dictionary& dict);
141
142 //- Execute the function-object operations
143 virtual bool execute();
144
145 //- Write the function-object results
146 virtual bool write();
147};
148
149
150// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151
152} // End namespace functionObjects
153} // End namespace Foam
154
155// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156
157#endif
159// ************************************************************************* //
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.
Specialization of Foam::functionObject for a region and providing a reference to the region Foam::obj...
regionFunctionObject(const regionFunctionObject &)=delete
No copy construct.
Base class that computes the ensemble- or time-based singular-value average values,...
valueAverageBase(const word &name, const objectRegistry &obr, const dictionary &dict, stateFunctionObject &state, const bool writeToFile=true)
Construct from Time and dictionary.
Computes the ensemble- or time-based singular-value average values, with optional windowing,...
void operator=(const valueAverage &)=delete
No copy assignment.
virtual ~valueAverage()=default
Destructor.
valueAverage(const valueAverage &)=delete
No copy construct.
virtual bool read(const dictionary &dict)
Read the function-object dictionary.
TypeName("valueAverage")
Runtime type information.
valueAverage(const word &name, const Time &runTime, const dictionary &dict)
Construct from name, Time and dictionary.
virtual bool execute()
Execute the function-object operations.
virtual bool write()
Write the function-object results.
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.
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68