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

Fix the velue of variables use DEFINE_PROFILE

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
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

Old   October 9, 2004, 09:09
Default Re: Fix the velue of variables use DEFINE_PROFILE
  #2
scubme
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!!!
  Reply With Quote

Old   October 13, 2004, 05:59
Default Re: Fix the velue of variables use DEFINE_PROFILE
  #3
stk
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!!!
  Reply With Quote

Old   October 16, 2004, 07:06
Default Re: Fix the velue of variables use DEFINE_PROFILE
  #4
scubme
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?
  Reply With Quote

Old   October 17, 2004, 05:44
Default Re: Fix the velue of variables use DEFINE_PROFILE
  #5
scubme
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
  Reply With Quote

Old   October 17, 2004, 05:44
Default Re: Fix the velue of variables use DEFINE_PROFILE
  #6
scubme
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.
  Reply With Quote

Old   October 17, 2004, 06:05
Default Re: Fix the velue of variables use DEFINE_PROFILE
  #7
stk
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.
  Reply With Quote

Old   October 17, 2004, 09:41
Default Re: Fix the velue of variables use DEFINE_PROFILE
  #8
scubme
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; }
  Reply With Quote

Reply

Thread Tools
Display Modes

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 On
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 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 12: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 15:05


All times are GMT -4. The time now is 13:47.