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-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::adaptiveLinear
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
36 adaptiveLinear.C
37
38\*---------------------------------------------------------------------------*/
39
40#ifndef adaptiveLinear_H
41#define adaptiveLinear_H
42
43#include "relaxationModel.H"
44
45// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46
47namespace Foam
48{
49
50/*---------------------------------------------------------------------------*\
51 Class adaptiveLinear Declaration
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
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// ************************************************************************* //
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.
TypeName("adaptiveLinear")
Runtime type information.
virtual ~adaptiveLinear()=default
Destructor.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Abstract base class for providing relaxation values to the cell motion controller.
engineTime & runTime
Namespace for OpenFOAM.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73