CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   Volumatric reaction rate UDF (http://www.cfd-online.com/Forums/fluent/80703-volumatric-reaction-rate-udf.html)

elmcmaster October 4, 2010 09:45

Volumatric reaction rate UDF
 
Hi,

I am having a bit of trouble deciphering the UDF manual in fluent when it shows the define_v_rate for volumetric reaction rate.

They show that its possible to first calulate the arrenhius constant for the reaction at whatever local temperature its at by using some code, but i cant work out what it means.

Essentially i want to have contained within the UDF a way of calulating the Arrenius constant for variable temperature, a way of calculating the equlibrium contsant as a function of temperature and calulating the mole fraction based on partial pressure.

I dont know what to do!

Any help would be greatly appreciated.

elmcmaster October 4, 2010 10:45

I take it that it has something to do with the thread pointer or cell pointer, but i can find anywhere in the manual explaining it!

Arrrrgh!

Laci October 4, 2010 10:56

I think it's much easier import chemkin files (kinetics and thermo data), than write udf. :) Have you tried?

elmcmaster October 5, 2010 05:19

I dont have chemkin

Laci October 5, 2010 05:24

It is free for all Fluent users, who has permission for the Fluent 6.1 or later version.

Allan Walsh October 5, 2010 11:02

Just work through the math described by the computer code. It may seem a little convuluted since the UDF has to loop through each species in each reaction.
Start simple, and work up.
I would not advise even trying to use a UDF for a volumetric reaction rate unless you have a few weeks of time to play with it. If you don't have the time, rework your equation to fit the standard Fluent format and deal with any inaccuracies. Good luck.

elmcmaster October 5, 2010 11:26

Thanks for the tips, basically i have a rate equation:

1. r=k1Ca^aCb^b-(1/Ke)Cc^cCd^d

but need to caclulate arrhenius rate constant(related to k1) and equilibrium constant, Ke, which vary as functions of temperature, t,they are of the form:

2. Arrhenius function, k1 = k0e^(-E/Rt)

3. Equilibrium function, approximated by (a/x(t)-b)

I know how to do this say in matlab or excel or c++ but within the udf i dont know how to address the value of local temperature as a varible in these functions to calculate the needed vaules for the constants and subsequentlly an accurate localised value for the rate, which is necessary for what im working on now and in the next year in my final year as PhD sutdent.

Thanks,

Michael
:)

Allan Walsh October 5, 2010 16:57

The variable for temperature is just C_T(c,t,) where c is the cell and t is the thread. Have you had a chance to look at the UDF examples for the define volume reaction rate? This is quite helpful. Good luck.

elmcmaster October 6, 2010 05:22

Hey, thanks Allen, that seems to work, ill need to do some tests though to ensure it working correctly.

If i need to access local pressure and concentrations of species what would i do then?

Pressure= C_P(c,t)?

reactant with a for loop and criteria for selecting the right reactant? Ithink it shows you how to do this in the manual.


All times are GMT -4. The time now is 16:55.