|
[Sponsors] |
February 3, 2016, 07:04 |
UDF porous bends direction-1 and direction-2
|
#1 |
New Member
Nicola Viscanti
Join Date: Apr 2009
Posts: 6
Rep Power: 17 |
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 |
|
February 5, 2016, 17:21 |
|
#2 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
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);".
|
|
|
|
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 |