CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Fluent UDF and Scheme Programming

outlet pressure

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

Reply
 
LinkBack Thread Tools Display Modes
Old   May 31, 2010, 19:30
Default outlet pressure
  #1
New Member
 
omid
Join Date: Mar 2010
Posts: 17
Rep Power: 7
om1234 is on a distinguished road
hi all
i'm going to analysis 2d centrifugal pump.in outlet line,i try to define static pressure in a single face of grid. i use this udf,but it doesn't work, but when i try to use it with if else ,answers are correct. i myself think that the problem is that the define-profile macro is a array of data and i must define the pressure in all of the cell faces, but i'm not sure.I wish any one can help me.

DEFINE_PROFILE(outlet_p, thread, position)
{
real x;
real y[ND_ND];
face_t f;

begin_f_loop(f, thread)
{
F_CENTROID(y,f,thread);
if (0.004<x<0.006) /* in this interior there is a face centroid or if (0.004<x & x<0.006)*/
F_PROFILE(f, thread, position) = 1e5;
}
end_f_loop(f, thread)
}
om1234 is offline   Reply With Quote

Old   June 1, 2010, 03:56
Default
  #2
Member
 
O.D.Y.'s Avatar
 
Join Date: Mar 2009
Posts: 49
Rep Power: 8
O.D.Y. is on a distinguished road
Hi,

well I guess you are right the F_PROFILE is used to generate profiles of BC.
You could use it to give constant pressure to all faces or any profile.

anyway, I guess you do not assign any value to x like

x=y[0].

I would suggest to use DEFINE_ADJUST, it is executed before every iteration and you can directly set the pressure of a face to your desired value.

F_P(f,t) is the function to get the pressure at a face.
O.D.Y. is offline   Reply With Quote

Old   June 1, 2010, 04:28
Default
  #3
New Member
 
omid
Join Date: Mar 2010
Posts: 17
Rep Power: 7
om1234 is on a distinguished road
Dear o.d.y.
thanx for your reply
i forgot to write x=y[1] here.i wrote it in original udf.
DEFINE_ADJUST,as i know is used to define some thing in entire cell or face of the mesh,i maen the arg "d" in this macro is refered to all zones and boundary and you can't define a special domain in this macro.
about F_P(f,t),i don't know how this macro is written.and unfortunately i coundn't find any example about it. i will be so thankful if u could help me.
om1234 is offline   Reply With Quote

Old   June 1, 2010, 04:44
Default
  #4
Member
 
O.D.Y.'s Avatar
 
Join Date: Mar 2009
Posts: 49
Rep Power: 8
O.D.Y. is on a distinguished road
well DEFINE_ADJUST can be used to assign data to some faces or cells...

the variable d is pointer of type Domain.
This means, that it points to the domain the DEFINE_ADJUST function is applied to.

Nevertheless you should be able to set the value of just some specific cells.
Maybe it works like you have already tried.

It may look like this:

DEFINE_ADJUST(adjust_pressure,d)
{
Thread *t;

real x;
real y[ND_ND];
real pressure ;

face_t f;

pressure = 1.e5;

thread_loop_f(t, d)
{
begin_f_loop(f,t)
{
F_CENTROID(y,f,t);
x = y[0]; /* 0 is the x coordinate */
if (0.004<x<0.006)
{
F_P(f,t) = pressure;
}
}
end_f_loop(f, t)
}

}

I didn't test that, its juts an idea of how it MIGHT work.
And please notice that index 0 of y[ND_ND] is the x-coordinate, maybe this already solves your problem.

good luck
O.D.Y. is offline   Reply With Quote

Old   June 1, 2010, 06:55
Default
  #5
New Member
 
omid
Join Date: Mar 2010
Posts: 17
Rep Power: 7
om1234 is on a distinguished road
Dear miss/sir
at first i should thank u for ur attention
In define_adjust macro(when hook it via define>user_defined>function hooks>adjust), "d" is refered to whole mesh,and when we hook this udf in fluent, I think that,fluent choose all cells that are in the range of 0.004,0.006, but I want to specify the pressure in one face and in one thread(outlet line). if in this case we consider a interior for y(e.g y=0.225), then the centroid_F macro doesn't work.I dont know if it is true or false that we deal this macro like F_PROFILE and use it in boundary condition(outlet line),nevertheless when i hook it in pressure outlet boundary condition, answers are not correct. pressure value is the same when i specify zero pressure in outlet and i think fluent dont know this macro and going to specify the pressure outlet, zero(it's default value) I've really confused.

outlet pressure is in the range of -7.92e3~6.05e2 like what happened in specifying zero to outlet pressure

Last edited by om1234; June 1, 2010 at 07:36.
om1234 is offline   Reply With Quote

Old   June 1, 2010, 07:38
Default
  #6
Member
 
O.D.Y.'s Avatar
 
Join Date: Mar 2009
Posts: 49
Rep Power: 8
O.D.Y. is on a distinguished road
Oh yes, I see...

the DEFINE_ADJUST is for the entire domain and not for the boundaries, what a pitty... Then DEFINE_PROFILE is probably the best choice, but I don't know how to fix the problem at the moment, sorry.

I think I will give it a try myself and see if i can find something out......
O.D.Y. is offline   Reply With Quote

Old   June 1, 2010, 09:04
Default
  #7
New Member
 
omid
Join Date: Mar 2010
Posts: 17
Rep Power: 7
om1234 is on a distinguished road
Dear friend
I really thanx
In an article this method was suggested with auther,but he did it in CFX-TASCflow, and unfurtunately I think, this is not possible in fluent to specify a value just for one cell/face in boundary condition.
best regard
om1234 is offline   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
Pressure BC for combustion chamber Giuki FLUENT 1 July 19, 2011 11:35
Pressure Drop in outlet Vent Abdul FLUENT 2 October 28, 2008 13:13
Backflow occuring at a pressure outlet? Dave FLUENT 1 August 12, 2004 17:39
Gas pressure question Dan Moskal Main CFD Forum 0 October 24, 2002 22:02
Hydrostatic pressure in 2-phase flow modeling (long) DS & HB Main CFD Forum 0 January 8, 2000 16:00


All times are GMT -4. The time now is 22:18.