# UDF for viscous resistance for porous media with time variable

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

November 24, 2011, 05:16
UDF for viscous resistance for porous media with time variable
#1
New Member

Join Date: Oct 2011
Posts: 14
Rep Power: 6
Hello,

i am a new ansys fluent user, but i am now very urgent to demonstrate a flow in porous material. i have a viscous resistance of 5e12 + 2e12 t + 4e9 t^2 (given). but i have no idea to write a UDF to enter this kind of viscous resistance (with time variable), the place i enter the parameter can only allow me to put in a single constant value.

May i ask the easy tutorial for writing the UDF for viscous resistance of 5e12 + 2e12 t + 4e9 t^2?
or some nice guys can even write it to me?

Thank You so much.

I have tried to write this, but error: line 9:invalid type for binary expression: int * pointer to structure.
Quote:
 #include "udf.h" DEFINE_PROFILE(porosity_function, t, nv) { cell_t c; begin_c_loop(c,t) C_PROFILE(c,t,nv) = 5000000000000+2000000000000*t+4000000000*t*t ; end_c_loop(c,t) }

Last edited by benson621; November 24, 2011 at 05:42.

 November 24, 2011, 08:25 #2 Senior Member     Amir Join Date: May 2009 Location: Montreal, QC Posts: 739 Blog Entries: 1 Rep Power: 15 Hi, t is not time here! this is thread index. so replace this: Code: ```#include "udf.h" DEFINE_PROFILE(porosity_function, t, nv) { cell_t c; real time=CURRENT_TIME; begin_c_loop(c,t) { C_PROFILE(c,t,nv) = 5000000000000+2000000000000*time+4000000000*pow(time,2); } end_c_loop(c,t) }``` Bests, __________________ Amir

November 24, 2011, 12:59
#3
New Member

Join Date: Oct 2011
Posts: 14
Rep Power: 6
Quote:
 Originally Posted by Amir Hi, t is not time here! this is thread index. so replace this: Code: ```#include "udf.h" DEFINE_PROFILE(porosity_function, t, nv) { cell_t c; real time=CURRENT_TIME; begin_c_loop(c,t) { C_PROFILE(c,t,nv) = 5000000000000+2000000000000*time+4000000000*pow(time,2); } end_c_loop(c,t) }``` Bests,
i will have try with this. thank you so much

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post VT_Bromley FLUENT 5 March 23, 2011 11:38 dm2747 FLUENT 0 April 17, 2009 01:29 msrinath80 OpenFOAM Running, Solving & CFD 9 July 22, 2007 02:58 liugx212 OpenFOAM Running, Solving & CFD 3 January 4, 2006 19:07 Cesare CFX 1 September 27, 2004 11:00

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