38 rodas23::d1 = 1.0/2.0,
39 rodas23::d2 = 3.0/2.0,
47 rodas23::c43 = -8.0/3.0,
48 rodas23::gamma = 1.0/2.0;
114 a_(i, j) = -dfdy_(i, j);
117 a_(i, i) += 1.0/(gamma*dx);
125 k1_[i] = dydx0[i] + dx*d1*dfdx_[i];
133 k2_[i] = dydx0[i] + dx*d2*dfdx_[i] + c21*k1_[i]/dx;
142 y[i] = y0[i] + dy_[i];
149 k3_[i] = dydx_[i] + (c31*k1_[i] + c32*k2_[i])/dx;
158 y[i] = y0[i] + dy_[i];
165 err_[i] = dydx_[i] + (c41*k1_[i] + c42*k2_[i] + c43*k3_[i])/dx;
172 y[i] = y0[i] + dy_[i] + err_[i];
virtual scalar solve(const scalar x0, const scalarField &y0, const scalarField &dydx0, const scalar dx, scalarField &y) const =0
Solve a single step dx and return the error.
#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.
rodas23(const ODESystem &ode, const dictionary &dict)
Construct from ODESystem.
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.
An ODE solver for chemistry.
Macros for easy insertion into run-time selection tables.
virtual void jacobian(const scalar x, const scalarField &y, scalarField &dfdx, scalarSquareMatrix &dfdy) const =0
Calculate the Jacobian of the system.
bool resize(const label n)
Resize the ODE solver.
void resizeMatrix(scalarSquareMatrix &m) const
const ODESystem & odes_
Reference to ODESystem.
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
virtual bool resize()
Resize the ODE solver.
defineTypeNameAndDebug(combustionModel, 0)
scalar normalizeError(const scalarField &y0, const scalarField &y, const scalarField &err) const
Return the nomalized scalar error.
Abstract base-class for ODE system solvers.
static void resizeField(UList< Type > &f, const label n)
label n_
Size of the ODESystem (adjustable)
virtual void derivatives(const scalar x, const scalarField &y, scalarField &dydx) const =0
Calculate the derivatives in dydx.
virtual 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.
void LUBacksubstitute(const scalarSquareMatrix &luMmatrix, const labelList &pivotIndices, List< Type > &source)
LU back-substitution with given source, returning the solution.