The open source CFD toolbox
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-------------------------------------------------------------------------------
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
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
27Class
29
30Description
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
35SourceFiles
37
38\*---------------------------------------------------------------------------*/
39
42
43#include "relaxationModel.H"
44
45// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46
47namespace Foam
48{
49
50/*---------------------------------------------------------------------------*\
52\*---------------------------------------------------------------------------*/
55:
56 public relaxationModel
57{
58private:
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
77public:
78
79 //- Runtime type information
81
82 // Constructors
83
84 //- Construct from components
86 (
87 const dictionary& relaxationDict,
88 const Time& runTime
89 );
90
91
92 //- Destructor
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// ************************************************************************* //
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:80
Produces a linear ramp which adapts its gradient to changes in endTime and deltaT to always arrive at...
virtual scalar relaxation()
Return the current relaxation coefficient.
adaptiveLinear(const dictionary &relaxationDict, const Time &runTime)
Construct from components.