# ScalerField as a reaction rate

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

 February 22, 2012, 12:43 ScalerField as a reaction rate #1 New Member   Mostafa Moghaddami Join Date: Oct 2009 Posts: 13 Rep Power: 9 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

April 6, 2012, 15:27
#2
Senior Member

Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,211
Blog Entries: 1
Rep Power: 17
Quote:
 Originally Posted by Mostafa 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

April 6, 2012, 16:01
#3
New Member

Join Date: Oct 2009
Posts: 13
Rep Power: 9
Quote:
 Originally Posted by nimasam 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]

P.S: In which university you are studying?

April 6, 2012, 16:42
#4
Senior Member

Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,211
Blog Entries: 1
Rep Power: 17
Quote:
 Originally Posted by Mostafa 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 ?

 April 8, 2012, 08:45 #5 New Member   Mostafa Moghaddami Join Date: Oct 2009 Posts: 13 Rep Power: 9 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

 April 8, 2012, 10:13 #6 Senior Member   Nima Samkhaniani Join Date: Sep 2009 Location: Tehran, Iran Posts: 1,211 Blog Entries: 1 Rep Power: 17 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?

 April 22, 2012, 10:57 #7 New Member   Mostafa Moghaddami Join Date: Oct 2009 Posts: 13 Rep Power: 9 I am quite familiar but there are a lot of things for learning. How about you? What’s your field?