adaptiveLinear.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2012-2015 OpenFOAM Foundation
9  Copyright (C) 2018 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::adaptiveLinear
29 
30 Description
31  Produces a linear ramp which adapts its gradient to changes in
32  endTime and deltaT to always arrive at the relaxationEnd value at the end of
33  the run
34 
35 SourceFiles
36  adaptiveLinear.C
37 
38 \*---------------------------------------------------------------------------*/
39 
40 #ifndef adaptiveLinear_H
41 #define adaptiveLinear_H
42 
43 #include "relaxationModel.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class adaptiveLinear Declaration
52 \*---------------------------------------------------------------------------*/
53 
54 class adaptiveLinear
55 :
56  public relaxationModel
57 {
58 private:
59 
60  // Private data
61 
62  //- Relaxation coefficient at the start of the iteration sequence.
63  scalar relaxationStart_;
64 
65  //- Relaxation coefficient at the end of the iteration sequence.
66  scalar relaxationEnd_;
67 
68  //- Store the time when the last request was made for relaxation,
69  // prevents multiple calls to relaxation in a timestep from
70  // incrementing the value
71  scalar lastTimeValue_;
72 
73  //- Current relaxation value
74  scalar relaxation_;
75 
76 
77 public:
78 
79  //- Runtime type information
80  TypeName("adaptiveLinear");
81 
82  // Constructors
83 
84  //- Construct from components
86  (
87  const dictionary& relaxationDict,
88  const Time& runTime
89  );
90 
91 
92  //- Destructor
93  virtual ~adaptiveLinear() = default;
94 
95 
96  // Member Functions
97 
98  //- Return the current relaxation coefficient
99  virtual scalar relaxation();
100 };
101 
102 
103 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
104 
105 } // End namespace Foam
106 
107 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
108 
109 #endif
110 
111 // ************************************************************************* //
Foam::adaptiveLinear::relaxation
virtual scalar relaxation()
Return the current relaxation coefficient.
runTime
engineTime & runTime
Definition: createEngineTime.H:13
Foam::adaptiveLinear::adaptiveLinear
adaptiveLinear(const dictionary &relaxationDict, const Time &runTime)
Construct from components.
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:73
Foam::adaptiveLinear::~adaptiveLinear
virtual ~adaptiveLinear()=default
Destructor.
Foam::adaptiveLinear
Produces a linear ramp which adapts its gradient to changes in endTime and deltaT to always arrive at...
Definition: adaptiveLinear.H:53
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::adaptiveLinear::TypeName
TypeName("adaptiveLinear")
Runtime type information.
relaxationModel.H
Foam::relaxationModel
Abstract base class for providing relaxation values to the cell motion controller.
Definition: relaxationModel.H:55