CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM (
-   -   Chemical reaction in buoyantPimpleFoam (

mlubej December 17, 2012 05:50

Chemical reaction in buoyantPimpleFoam
Hello everyone,

I am making a custom solver from buoyantPimpleFoam base in which I would like to add (for now) a simple chemical reaction a + b -> c

The dissipation of species (volScalarFields) a and b and formation of c follow the simple relation: di/dt = k(T)*a*b, where k(T) is a constant following the Archenius law k(T) = k0 * e^(-Ea/R/T), where are all constants except T - temperature.

So my problem is using the temperature field to calculate the k(T) in a solver with energy balance (h - hEqn).

I tried defining T in createFields.H as any other volScalarField is defined, but the problem is that the program reads T only in the beginning and it stays the same for the whole simulation.

Thank you for any reply.

mlubej December 18, 2012 05:00

Hello again, I would just like to post the solution to my problem. The running temperature at the h - based (hEqn) solvers can be accessed with the function thermo.T(). So I just wrote T = thermo.T() somewhere in the loop, and now all functions of T work. Example:

fvScalarMatrix aEqn
+ fvm::div(phi, Ca)
- fvm::laplacian(Da, Ca)
+ A*pow(2.7183,(-Ea/R/T))*Ca*Cb*rho


This is the equation for transport of specie a with dissipation.

Best regards

All times are GMT -4. The time now is 20:48.