|
[Sponsors] |
UDF- assigning viscocity with respect to position |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 23, 2008, 14:02 |
UDF- assigning viscocity with respect to position
|
#1 |
Guest
Posts: n/a
|
Dear all,
I am a final year student at IIT Madras. I am trying to model a single phase flow through an annular region. The specifications of the tube are- OD- 12mm, ID-6.6mm (xz plane), y=0 to 12mm. I wish to assign the viscocity of my fluid as mu=100 for certain nodes, and mu=0.1 otherwise. This is the udf code I wrote. ************************************************** ******************** #include "udf.h" DEFINE_PROPERTY(visc,c,d) { real mu; Thread *t; real x[ND_ND]; C_CENTROID(x,c,t); if(sqrt((pow(x[0]-0.0052,2.)+pow(x[1]-0.050,2.)+pow(x[2]-0,2.)))<0.002) mu= 100.0; else mu=0.1; return mu; } ************************************************** ******************** This code gives me an error. Error: FLUENT received fatal signal (ACCESS_VIOLATION) 1. Note exact events leading to error. 2. Save case/data under new name. 3. Exit program and restart to continue. 4. Report error to your distributor. Error Object: () ************************************************** ******************** Even if I use the same code as above, and give the command : if(sqrt((pow(x[0]-0.0052,2.)+pow(x[1]-0.050,2.)+pow(x[2]-0,2.)))<0.002) mu= 0.1; else mu=0.1; I again get the same error. Which means that the error is not in assigning viscocity with position, but in the if clause I have used. I would be most grateful for the help I could recieve. Regards. |
|
October 23, 2008, 21:15 |
Re: UDF- assigning viscocity with respect to posit
|
#2 |
Guest
Posts: n/a
|
try this:
#include "udf.h" DEFINE_PROPERTY(visc,c,t) { real mu; real x[ND_ND]; C_CENTROID(x,c,t); if(sqrt((pow(x[0]-0.0052,2.)+pow(x[1]-0.050,2.)+pow(x[2]-0,2.)))<0.002) mu= 100.0; else mu=0.1; return mu; } |
|
October 24, 2008, 10:07 |
Re: UDF- assigning viscocity with respect to posit
|
#3 |
Guest
Posts: n/a
|
Thanks a ton!! It worked
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Artificial viscocity | jj | Main CFD Forum | 25 | October 21, 2006 14:40 |
do it necessary to give viscocity expression? | joseph | CFX | 1 | May 6, 2006 09:56 |
tracking data with respect to time | tucker | FLUENT | 2 | December 20, 2005 08:39 |
Variable input with respect to time | Prafull Gandhi | CFX | 2 | September 4, 2005 08:36 |
How to set a boundary condition as a function respect to time | chnrdu | OpenFOAM Running, Solving & CFD | 2 | June 17, 2005 04:18 |