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 -------------------------------------------------------------------------------
10 License
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 
26 Class
27  Foam::functionObjects::setTimeStepFaRegionsFunctionObject
28 
29 Group
30  grpUtilitiesFunctionObjects
31 
32 Description
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 
43 Usage
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 
67 SourceFiles
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 
80 using namespace Foam::regionModels;
81 
82 namespace Foam
83 {
84 namespace functionObjects
85 {
86 
87 /*---------------------------------------------------------------------------*\
88  Class setTimeStepFaRegionsFunctionObject Declaration
89 \*---------------------------------------------------------------------------*/
90 
91 class setTimeStepFaRegionsFunctionObject
92 :
93  public functionObjects::timeFunctionObject
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;
108 
109 
110 public:
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 
130 
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 };
145 
146 
147 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
148 
149 } // End namespace functionObjects
150 } // End namespace Foam
151 
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 
154 #endif
155 
156 // ************************************************************************* //
TypeName
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73
runTime
engineTime & runTime
Definition: createEngineTime.H:13
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::read
bool read(const char *buf, int32_t &val)
Same as readInt32.
Definition: int32.H:108
Foam::functionObjects::timeFunctionObject
Virtual base class for function objects with a reference to Time.
Definition: timeFunctionObject.H:56
timeFunctionObject.H
Foam::functionObjects::setTimeStepFaRegionsFunctionObject
This function object controls the time step for classes of the type regionFaModel....
Definition: setTimeStepFaRegionsFunctionObject.H:108
adjustTimeStep
bool adjustTimeStep
Definition: createTimeControls.H:32
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::vtk::write
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
Definition: foamVtkOutputTemplates.C:36
Foam::name
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
Foam::regionModels
Definition: KinematicSurfaceFilm.H:57
regionFaModel.H