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

Fix the velue of variables use DEFINE_PROFILE

Register Blogs Community New Posts Updated Threads Search

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   October 8, 2004, 23:54
Default Fix the velue of variables use DEFINE_PROFILE
  #1
scubme
Guest
 
Posts: n/a
Hi all fluent users. I am simulating a model. In the simulation, I need fix the velocity of some cells to zero when they meet the given conditions. I used macro DEFINE_PROFILE, and hook it on the FLUID panel (turn on Fixed Values option). The problem I meet is that the UDF fixed all cells, rather than the especial cells. I can not find out the reason. Anybody pls give me any advices, and any discuss is welcome.

The UDF as follow: /*************************************/

#include "udf.h" #include "mem.h"

#define EPS1 0.000001

DEFINE_PROFILE(fixed_u, t, ii) {

cell_t c;

real x[ND_ND];

real err0,err1;

begin_c_loop(c,t)

{

C_CENTROID(x,c,t);

err0=fabs(x[0]-0.25);

err1=fabs(x[1]+0.083333);

if(err0<EPS1 && err1<EPS1)

{Message("%f,%f\n",x[0],x[1]);F_PROFILE(c,t,ii)=0.0;}

}

end_c_loop(c,t)

Message("fixed_u is end. \n");

}

DEFINE_PROFILE(fixed_v, t, ii) {

cell_t c;

real x[ND_ND];

real err0,err1;

begin_c_loop (c,t)

{

C_CENTROID(x,c,t);

err0=fabs(x[0]-0.25);

err1=fabs(x[1]+0.083333);

if(err0<EPS1 && err1<EPS1)

{Message("%f,%f\n",x[0],x[1]);F_PROFILE(c,t,ii)=0.0;}

}

end_c_loop (c,t)

Message("fixed_v is end.\n");

}
  Reply With Quote

 


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
ADDITIONAL VARIABLES LIMITERS N.P CFX 5 December 1, 2011 07:47
$FOAM_USER_APPBIN & LIBBIN variables not set rassilon OpenFOAM Installation 2 February 16, 2010 20:54
Problem with sourcing environmental variables nickninevah OpenFOAM Installation 2 May 25, 2009 12:15
PHI file structure Eugene Phoenics 9 November 2, 2001 22:00
Saving variables on a user patch with physical coordinates Zoltan Turzo CFX 2 April 20, 2000 15:05


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