adjustTimeStepToCombustion.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) 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::adjustTimeStepToCombustion
26 
27 Description
28  Returns the minimum bulk reaction time scale
29 
30  This allows the solver to temporally resolve chemical changes, in order to
31  better couple the chemistry and transport, or to improve the time-accuracy
32  of post-processing.
33 
34  Note that this function only does anything if time step adjustment is
35  enabled in the controlDict.
36 
37  Example of function object specification:
38  \verbatim
39  adjustTimeStepToCombustion
40  {
41  type adjustTimeStepToCombustion;
42  libs ("libcombustionModels.so");
43  maxCo 0.1;
44  extrapolate no;
45  }
46  \endverbatim
47 
48 Usage
49  \table
50  Property | Description | Required | Default value
51  type | type name: adjustTimeStepToCombustion | yes |
52  phase | name of the reacting phase | no |
53  maxCo | maximum combustion "Courant" number | no | 1
54  extrapolate | try to extrapolate decreases | no | false
55  \endtable
56 
57 SourceFiles
58  adjustTimeStepToCombustion.C
59 
60 \*---------------------------------------------------------------------------*/
61 
62 #ifndef functionObjects_adjustTimeStepToCombustion_H
63 #define functionObjects_adjustTimeStepToCombustion_H
64 
65 #include "regionFunctionObject.H"
66 #include "timeIOdictionary.H"
67 
68 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
69 
70 namespace Foam
71 {
72 namespace functionObjects
73 {
74 
75 /*---------------------------------------------------------------------------*\
76  Class adjustTimeStepToCombustion Declaration
77 \*---------------------------------------------------------------------------*/
78 
79 class adjustTimeStepToCombustion
80 :
81  public regionFunctionObject
82 {
83  // Private Data
84 
85  //- Name of the phase
86  word phaseName_;
87 
88  //- Maximum combustion "Courant" number. The maximum fraction of the
89  // total combustion time-scale that should be evolved in a single
90  // time-step.
91  scalar maxCo_;
92 
93  //- Extrapolate reductions in time-step to try and better catch the
94  // "onset" of reaction. Can lead to time-step oscillation.
95  bool extrapolate_;
96 
97  //- Do we have the previous combustion time-step?
98  mutable bool haveCombustionDeltaT0_;
99 
100  //- The previous combustion time-step
101  mutable scalar combustionDeltaT0_;
102 
103 
104  // Private Member Functions
105 
106  //- Get the properties dictionary IO object
108  (
109  const IOobject::readOption& r
110  ) const;
111 
112 public:
113 
114  //- Runtime type information
115  TypeName("adjustTimeStepToCombustion");
116 
117 
118  // Constructors
119 
120  //- Construct from components
122  (
123  const word& name,
124  const Time& runTime,
125  const dictionary& dict
126  );
127 
128  //- Disallow default bitwise copy construction
130 
131 
132  // Destructor
133  virtual ~adjustTimeStepToCombustion();
134 
135 
136  // Member Functions
137 
138  //- Read and reset the timeStep Function1
139  virtual bool read(const dictionary&);
140 
141  //- Return the list of fields required
142  virtual wordList fields() const
143  {
144  return wordList::null();
145  }
146 
147  //- Do nothing
148  virtual bool execute();
149 
150  //- Do nothing
151  virtual bool write();
152 
153  //- Return the minimum combustion time-scale
154  virtual scalar maxDeltaT() const;
155 
156 
157  // Member Operators
158 
159  //- Disallow default bitwise assignment
160  void operator=(const adjustTimeStepToCombustion&) = delete;
161 };
162 
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
166 } // End namespace functionObjects
167 } // End namespace Foam
168 
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 
171 #endif
172 
173 // ************************************************************************* //
readOption
Enumeration defining the read options.
Definition: IOobject.H:117
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
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 minimum bulk reaction time scale.
virtual wordList fields() const
Return the list of fields required.
virtual scalar maxDeltaT() const
Return the minimum combustion time-scale.
void operator=(const adjustTimeStepToCombustion &)=delete
Disallow default bitwise assignment.
TypeName("adjustTimeStepToCombustion")
Runtime type information.
adjustTimeStepToCombustion(const word &name, const Time &runTime, const dictionary &dict)
Construct from components.
virtual bool read(const dictionary &)
Read and reset the timeStep Function1.
Templated form of IOobject providing type information for file reading and header type checking.
Definition: IOobject.H:531
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
dictionary dict