CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   ScalerField as a reaction rate (https://www.cfd-online.com/Forums/openfoam-solving/97682-scalerfield-reaction-rate.html)

Mostafa February 22, 2012 11:43

ScalerField as a reaction rate
 
Dear All

I am going to use the incident radiation as a part of the chemical reaction rate. As I know the solvers such as reactingfoam get a constant rate not a scalerfield. I wonder if there is any way to introduce a scalerfield as a reaction rate in the chemical solvers.
Thanks in advance for your help.

Best Regards
MM

nimasam April 6, 2012 15:27

Quote:

Originally Posted by Mostafa (Post 345767)
Dear All
constant rate not a scalerfield

hi dear mostafa
your question is too general, at least post the equation of your reaction, in general, the answer of your question is almost yes

Mostafa April 6, 2012 16:01

Quote:

Originally Posted by nimasam (Post 353497)
hi dear mostafa
your question is too general, at least post the equation of your reaction, in general, the answer of your question is almost yes


Dear Nima
Thank you for your reply. Assume two species H2O2 and OH that dissolved in the water. Water is the inert component and does not appear in the reactions.
There are two reactions:
1-H2O2->2OH rate=k1*G*[H2O2]
2-2OH->H2O2 rate=k2*[OH]*[OH]

Assume that k1 and k2 are constant scalars and G is an available scalar field such as incident radiation.
So we have:
d[H2O2]/dt=k2*[OH]*[OH]-k1*G*[H2O2]
d[OH]/dt=2*k1*G*[H2O2]-2*k2*[OH]*[OH]

Thanks in advance
P.S: In which university you are studying?

nimasam April 6, 2012 16:42

Quote:

Originally Posted by Mostafa (Post 353507)

d[H2O2]/dt=k2*[OH]*[OH]-k1*G*[H2O2]
d[OH]/dt=2*k1*G*[H2O2]-2*k2*[OH]*[OH]

some thing like following code that may solve your problem

Code:

fvScalarMatrix firstEqn
(
    fvm::ddt(X)
  + fvm::div(phi,X)
  + fvm::Sp(2*k*Xw,Xw)
    == 2*k1*Y
);

i study @ tarbiat modares university , and you ?

Mostafa April 8, 2012 08:45

Dear Nima,

Thank you for your reply.
I know that we can define any ODEs in OF and I did it already.
The problem is that the set of transport equations of the species is stiff and does not converge.
It seems that the OF solvers such as reactingFoam use some kind of limiters and adjust the time step in a way that the solution converges.
I want to use the OF chemistry solvers that are used in reactingFoam. I want to modify the reactinFOAM solver and define an arbitrary scalar field for it. Do you know how I should do this?

P.S.: I am studying in University of Tehran

nimasam April 8, 2012 10:13

sorry Dear Mostafa
i did not work with reactingFoam, so i can't be helpful here, you need to dig the code to find where that variable is used and whether it possible to change it or not.
How much are you familiar with OpenFOAM coding?

Mostafa April 22, 2012 10:57

I am quite familiar but there are a lot of things for learning. How about you? What’s your field?


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