|April 1, 2014, 09:05||
Error in the implementation of chemistryModel::jacobian?
Join Date: Nov 2013
Posts: 1Rep Power: 0
I had a look at the function calculating the jacobian for the ODE-solvers used for the chemistry in reactingFoam. It's called ODEChemistryModel::jacobian in 2.0.x (which I use) and chemistryModel::jacobian in 2.2.2 (both versions have identical implementation) and also defined in ODE.H in both versions. One of the outputs (in form of a reference to a scalarField) is supposed to be the dertivative of the RHS with respect to the independent variable (dfdx) of a general ODE system:
dydx = f(y(x),x)
This seems to be the case in the solving classes under /src/ODE/, from what I can see how they are using it in the ODE-solution methods. However, in it's implementation (in ODEChemistryModel.C or chemistryModel.C depending on version) it is put equal to the total reaction rate for each species:
template<class CompType, class ThermoType>
void Foam::ODEChemistryModel<CompType, ThermoType>::jacobian
const scalar t,
const scalarField& c,
scalarField c2(nSpecie_, 0.0);
c2[i] = max(c[i], 0.0);
dcdt = omega(c2, T, p);
In the case of the ODE-system describing the evolution of species concentrations with time, the total reaction rate for each species are analogous to rhe RHS (f) in the general ODE-system above. So, to me at least, it seems that ::jacobian calculates the RHS again instead when it is supposed to calculate the time derivative of the RHS (i.e. the time derivative of the total reaction rate for each species). There, is also already a function ::derivatives that calculates the RHS, which the solvers in /src/ODE/ use.
Have I misunderstood something?
|chemistry, implementation, numerical scheme, odesolver, reactingfoam|
|Thread||Thread Starter||Forum||Replies||Last Post|
|OpenFOAM141dev A new implementation of dynamicKistlerGammaContactAngle||eberberovic||OpenFOAM Running, Solving & CFD||23||March 30, 2016 19:57|
|a little confused with the implementation of compressibleInterFoam||su_junwei||OpenFOAM Running, Solving & CFD||2||May 7, 2014 17:33|
|Free CFD code with implementation of Menter's k-omega SST model||nikola_m||Main CFD Forum||1||November 9, 2012 10:39|
|Implementation issues of fvSchemes / laplacianScheme, in particular gaussLaplacianSch||thomek||OpenFOAM Programming & Development||0||October 18, 2010 05:10|
|Please explain the implementation of species transport Eqn in reactingFoam||kallipygian||OpenFOAM Running, Solving & CFD||0||October 13, 2008 07:29|