40 Rosenbrock34::a21 = 2,
41 Rosenbrock34::a31 = 48.0/25.0,
42 Rosenbrock34::a32 = 6.0/25.0,
44 Rosenbrock34::c21 = -8,
45 Rosenbrock34::c31 = 372.0/25.0,
46 Rosenbrock34::c32 = 12.0/5.0,
48 Rosenbrock34::c41 = -112.0/125.0,
49 Rosenbrock34::c42 = -54.0/125.0,
50 Rosenbrock34::c43 = -2.0/5.0,
52 Rosenbrock34::b1 = 19.0/9.0,
53 Rosenbrock34::b2 = 1.0/2.0,
54 Rosenbrock34::b3 = 25.0/108.0,
55 Rosenbrock34::b4 = 125.0/108.0,
57 Rosenbrock34::e1 = 34.0/108.0,
58 Rosenbrock34::e2 = 7.0/36.0,
60 Rosenbrock34::e4 = 125.0/108.0,
62 Rosenbrock34::gamma = 1.0/2.0,
64 Rosenbrock34::c3 = 3.0/5.0,
66 Rosenbrock34::d1 = 1.0/2.0,
67 Rosenbrock34::d2 = -3.0/2.0,
68 Rosenbrock34::d3 = 605.0/250.0,
69 Rosenbrock34::d4 = 29.0/250.0;
142 resizeField(pivotIndices_);
163 odes_.jacobian(x0,
y0, li, dfdx_, dfdy_);
165 for (
label i=0; i<n_; i++)
167 for (
label j=0; j<n_; j++)
169 a_(i, j) = -dfdy_(i, j);
172 a_(i, i) += 1.0/(gamma*dx);
180 k1_[i] = dydx0[i] + dx*d1*dfdx_[i];
188 y[i] =
y0[i] + a21*k1_[i];
191 odes_.derivatives(x0 +
c2*dx,
y, li, dydx_);
195 k2_[i] = dydx_[i] + dx*d2*dfdx_[i] + c21*k1_[i]/dx;
203 y[i] =
y0[i] + a31*k1_[i] + a32*k2_[i];
206 odes_.derivatives(x0 + c3*dx,
y, li, dydx_);
210 k3_[i] = dydx_[i] + dx*d3*dfdx_[i] + (c31*k1_[i] + c32*k2_[i])/dx;
218 k4_[i] = dydx_[i] + dx*d4*dfdx_[i]
219 + (c41*k1_[i] + c42*k2_[i] + c43*k3_[i])/dx;
227 y[i] =
y0[i] + b1*k1_[i] + b2*k2_[i] + b3*k3_[i] + b4*k4_[i];
228 err_[i] = e1*k1_[i] + e2*k2_[i] + e4*k4_[i];
231 return normaliseError(
y0,
y, err_);
#define forAll(list, i)
Loop across all elements in list.
Macros for easy insertion into run-time selection tables.
Abstract base-class for ODE system solvers.
virtual bool resize()=0
Resize the ODE solver.
Abstract base class for the systems of ordinary differential equations.
L-stable embedded Rosenbrock ODE solver of order (3)4.
Rosenbrock34(const ODESystem &ode, const dictionary &dict)
Construct from ODESystem.
virtual bool resize()
Resize the ODE solver.
virtual void solve(scalar &x, scalarField &y, const label li, scalar &dxTry) const
Inherit solve from ODESolver.
virtual scalar solve(const scalar x0, const scalarField &y0, const label li, const scalarField &dydx0, const scalar dx, scalarField &y) const =0
Solve a single step dx and return the error.
bool resize(const label n)
Resize the ODE solver.
A list of keyword definitions, which are a keyword followed by any number of values (e....
An ODE solver for chemistry.
const dimensionedScalar c2
Second radiation constant: default SI units: [m K].
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
addToRunTimeSelectionTable(polyPatch, mergedCyclicPolyPatch, word)
dimensionedScalar y0(const dimensionedScalar &ds)
void LUBacksubstitute(const scalarSquareMatrix &luMmatrix, const labelList &pivotIndices, List< Type > &source)
LU back-substitution with given source, returning the solution.
void LUDecompose(scalarSquareMatrix &matrix, labelList &pivotIndices)
LU decompose the matrix with pivoting.
defineTypeNameAndDebug(combustionModel, 0)