linearRamp.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) 2017-2024 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::Function1s::linearRamp
26 
27 Description
28  Linear ramp function starting from 0 and increasing linearRamply to 1 from
29  \c start over the \c duration and remaining at 1 thereafter.
30 
31 Usage
32  \verbatim
33  <name> linearRamp;
34  <name>Coeffs
35  {
36  start 10;
37  duration 20;
38  }
39  \endverbatim
40  or
41  \verbatim
42  <name>
43  {
44  type linearRamp;
45  start 10;
46  duration 20;
47  }
48  \endverbatim
49  or including a constant scaling factor:
50  \verbatim
51  <name>
52  {
53  type scale;
54 
55  scale
56  {
57  type linearRamp;
58 
59  start 0;
60  duration 10;
61  }
62 
63  value 100;
64  }
65  \endverbatim
66  for more details of scaling the ramp see Foam::Function1s::Scale.
67 
68  Where:
69  \table
70  Property | Description | Required | Default value
71  start | Start time | no | 0
72  duration | Duration | yes |
73  \endtable
74 
75 See also
76  Foam::Function1s::Ramp
77  Foam::Function1s::Scale
78 
79 SourceFiles
80  linearRamp.C
81 
82 \*---------------------------------------------------------------------------*/
83 
84 #ifndef linearRamp_H
85 #define linearRamp_H
86 
87 #include "Ramp.H"
88 
89 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
90 
91 namespace Foam
92 {
93 namespace Function1s
94 {
95 
96 /*---------------------------------------------------------------------------*\
97  Class linearRamp Declaration
98 \*---------------------------------------------------------------------------*/
99 
100 class linearRamp
101 :
102  public Ramp<linearRamp>
103 {
104 
105 public:
106 
107  // Runtime type information
108  TypeName("linearRamp");
109 
110 
111  // Constructors
112 
113  //- Construct from name and dictionary
115  (
116  const word& name,
117  const unitConversions& units,
118  const dictionary& dict
119  );
120 
121 
122  //- Destructor
123  virtual ~linearRamp();
124 
125 
126  // Member Functions
127 
128  //- Return value for time t
129  virtual inline scalar value(const scalar t) const;
130 
131  //- Return the integral between times t1 and t2
132  virtual inline scalar integral
133  (
134  const scalar t1,
135  const scalar t2
136  ) const;
137 
138 
139  // Member Operators
140 
141  //- Disallow default bitwise assignment
142  void operator=(const linearRamp&) = delete;
143 };
144 
145 
146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147 
148 } // End namespace Function1s
149 } // End namespace Foam
150 
151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 
153 #include "linearRampI.H"
154 
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 
157 #endif
158 
159 // ************************************************************************* //
const word & name() const
Return the name of the entry.
Definition: Function1.C:78
Linear ramp function starting from 0 and increasing linearRamply to 1 from start over the duration an...
Definition: linearRamp.H:117
virtual ~linearRamp()
Destructor.
Definition: linearRamp.C:54
virtual scalar value(const scalar t) const
Return value for time t.
Definition: linearRampI.H:31
virtual scalar integral(const scalar t1, const scalar t2) const
Return the integral between times t1 and t2.
Definition: linearRampI.H:40
void operator=(const linearRamp &)=delete
Disallow default bitwise assignment.
linearRamp(const word &name, const unitConversions &units, const dictionary &dict)
Construct from name and dictionary.
Definition: linearRamp.C:42
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
const HashTable< unitConversion > & units()
Get the table of unit conversions.
dictionary dict