Loading...
Searching...
No Matches
setTimeStepFunctionObject.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-2017 OpenFOAM Foundation
9 Copyright (C) 2019-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::setTimeStepFunctionObject
29
30Group
31 grpUtilitiesFunctionObjects
32
33Description
34 This function object overrides the calculation time step.
35
36 Can only be used with solvers with adjustTimeStep control (e.g.
37 pimpleFoam). It makes no attempt to co-operate with other time step
38 'controllers', e.g. maxCo, other functionObjects. Supports 'enabled'
39 flag but none of the other options 'timeStart', 'timeEnd', 'writeControl'
40 etc.
41
42Usage
43 Minimal example by using \c system/controlDict.functions:
44 \verbatim
45 setTimeStepFO
46 {
47 // Mandatory entries
48 type setTimeStep;
49 libs (utilityFunctionObjects);
50
51 deltaT <Function1<scalar>>; // table ((0 5e-4)(0.01 1e-3));
52
53 // Inherited entries
54 ...
55 }
56 \endverbatim
57
58 where the entries mean:
59 \table
60 Property | Description | Type | Reqd | Deflt
61 type | Type name: setTimeStep | word | yes | -
62 libs | Library name: utilityFunctionObjects | word | yes | -
63 deltaT | Time-step values | Function1<scalar> | yes | -
64 \endtable
65
66 The inherited entries are elaborated in:
67 - \link timeFunctionObject.H \endlink
68 - \link Function1.H \endlink
69
70SourceFiles
71 setTimeStepFunctionObject.C
72
73\*---------------------------------------------------------------------------*/
74
75#ifndef Foam_functionObjects_setTimeStepFunctionObject_H
76#define Foam_functionObjects_setTimeStepFunctionObject_H
77
78#include "timeFunctionObject.H"
79#include "Function1.H"
80
81// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
82
83namespace Foam
84{
85namespace functionObjects
86{
87
88/*---------------------------------------------------------------------------*\
89 Class setTimeStepFunctionObject Declaration
90\*---------------------------------------------------------------------------*/
91
93:
94 public functionObjects::timeFunctionObject
95{
96 // Private Member Data
97
98 //- Time step function/table
99 autoPtr<Function1<scalar>> timeStepPtr_;
100
101
102 // Private Member Functions
103
104 //- No copy construct
105 setTimeStepFunctionObject(const setTimeStepFunctionObject&) = delete;
106
107 //- No copy assignment
108 void operator=(const setTimeStepFunctionObject&) = delete;
109
110
111public:
112
113 //- Runtime type information
114 TypeName("setTimeStep");
115
116
117 // Constructors
118
119 //- Construct from components
120 setTimeStepFunctionObject
121 (
122 const word& name,
123 const Time& runTime,
124 const dictionary& dict
125 );
126
127
128 // Destructor
129 virtual ~setTimeStepFunctionObject() = default;
130
131
132 // Member Functions
133
134 //- Called at the end of Time::adjustDeltaT() if adjustTime is true
135 virtual bool adjustTimeStep();
136
137 //- Read the function-object dictionary
138 virtual bool read(const dictionary& dict);
139
140 //- Execute the function-object operations (no-op)
141 virtual bool execute();
142
143 //- Write the function-object results (no-op)
144 virtual bool write();
145};
146
147
148// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149
150} // End namespace functionObjects
151} // End namespace Foam
152
153// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154
155#endif
156
157// ************************************************************************* //
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition Time.H:75
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
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.
This function object overrides the calculation time step.
TypeName("setTimeStep")
Runtime type information.
virtual bool read(const dictionary &dict)
Read the function-object dictionary.
virtual bool adjustTimeStep()
Called at the end of Time::adjustDeltaT() if adjustTime is true.
virtual bool execute()
Execute the function-object operations (no-op).
virtual bool write()
Write the function-object results (no-op).
Virtual base class for function objects with a reference to Time.
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