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-2022 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 dictionary& dict
118  );
119 
120 
121  //- Destructor
122  virtual ~linearRamp();
123 
124 
125  // Member Functions
126 
127  //- Return value for time t
128  virtual inline scalar value(const scalar t) const;
129 
130  //- Return the integral between times t1 and t2
131  virtual inline scalar integral
132  (
133  const scalar t1,
134  const scalar t2
135  ) const;
136 
137 
138  // Member Operators
139 
140  //- Disallow default bitwise assignment
141  void operator=(const linearRamp&) = delete;
142 };
143 
144 
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 
147 } // End namespace Function1s
148 } // End namespace Foam
149 
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151 
152 #include "linearRampI.H"
153 
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 
156 #endif
157 
158 // ************************************************************************* //
dictionary dict
virtual scalar integral(const scalar t1, const scalar t2) const
Return the integral between times t1 and t2.
Definition: linearRampI.H:40
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
const word & name() const
Return the name of the entry.
Definition: Function1.C:82
Linear ramp function starting from 0 and increasing linearRamply to 1 from start over the duration an...
Definition: linearRamp.H:114
void operator=(const linearRamp &)=delete
Disallow default bitwise assignment.
virtual scalar value(const scalar t) const
Return value for time t.
Definition: linearRampI.H:31
A class for handling words, derived from string.
Definition: word.H:59
linearRamp(const word &name, const dictionary &dict)
Construct from name and dictionary.
Definition: linearRamp.C:42
virtual ~linearRamp()
Destructor.
Definition: linearRamp.C:53
Namespace for OpenFOAM.