CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > ANSYS > FLUENT

UDF for Oxygen Conc in Porous Bed

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

LinkBack Thread Tools Display Modes
Old   September 23, 2003, 14:05
Default UDF for Oxygen Conc in Porous Bed
Posts: n/a
Hi, I had written a UDF to specify the source of oxygen as a function of Bed Height.

I need to modify my UDF for Oxygen source to speficy Oxygen conc Co2 = 0.123 FROM (x= 10, y=10) TO (x=20, y=10) [total x is 0 to 30]

i.e. I WANT TO SPEFICY THE CONSTANT CONC. OF OXYGEN AT CERTAIN LOCATION OF BED along the Length. 1. How can I modify my following UDF for this. I had problem in including the variation with x.

2. Can I simplify this UDF given here.

DEFINE_SOURCE(oxy_source, c, t, dS, eqn) { real x[ND_ND]; real y; float source; C_CENTROID(x,c,t); y =x[1]; /* (h1, h2, h2 and h4 points on Bed height) i.e. y-direction */

if ((y< h1 && y>=h2) || (y< h3 && y >=h4) )

{ dS[eqn]=0;

source=ko2*(Coxy_eqm-C_YI(c,t,0))- kq*C_YI(c,t,1);


else if ((y < h2 && y >=h3) || (y< h4 && y >=h5))

{ dS[eqn]=0;

source= 1.5*ko2*( Coxy_eqm - C_YI(c,t,0));


return source; }

All suggestions are Welcome

  Reply With Quote

Old   September 23, 2003, 23:03
Default Re: UDF for Oxygen Conc in Porous Bed
Posts: n/a

I guess, the function you used,


also returns the x coordinate of the cell. You can then embed that in your 'if' condition.

Hope this helps.

  Reply With Quote

Old   September 24, 2003, 03:01
Default Re: UDF for Oxygen Conc in Porous Bed
Greg Perkins
Posts: n/a
Do you mean a source of O2 injection (ie kg/m3-s) or the concentration itself (kg/m3)??

You have specified a mass source of O2 in kg/m3-s with your udf.

Also if you want to have a proper mass balance you need to add another source = sum of all species sources to the continuity equation.

If you want to fix the O2 concentration then do this by fixing the O2 mass fraction to a specific value through:

source = 1.0e10(Y_O2_I_Want - C_YI(c,t,i_o2)); ds[eqn] = -1.0e10;

  Reply With Quote

Old   September 24, 2003, 05:00
Default Re: UDF for Oxygen Conc in Porous Bed
Posts: n/a
Dear CP and Greg, thanks for your suggestions

I want a constant conc. of Oxygen along a Line from x=10 to x=20 (kg/m3) as C_YI(c,t,0)=const. in the domain of the Porous bed.

I can use x=x[0] to get x coordinates.

But I am not able to write/Modify the UDF to take care of above requirement.

  Reply With Quote


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
Porous Media UDF Vamsee FLUENT 4 March 1, 2009 23:45
Porous Media UDF Vamsee FLUENT 0 February 26, 2009 02:01
create solid viscosity UDF in fluidized bed hosseini FLUENT 1 June 22, 2007 12:19
Replace Species Conc. with UDF conc. umesh FLUENT 1 October 14, 2003 07:29
Change porous properties in UDF? Patrik Blix FLUENT 8 September 10, 2000 00:17

All times are GMT -4. The time now is 00:53.