37 Rosenbrock23::a21 = 1,
38 Rosenbrock23::a31 = 1,
39 Rosenbrock23::a32 = 0,
41 Rosenbrock23::c21 = -1.0156171083877702091975600115545,
42 Rosenbrock23::c31 = 4.0759956452537699824805835358067,
43 Rosenbrock23::c32 = 9.2076794298330791242156818474003,
46 Rosenbrock23::b2 = 6.1697947043828245592553615689730,
47 Rosenbrock23::b3 = -0.4277225654321857332623837380651,
49 Rosenbrock23::e1 = 0.5,
50 Rosenbrock23::e2 = -2.9079558716805469821718236208017,
51 Rosenbrock23::e3 = 0.2235406989781156962736090927619,
53 Rosenbrock23::gamma = 0.43586652150845899941601945119356,
54 Rosenbrock23::c2 = 0.43586652150845899941601945119356,
56 Rosenbrock23::d1 = 0.43586652150845899941601945119356,
57 Rosenbrock23::d2 = 0.24291996454816804366592249683314,
58 Rosenbrock23::d3 = 2.1851380027664058511513169485832;
123 a_(i, j) = -dfdy_(i, j);
126 a_(i, i) += 1.0/(gamma*dx);
134 k1_[i] = dydx0[i] + dx*d1*dfdx_[i];
142 y[i] = y0[i] + a21*k1_[i];
149 k2_[i] = dydx_[i] + dx*d2*dfdx_[i] + c21*k1_[i]/dx;
157 k3_[i] = dydx_[i] + dx*d3*dfdx_[i]
158 + (c31*k1_[i] + c32*k2_[i])/dx;
166 y[i] = y0[i] + b1*k1_[i] + b2*k2_[i] + b3*k3_[i];
167 err_[i] = e1*k1_[i] + e2*k2_[i] + e3*k3_[i];
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Abstract base class for the systems of ordinary differential equations.
virtual bool resize()=0
Resize the ODE solver.
A list of keyword definitions, which are a keyword followed by any number of values (e...
void LUDecompose(scalarSquareMatrix &matrix, labelList &pivotIndices)
LU decompose the matrix with pivoting.
virtual void derivatives(const scalar x, const scalarField &y, const label li, scalarField &dydx) const =0
Calculate the derivatives in dydx.
An ODE solver for chemistry.
scalar normaliseError(const scalarField &y0, const scalarField &y, const scalarField &err) const
Return the normalised scalar error.
Macros for easy insertion into run-time selection tables.
bool resize(const label n)
Resize the ODE solver.
void resizeMatrix(scalarSquareMatrix &m) const
const ODESystem & odes_
Reference to ODESystem.
Rosenbrock23(const ODESystem &ode, const dictionary &dict)
Construct from ODESystem.
virtual scalar solve(const scalar x0, const scalarField &y0, const label li, const scalarField &dydx0, const scalar dx, scalarField &y) const
Solve a single step dx and return the error.
virtual bool resize()
Resize the ODE solver.
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
defineTypeNameAndDebug(combustionModel, 0)
Abstract base-class for ODE system solvers.
virtual void jacobian(const scalar x, const scalarField &y, const label li, scalarField &dfdx, scalarSquareMatrix &dfdy) const =0
Calculate the Jacobian of the system.
static void resizeField(UList< Type > &f, const label n)
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.
label n_
Size of the ODESystem (adjustable)
void LUBacksubstitute(const scalarSquareMatrix &luMmatrix, const labelList &pivotIndices, List< Type > &source)
LU back-substitution with given source, returning the solution.