Public Member Functions | Private Attributes | Static Private Attributes
RKCK45 Class Reference

4/5th Order Cash-Karp Runge-Kutta ODE solver. More...

Inheritance diagram for RKCK45:
Inheritance graph
[legend]
Collaboration diagram for RKCK45:
Collaboration graph
[legend]

Public Member Functions

 TypeName ("RKCK45")
 Runtime type information. More...
 
 RKCK45 (const ODESystem &ode, const dictionary &dict)
 Construct from ODE. More...
 
scalar solve (const scalar x0, const scalarField &y0, const scalarField &dydx0, const scalar dx, scalarField &y) const
 Solve a single step dx and return the error. More...
 
void solve (scalar &x, scalarField &y, scalar &dxTry) const
 Solve the ODE system and the update the state. More...
 
virtual void solve (scalar &x, scalarField &y, scalar &dxTry) const
 Inherit solve from ODESolver. More...
 
virtual void solve (scalar &x, scalarField &y, stepState &step) const
 Inherit solve from ODESolver. More...
 
virtual void solve (const scalar xStart, const scalar xEnd, scalarField &y, scalar &dxEst) const
 Inherit solve from ODESolver. More...
 
- Public Member Functions inherited from ODESolver
 TypeName ("ODESolver")
 Runtime type information. More...
 
 declareRunTimeSelectionTable (autoPtr, ODESolver, dictionary,(const ODESystem &ode, const dictionary &dict),(ode, dict))
 
 ODESolver (const ODESystem &ode, const dictionary &dict)
 Construct for given ODESystem. More...
 
 ODESolver (const ODESystem &ode, const scalarField &absTol, const scalarField &relTol)
 Construct for given ODESystem specifying tolerances. More...
 
virtual ~ODESolver ()
 Destructor. More...
 
scalarFieldabsTol ()
 
scalarFieldrelTol ()
 
virtual void solve (scalar &x, scalarField &y, stepState &step) const
 Solve the ODE system as far as possible upto dxTry. More...
 
virtual void solve (const scalar xStart, const scalar xEnd, scalarField &y, scalar &dxEst) const
 Solve the ODE system from xStart to xEnd, update the state. More...
 
- Public Member Functions inherited from adaptiveSolver
 adaptiveSolver (const ODESystem &ode, const dictionary &dict)
 Construct from ODESystem. More...
 
virtual ~adaptiveSolver ()
 Destructor. More...
 
void solve (const ODESystem &ode, scalar &x, scalarField &y, scalar &dxTry) const
 Solve the ODE system and the update the state. More...
 

Private Attributes

scalarField yTemp_
 
scalarField k2_
 
scalarField k3_
 
scalarField k4_
 
scalarField k5_
 
scalarField k6_
 
scalarField err_
 Error-estimate field. More...
 

Static Private Attributes

static const scalar c2 = 1.0/5.0
 RKCK Constants. More...
 
static const scalar c3 = 3.0/10.0
 
static const scalar c4 = 3.0/5.0
 
static const scalar c5 = 1.0
 
static const scalar c6 = 7.0/8.0
 
static const scalar a21 = 1.0/5.0
 
static const scalar a31 = 3.0/40.0
 
static const scalar a32 = 9.0/40.0
 
static const scalar a41 = 3.0/10.0
 
static const scalar a42 = -9.0/10.0
 
static const scalar a43 = 6.0/5.0
 
static const scalar a51 = -11.0/54.0
 
static const scalar a52 = 5.0/2.0
 
static const scalar a53 = -70.0/27.0
 
static const scalar a54 = 35.0/27.0
 
static const scalar a61 = 1631.0/55296.0
 
static const scalar a62 = 175.0/512.0
 
static const scalar a63 = 575.0/13824.0
 
static const scalar a64 = 44275.0/110592.0
 
static const scalar a65 = 253.0/4096.0
 
static const scalar b1 = 37.0/378.0
 
static const scalar b3 = 250.0/621.0
 
