setTimeStepFaRegionsFunctionObject.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 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::setTimeStepFaRegionsFunctionObject
28
29Group
30 grpUtilitiesFunctionObjects
31
32Description
33 This function object controls the time step for classes of the type
34 \c regionFaModel. It reads \c regionFaMaxCo entry from \c controlDict
35 and evaluate the time step based on the finite area Courant Number.
36
37 Can only be used with solvers using \c adjustTimeStep control (e.g.
38 \c pimpleFoam). It makes no attempt to co-operate with other time step
39 'controllers', e.g. \c maxCo, other functionObjects. Supports \c enabled
40 flag but none of the other options \c timeStart, \c timeEnd, \c writeControl
41 etc.
42
43Usage
44 Example of function object specification to manipulate the time step:
45 \verbatim
46 setTimeStep1
47 {
48 // Mandatory entries
49 type setTimeStepFaRegion;
50
51 // Inherited entries
52 ...
53 }
54 \endverbatim
55
56 where the entries mean:
57 \table
58 Property | Description | Type | Reqd | Deflt
59 type | Type name: setTimeStepFaRegion | word | yes | -
60 enabled | On/off switch | bool | no | yes
61 \endtable
62
63 The inherited entries are elaborated in:
64 - \link timeFunctionObject.H \endlink
65 - \link regionFaModel.H \endlink
66
67SourceFiles
68 setTimeStepFaRegionsFunctionObject.C
69
70\*---------------------------------------------------------------------------*/
71
72#ifndef functionObjects_setTimeStepFaRegionsFunctionObject_H
73#define functionObjects_setTimeStepFaRegionsFunctionObject_H
74
75#include "timeFunctionObject.H"
76#include "regionFaModel.H"
77
78// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
79
80using namespace Foam::regionModels;
81
82namespace Foam
83{
84namespace functionObjects
85{
86
87/*---------------------------------------------------------------------------*\
88 Class setTimeStepFaRegionsFunctionObject Declaration
89\*---------------------------------------------------------------------------*/
90
91class setTimeStepFaRegionsFunctionObject
92:
94{
95 // Private Member Functions
96
97 //- No copy construct
98 setTimeStepFaRegionsFunctionObject
99 (
100 const setTimeStepFaRegionsFunctionObject&
101 ) = delete;
102
103 //- No copy assignment
104 void operator=(const setTimeStepFaRegionsFunctionObject&) = delete;
105
106 //- Return minimum deltaT from fa regions
107 scalar regionDeltaT() const;
109
110public:
111
112 //- Runtime type information
113 TypeName("setTimeStepFaRegion");
114
115
116 // Constructors
117
118 //- Construct from components
120 (
121 const word& name,
122 const Time& runTime,
123 const dictionary& dict
124 );
125
126
127 // Destructor
128 virtual ~setTimeStepFaRegionsFunctionObject() = default;
129
131 // Member Functions
132
133 //- Called at the end of Time::adjustDeltaT() if adjustTime is true
134 virtual bool adjustTimeStep();
135
136 //- Read and set the function object if its data have changed
137 virtual bool read(const dictionary& dict);
138
139 //- Execute does nothing
140 virtual bool execute();
141
142 //- Write does nothing
143 virtual bool write();
144};
146
147// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
148
149} // End namespace functionObjects
150} // End namespace Foam
151
152// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153
154#endif
155
156// ************************************************************************* //
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:80
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.
This function object controls the time step for classes of the type regionFaModel....
TypeName("setTimeStepFaRegion")
Runtime type information.
virtual bool read(const dictionary &dict)
Read and set the function object if its data have changed.
virtual bool adjustTimeStep()
Called at the end of Time::adjustDeltaT() if adjustTime is true.
Virtual base class for function objects with a reference to Time.
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