|
[Sponsors] |
Fix the velue of variables use DEFINE_PROFILE |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 8, 2004, 23:54 |
Fix the velue of variables use DEFINE_PROFILE
|
#1 |
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"); } |
|
|
|
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 |