static const scalar b4 = 125.0/594.0
 
static const scalar b6 = 512.0/1771.0
 
static const scalar e1 = RKCK45::b1 - 2825.0/27648.0
 
static const scalar e3 = RKCK45::b3 - 18575.0/48384.0
 
static const scalar e4 = RKCK45::b4 - 13525.0/55296.0
 
static const scalar e5 = -277.00/14336.0
 
static const scalar e6 = RKCK45::b6 - 0.25
 

Additional Inherited Members

- Static Public Member Functions inherited from ODESolver
static autoPtr< ODESolverNew (const ODESystem &ode, const dictionary &dict)
 Select null constructed. More...
 
- Protected Member Functions inherited from ODESolver
scalar normalizeError (const scalarField &y0, const scalarField &y, const scalarField &err) const
 Return the nomalized scalar error. More...
 
 ODESolver (const ODESolver &)
 Disallow default bitwise copy construct. More...
 
void operator= (const ODESolver &)
 Disallow default bitwise assignment. More...
 
- Protected Attributes inherited from ODESolver
const ODESystemodes_
 Reference to ODESystem. More...
 
label n_
 Size of the ODESystem. More...
 
scalarField absTol_
 Absolute convergence tolerance per step. More...
 
scalarField relTol_
 Relative convergence tolerance per step. More...
 
label maxSteps_
 The maximum number of sub-steps allowed for the integration step. More...
 

Detailed Description

4/5th Order Cash-Karp Runge-Kutta ODE solver.

References:

    "A variable order Runge-Kutta method for initial value problems
     with rapidly varying right-hand sides"
    Cash, J.R.,
    Karp, A.H.
    ACM Transactions on Mathematical Software, vol. 16, 1990, pp. 201–222.

    "Solving Ordinary Differential Equations I: Nonstiff Problems,
     second edition",
    Hairer, E.,
    Nørsett, S.,
    Wanner, G.,
    Springer-Verlag, Berlin. 1993, ISBN 3-540-56670-8.
Source files

Definition at line 65 of file RKCK45.H.

Constructor & Destructor Documentation

◆ RKCK45()

RKCK45 ( const ODESystem ode,
const dictionary dict 
)

Construct from ODE.

Definition at line 74 of file RKCK45.C.

Member Function Documentation

◆ TypeName()

TypeName ( "RKCK45"  )

Runtime type information.

◆ solve() [1/5]

Foam::scalar solve ( const scalar  x0,
const scalarField y0,
const scalarField dydx0,
const scalar  dx,
scalarField y 
) const
virtual

Solve a single step dx and return the error.

Implements adaptiveSolver.

Definition at line 91 of file RKCK45.C.

References Foam::constant::physicoChemical::c2, forAll, y, and Foam::y0().

Here is the call graph for this function:

◆ solve() [2/5]

void solve ( scalar &  x,
scalarField y,
scalar &  dxTry 
) const
virtual

Solve the ODE system and the update the state.

Reimplemented from ODESolver.

Definition at line 155 of file RKCK45.C.

References adaptiveSolver::solve(), x, and y.

Here is the call graph for this function:

◆ solve() [3/5]

virtual void solve
inline

Inherit solve from ODESolver.

Definition at line 178 of file ODESolver.H.

◆ solve() [4/5]

void solve

Inherit solve from ODESolver.

Definition at line 86 of file ODESolver.C.

◆ solve() [5/5]

void solve

Inherit solve from ODESolver.

Definition at line 99 of file ODESolver.C.

Field Documentation

◆ c2

const scalar c2 = 1.0/5.0
staticprivate

RKCK Constants.

Definition at line 74 of file RKCK45.H.

◆ c3

const scalar c3 = 3.0/10.0
staticprivate

Definition at line 74 of file RKCK45.H.

◆ c4

const scalar c4 = 3.0/5.0
staticprivate

Definition at line 74 of file RKCK45.H.

◆ c5

const scalar c5 = 1.0
staticprivate

