37 Rosenbrock12::gamma = 1 + 1.0/
std::sqrt(2.0),
38 Rosenbrock12::a21 = 1.0/gamma,
39 Rosenbrock12::c2 = 1.0,
40 Rosenbrock12::c21 = -2.0/gamma,
41 Rosenbrock12::b1 = (3.0/2.0)/gamma,
42 Rosenbrock12::b2 = (1.0/2.0)/gamma,
43 Rosenbrock12::e1 = b1 - 1.0/gamma,
44 Rosenbrock12::e2 = b2,
45 Rosenbrock12::d1 = gamma,
46 Rosenbrock12::d2 = -gamma;
82 resizeField(pivotIndices_);
103 odes_.jacobian(x0,
y0, li, dfdx_, dfdy_);
105 for (
label i=0; i<n_; i++)
107 for (
label j=0; j<n_; j++)
109 a_(i, j) = -dfdy_(i, j);
112 a_(i, i) += 1.0/(gamma*dx);
120 k1_[i] = dydx0[i] + dx*d1*dfdx_[i];
128 y[i] =
y0[i] + a21*k1_[i];
131 odes_.derivatives(x0 +
c2*dx,
y, li, dydx_);
135 k2_[i] = dydx_[i] + dx*d2*dfdx_[i] + c21*k1_[i]/dx;
143 y[i] =
y0[i] + b1*k1_[i] + b2*k2_[i];
144 err_[i] = e1*k1_[i] + e2*k2_[i];
147 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 (1)2.
Rosenbrock12(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.
dimensionedScalar sqrt(const dimensionedScalar &ds)
defineTypeNameAndDebug(combustionModel, 0)