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

UDF porous bends direction-1 and direction-2

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 3, 2016, 07:04
Default UDF porous bends direction-1 and direction-2
  #1
New Member
 
Nicola Viscanti
Join Date: Apr 2009
Posts: 6
Rep Power: 17
Nicola Viscanti is on a distinguished road
Good morning.
I need to write a UDF to specify direction-1 and direction-2 in a bend porous mean.
I cannot use UDF and so I need your help. I try to explain what UDF must do according with figure.

if z<0.977

Direction-1
x=0
y=0
z=1
Direction-2
x=1
y=0
z=0

else if -1.397<x<1.397

Direction-1
x=1
y=0
z=0
Direction-2
x=0
y=0
z=1

else if x>1.397

Direction-1
x=-(zi-0.9777)/sqrt((xi-1.397)^2+yi^2+(zi-0.977)^2)
y=0
z=(xi-1.397)/sqrt((xi-1.397)^2+yi^2+(zi-0.977)^2)
Direction-2
x=(xi-1.397)/sqrt((xi-1.397)^2+yi^2+(zi-0.977)^2)
y=0
z=(zi-0.9777)/sqrt((xi-1.397)^2+yi^2+(zi-0.977)^2)

else

Direction-1
x=-(zi-0.9777)/sqrt((xi-1.397)^2+yi^2+(zi-0.977)^2)
y=0
z=(xi+1.397)/sqrt((xi-1.397)^2+yi^2+(zi-0.977)^2)
Direction-2
x=(xi+1.397)/sqrt((xi-1.397)^2+yi^2+(zi-0.977)^2)
y=0
z=(zi-0.9777)/sqrt((xi-1.397)^2+yi^2+(zi-0.977)^2)

end if

xi, yi, zi are node coordinates

Thank you in advance.

Nicola
Attached Images
File Type: jpg Immagine.jpg (29.8 KB, 13 views)
Nicola Viscanti is offline   Reply With Quote

Old   February 5, 2016, 17:21
Default
  #2
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
You can use the DEFINE_PROFILE macro to apply porous resistance direction vectors; see example 7 in the UDF manual. The programming language is ANSI C (you'll need to modify the syntax of your conditional statements). The cell centroid coordinates are available with "C_CENTROID(x,c,t);".
`e` is offline   Reply With Quote

Reply


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
WILLING TO PAY/ FREELANCER REQUIRED / small UDF coding force loads over body / 6DOF acasas CFD Freelancers 1 January 23, 2015 08:26
Direction vectors and adsorption in porous zones Toplaa FLUENT 0 August 16, 2013 15:22
Help please UDF flow direction val17lr FLUENT 2 September 4, 2010 06:30
Help: using udf to define direction Bo FLUENT 1 July 16, 2008 07:47
porous media direction kulwinder FLUENT 1 October 30, 2003 13:37


All times are GMT -4. The time now is 20:31.