Definition at line 74 of file RKCK45.H.

◆ c6

const scalar c6 = 7.0/8.0
staticprivate

Definition at line 74 of file RKCK45.H.

◆ a21

const scalar a21 = 1.0/5.0
staticprivate

Definition at line 75 of file RKCK45.H.

◆ a31

const scalar a31 = 3.0/40.0
staticprivate

Definition at line 75 of file RKCK45.H.

◆ a32

const scalar a32 = 9.0/40.0
staticprivate

Definition at line 75 of file RKCK45.H.

◆ a41

const scalar a41 = 3.0/10.0
staticprivate

Definition at line 75 of file RKCK45.H.

◆ a42

const scalar a42 = -9.0/10.0
staticprivate

Definition at line 75 of file RKCK45.H.

◆ a43

const scalar a43 = 6.0/5.0
staticprivate

Definition at line 75 of file RKCK45.H.

◆ a51

const scalar a51 = -11.0/54.0
staticprivate

Definition at line 75 of file RKCK45.H.

◆ a52

const scalar a52 = 5.0/2.0
staticprivate

Definition at line 75 of file RKCK45.H.

◆ a53

const scalar a53 = -70.0/27.0
staticprivate

Definition at line 75 of file RKCK45.H.

◆ a54

const scalar a54 = 35.0/27.0
staticprivate

Definition at line 75 of file RKCK45.H.

◆ a61

const scalar a61 = 1631.0/55296.0
staticprivate

Definition at line 76 of file RKCK45.H.

◆ a62

const scalar a62 = 175.0/512.0
staticprivate

Definition at line 76 of file RKCK45.H.

◆ a63

const scalar a63 = 575.0/13824.0
staticprivate

Definition at line 76 of file RKCK45.H.

◆ a64

const scalar a64 = 44275.0/110592.0
staticprivate

Definition at line 76 of file RKCK45.H.

◆ a65

const scalar a65 = 253.0/4096.0
staticprivate

Definition at line 76 of file RKCK45.H.

◆ b1

const scalar b1 = 37.0/378.0
staticprivate

Definition at line 77 of file RKCK45.H.

◆ b3

const scalar b3 = 250.0/621.0
staticprivate

Definition at line 77 of file RKCK45.H.

◆ b4

const scalar b4 = 125.0/594.0
staticprivate

Definition at line 77 of file RKCK45.H.

◆ b6

const scalar b6 = 512.0/1771.0
staticprivate

Definition at line 77 of file RKCK45.H.

◆ e1

const scalar e1 = RKCK45::b1 - 2825.0/27648.0
staticprivate

Definition at line 78 of file RKCK45.H.

◆ e3

const scalar e3 = RKCK45::b3 - 18575.0/48384.0
staticprivate

Definition at line 78 of file RKCK45.H.

◆ e4

const scalar e4 = RKCK45::b4 - 13525.0/55296.0
staticprivate

Definition at line 78 of file RKCK45.H.

◆ e5

const scalar e5 = -277.00/14336.0
staticprivate

Definition at line 78 of file RKCK45.H.

◆ e6

const scalar e6 = RKCK45::b6 - 0.25
staticprivate

Definition at line 78 of file RKCK45.H.

◆ yTemp_

scalarField yTemp_
mutableprivate

Definition at line 81 of file RKCK45.H.

◆ k2_

scalarField k2_
mutableprivate

Definition at line 82 of file RKCK45.H.

◆ k3_

scalarField k3_
mutableprivate

Definition at line 83 of file RKCK45.H.

◆ k4_

scalarField k4_
mutableprivate

Definition at line 84 of file RKCK45.H.

◆ k5_

scalarField k5_
mutableprivate

Definition at line 85 of file RKCK45.H.

◆ k6_

scalarField k6_
mutableprivate

Definition at line 86 of file RKCK45.H.

◆ err_

scalarField err_
mutableprivate

Error-estimate field.

Definition at line 89 of file RKCK45.H.


The documentation for this class was generated from the following files: