The open source CFD toolbox
rodas34.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) 2013-2016 OpenFOAM Foundation
9 Copyright (C) 2019 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
28 Foam::rodas34
29
30Group
31 grpODESolvers
32
33Description
34 L-stable, stiffly-accurate embedded Rosenbrock ODE solver of order (3)4.
35
36 Reference:
37 \verbatim
38 Hairer, E., Nørsett, S. P., & Wanner, G. (1996).
39 Solving Ordinary Differential Equations II:
40 Stiff and Differential-Algebraic Problems, second edition",
41 Springer-Verlag, Berlin.
42 \endverbatim
43
44SourceFiles
45 rodas34.C
46
47\*---------------------------------------------------------------------------*/
48
49#ifndef rodas34_H
50#define rodas34_H
51
52#include "ODESolver.H"
54
55// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56
57namespace Foam
58{
59
60/*---------------------------------------------------------------------------*\
61 Class rodas34 Declaration
62\*---------------------------------------------------------------------------*/
64class rodas34
65:
66 public ODESolver,
68{
69 // Private data
70
71 mutable scalarField k1_;
72 mutable scalarField k2_;
73 mutable scalarField k3_;
74 mutable scalarField k4_;
75 mutable scalarField k5_;
76 mutable scalarField dy_;
77 mutable scalarField err_;
78 mutable scalarField dydx_;
79 mutable scalarField dfdx_;
80 mutable scalarSquareMatrix dfdy_;
81 mutable scalarSquareMatrix a_;
82 mutable labelList pivotIndices_;
83
84 static const scalar
85 c2, c3, c4,
86 d1, d2, d3, d4,
87 a21, a31, a32,
88 a41, a42, a43,
89 a51, a52, a53, a54,
90 c21, c31, c32,
91 c41, c42, c43,
92 c51, c52, c53, c54,
93 c61, c62, c63, c64, c65,
94 gamma;
95
96public:
97
98 //- Runtime type information
99 TypeName("rodas34");
100
101
102 // Constructors
103
104 //- Construct from ODESystem
105 rodas34(const ODESystem& ode, const dictionary& dict);
106
107
108 //- Destructor
109 virtual ~rodas34() = default;
110
111
112 // Member Functions
113
114 //- Inherit solve from ODESolver
115 using ODESolver::solve;
116
117 //- Resize the ODE solver
118 virtual bool resize();
119
120 //- Solve a single step dx and return the error
121 virtual scalar solve
122 (
123 const scalar x0,
124 const scalarField& y0,
125 const scalarField& dydx0,
126 const scalar dx,
128 ) const;
129
130 //- Solve the ODE system and the update the state
131 virtual void solve
132 (
133 scalar& x,
134 scalarField& y,
135 scalar& dxTry
136 ) const;
137};
138
139
140// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141
142} // End namespace Foam
143
144// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145
146#endif
147
148// ************************************************************************* //
scalar y
Abstract base-class for ODE system solvers.
Definition: ODESolver.H:57
Abstract base class for the systems of ordinary differential equations.
Definition: ODESystem.H:50
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
An ODE solver for chemistry.
Definition: ode.H:55
L-stable, stiffly-accurate embedded Rosenbrock ODE solver of order (3)4.
Definition: rodas34.H:67
TypeName("rodas34")
Runtime type information.
virtual bool resize()
Resize the ODE solver.
Definition: rodas34.C:99
virtual ~rodas34()=default
Destructor.
Namespace for OpenFOAM.
dimensionedScalar y0(const dimensionedScalar &ds)
dictionary dict
CEqn solve()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73