CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

Error in the implementation of chemistryModel::jacobian?

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   April 1, 2014, 09:05
Default Error in the implementation of chemistryModel::jacobian?
  #1
New Member
 
Bjorn Waldheim
Join Date: Nov 2013
Posts: 1
Rep Power: 0
flowfarter is on a distinguished road
Hi,

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& dcdt,
scalarSquareMatrix& dfdc
) const
{
....

scalarField c2(nSpecie_, 0.0);
forAll(c2, i)
{
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?
flowfarter is offline   Reply With Quote

Reply

Tags
chemistry, implementation, numerical scheme, odesolver, reactingfoam

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenFOAM141dev A new implementation of dynamicKistlerGammaContactAngle eberberovic OpenFOAM Running, Solving & CFD 14 November 4, 2014 06:45
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


All times are GMT -4. The time now is 01:22.