fluidMaxDeltaT.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2022-2023 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::functionObjects::fluidMaxDeltaT
26 
27 Description
28  Returns the maximum time-step evaluated from time-dependent
29  maximum Courant number and maximum time-step specifications.
30 
31  The \c maxCo and \c maxDeltaT are provided as \c Function1 of time,
32  supporting constant, tabulated and functional specifications.
33 
34 Usage
35  Example of a time-dependent maximum Courant number:
36  \verbatim
37  fluidMaxDeltaT
38  {
39  type fluidMaxDeltaT;
40 
41  maxCo table
42  (
43  (0 0.2)
44  (0.6 0.2)
45  (0.7 0.1)
46  );
47 
48  maxDeltaT 1;
49  }
50  \endverbatim
51 
52 See also
53  Foam::functionObject
54  Foam::functionObjects::fvMeshFunctionObject
55  Foam::Function1
56 
57 SourceFiles
58  fluidMaxDeltaT.C
59 
60 \*---------------------------------------------------------------------------*/
61 
62 #ifndef fluidMaxDeltaT_H
63 #define fluidMaxDeltaT_H
64 
65 #include "fvMeshFunctionObject.H"
66 #include "Function1.H"
67 
68 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
69 
70 namespace Foam
71 {
72 namespace functionObjects
73 {
74 
75 /*---------------------------------------------------------------------------*\
76  Class fluidMaxDeltaT Declaration
77 \*---------------------------------------------------------------------------*/
78 
79 class fluidMaxDeltaT
80 :
82 {
83  // Private Data
84 
85  //- Max Courant number function/table
86  autoPtr<Function1<scalar>> maxCoPtr_;
87 
88  //- Max time-step function/table
89  autoPtr<Function1<scalar>> maxDeltaTPtr_;
90 
91 
92 public:
93 
94  //- Runtime type information
95  TypeName("fluidMaxDeltaT");
96 
97 
98  // Constructors
99 
100  //- Construct from Time and dictionary
102  (
103  const word& name,
104  const Time& runTime,
105  const dictionary& dict
106  );
107 
108  //- Disallow default bitwise copy construction
109  fluidMaxDeltaT(const fluidMaxDeltaT&) = delete;
110 
111 
112  //- Destructor
113  virtual ~fluidMaxDeltaT();
114 
115 
116  // Member Functions
117 
118  //- Read the controls
119  virtual bool read(const dictionary&);
120 
121  //- Return the list of fields required
122  virtual wordList fields() const
123  {
124  return wordList::null();
125  }
126 
127  //- Execute, currently does nothing
128  virtual bool execute();
129 
130  //- Write the time step value
131  virtual bool write();
132 
133  //- Return the maximum time-step for stable operation
134  virtual scalar maxDeltaT() const;
135 
136 
137  // Member Operators
138 
139  //- Disallow default bitwise assignment
140  void operator=(const fluidMaxDeltaT&) = delete;
141 };
142 
143 
144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145 
146 } // End namespace functionObjects
147 } // End namespace Foam
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
151 #endif
152 
153 // ************************************************************************* //
static const List< word > & null()
Return a null List.
Definition: ListI.H:118
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:76
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
const word & name() const
Return the name of this functionObject.
Returns the maximum time-step evaluated from time-dependent maximum Courant number and maximum time-s...
virtual wordList fields() const
Return the list of fields required.
void operator=(const fluidMaxDeltaT &)=delete
Disallow default bitwise assignment.
virtual scalar maxDeltaT() const
Return the maximum time-step for stable operation.
TypeName("fluidMaxDeltaT")
Runtime type information.
fluidMaxDeltaT(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
virtual bool execute()
Execute, currently does nothing.
virtual bool write()
Write the time step value.
virtual bool read(const dictionary &)
Read the controls.
Specialisation of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
dictionary dict