|
[Sponsors] |
Fix the velue of variables use DEFINE_PROFILE |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 9, 2004, 00: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"); } |
|
October 9, 2004, 10:09 |
Re: Fix the velue of variables use DEFINE_PROFILE
|
#2 |
Guest
Posts: n/a
|
There are a new change about my problem. I modified the fixed value from zero to non-zero value. The result show the velocity of cells, which meet conditions, are fixed to the non-zero value, whereas that of the other cells are still zero. It seem to indicate FLUENT set the default fixed value to zero if you do not evaluate a value to the cells in the fluid region. I donot know if my opinion is right. Anybody give me somg suggestion, Please!!!
|
|
October 13, 2004, 06:59 |
Re: Fix the velue of variables use DEFINE_PROFILE
|
#3 |
Guest
Posts: n/a
|
DO NOT CONFUSE YOUR SELF!! I HAVE EXACTLY THE SAME PROBLEM A LONG TIME AGO, WHILE I WANTED TO IMPOSE AN INVISIBLE WALL CONDITION (U=V=0) WITH IN A DYNAMIC DOMAIN. FLUENT CAN NOT FIX THE VALUES IN A SUBDOMAIN OF A FLUID ZONE! DO NOT TRY THIS WAY!!!! THIS IS A REAL PROBLEM FOR A TEAM OF USERS!! FLUENT ONLY FIXES THE VALUES WITH IN ALL FLUID CELLS, SO YOU HAVE TO CREATE NEW FLUID ZONES. BUT THIS IS NOT POSSIBLE IN A DYNAMIC MESH PROBLEM. IF YOU FIND A SOLUTION TO THIS PROBLEM, PLEASE INFORM ME. TRY THE SOURCE OPTION, BY SETTING THE COEFFICIENT TO 1E+20, YOU FIX VALUES TECHNICALLY. GOOD LUCK!!!
|
|
October 16, 2004, 08:06 |
Re: Fix the velue of variables use DEFINE_PROFILE
|
#4 |
Guest
Posts: n/a
|
Thank you stk. I will try your way. But I donot the mean that SET THE COEFFICIENT TO 1E+20, what is coefficient? x, y, z-momentum?
|
|
October 17, 2004, 06:44 |
Re: Fix the velue of variables use DEFINE_PROFILE
|
#5 |
Guest
Posts: n/a
|
stk, I has tried your way by using DEFINE_SOURCE, but no cells are fixed no matter what set ds=0 or 1e+20
|
|
October 17, 2004, 06:44 |
Re: Fix the velue of variables use DEFINE_PROFILE
|
#6 |
Guest
Posts: n/a
|
stk, I has tried your way by using DEFINE_SOURCE, but no cells are fixed no matter what set ds=0 or 1e+20.
|
|
October 17, 2004, 07:05 |
Re: Fix the velue of variables use DEFINE_PROFILE
|
#7 |
Guest
Posts: n/a
|
i mean the coefficient A from the theory of define_sources (x-momentum, y-momentum,..). in this udf you have by commands if ..to describe the region in which you want to impose your fixed values.for example if x>90 & y<30...but let me ask you something important. if you do not have a dynamic mesh or something complex motion, why you don't create a new fluid region where you are interested for (fix the values there)? good luck.
|
|
October 17, 2004, 10:41 |
Re: Fix the velue of variables use DEFINE_PROFILE
|
#8 |
Guest
Posts: n/a
|
My simulation is a medical problem. When the flow field near the blood vessel wall met some conditions, the diameter of blood vessel will change. But the changed size and area is not know. The follow is my UDF example. I hook them in the x,y-momentum option of FLUID panel. Please you check it.
#include "udf.h" #include "mem.h" #define EPS1 0.000001 DEFINE_SOURCE(fixed_u,c, t, dS, eqn) { real x[ND_ND]; real err0,err1; real source; C_CENTROID(x,c,t); err0=fabs(x[0]-0.25); err1=fabs(x[1]+0.083333); if(err0<EPS1 && err1<EPS1) {dS[eqn]= 0;source = 0;} return source; } DEFINE_SOURCE(fixed_v, c, t, dS, eqn) { real x[ND_ND]; real err0,err1; real source; C_CENTROID(x,c,t); err0=fabs(x[0]-0.25); err1=fabs(x[1]+0.083333); if(err0<EPS1 && err1<EPS1) {dS[eqn]= 0;source = 0;} return source; } |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
ADDITIONAL VARIABLES LIMITERS | N.P | CFX | 5 | December 1, 2011 08:47 |
$FOAM_USER_APPBIN & LIBBIN variables not set | rassilon | OpenFOAM Installation | 2 | February 16, 2010 21:54 |
Problem with sourcing environmental variables | nickninevah | OpenFOAM Installation | 2 | May 25, 2009 13:15 |
PHI file structure | Eugene | Phoenics | 9 | November 2, 2001 23:00 |
Saving variables on a user patch with physical coordinates | Zoltan Turzo | CFX | 2 | April 20, 2000 16:05 |