All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
adaptiveLinear.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) 2012-2019 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::adaptiveLinear
26 
27 Description
28  Produces a linear ramp which adapts its gradient to changes in
29  endTime and deltaT to always arrive at the relaxationEnd value at the end of
30  the run
31 
32 SourceFiles
33  adaptiveLinear.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef adaptiveLinear_H
38 #define adaptiveLinear_H
39 
40 #include "relaxationModel.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class adaptiveLinear Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 class adaptiveLinear
52 :
53  public relaxationModel
54 {
55 
56 private:
57 
58  // Private Data
59 
60  //- Relaxation coefficient at the start of the iteration sequence.
61  scalar relaxationStart_;
62 
63  //- Relaxation coefficient at the end of the iteration sequence.
64  scalar relaxationEnd_;
65 
66  //- Store the time when the last request was made for relaxation,
67  // prevents multiple calls to relaxation in a timestep from
68  // incrementing the value
69  scalar lastTimeValue_;
70 
71  //- Current relaxation value
72  scalar relaxation_;
73 
74 
75 public:
76 
77  //- Runtime type information
78  TypeName("adaptiveLinear");
79 
80  // Constructors
81 
82  //- Construct from components
84  (
85  const dictionary& relaxationDict,
86  const Time& runTime
87  );
88 
89 
90  //- Destructor
91  virtual ~adaptiveLinear()
92  {}
93 
94 
95  // Member Functions
96 
97  //- Return the current relaxation coefficient
98  virtual scalar relaxation();
99 };
100 
101 
102 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
103 
104 } // End namespace Foam
105 
106 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
107 
108 #endif
109 
110 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
engineTime & runTime
Produces a linear ramp which adapts its gradient to changes in endTime and deltaT to always arrive at...
adaptiveLinear(const dictionary &relaxationDict, const Time &runTime)
Construct from components.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:68
TypeName("adaptiveLinear")
Runtime type information.
virtual ~adaptiveLinear()
Destructor.
virtual scalar relaxation()
Return the current relaxation coefficient.
Abstract base class for providing relaxation values to the cell motion controller.
Namespace for OpenFOAM.