CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Fluent UDF and Scheme Programming

UDF for viscous resistance for porous media with time variable

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

Reply
 
LinkBack Thread Tools Display Modes
Old   November 24, 2011, 05:16
Exclamation UDF for viscous resistance for porous media with time variable
  #1
New Member
 
Join Date: Oct 2011
Posts: 14
Rep Power: 5
benson621 is on a distinguished road
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.
benson621 is offline   Reply With Quote

Old   November 24, 2011, 08:25
Default
  #2
Senior Member
 
Amir's Avatar
 
Amir
Join Date: May 2009
Location: Shiraz, Iran
Posts: 739
Blog Entries: 1
Rep Power: 14
Amir is on a distinguished road
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
Amir is offline   Reply With Quote

Old   November 24, 2011, 12:59
Default
  #3
New Member
 
Join Date: Oct 2011
Posts: 14
Rep Power: 5
benson621 is on a distinguished road
Quote:
Originally Posted by Amir View Post
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
benson621 is offline   Reply With Quote

Reply

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
Multiphase Porous Media Flow - Convergence Issues VT_Bromley FLUENT 5 March 23, 2011 11:38
DPM UDF particle position using the macro P_POS(p)[i] dm2747 FLUENT 0 April 17, 2009 01:29
IcoFoam parallel woes msrinath80 OpenFOAM Running, Solving & CFD 9 July 22, 2007 02:58
Could anybody help me see this error and give help liugx212 OpenFOAM Running, Solving & CFD 3 January 4, 2006 19:07
variable versus time Cesare CFX 1 September 27, 2004 11:00


All times are GMT -4. The time now is 10:39.