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

assign pressure gradient

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 16, 2006, 08:37
Default assign pressure gradient
  #1
Peter
Guest
 
Posts: n/a
Hello guys,

I want to assign C_P_G(c,t) for cells which have a special volume fraction. Therefore I loop over all cells and check if they are achieve the demand of the special volume fraction (for example C_VOF(c,t)==1.0). For cells which fulfill this condition I assign C_P_G(c,t). Does anybody know if this will work? My sourcecode is below.

Thanks for help.

#include <udf.h>

/*Funktionsprototypendekleration*/

void Unterprg_3(double,double,double,double,cell_t,Thre ad *); void Unterprg_2(cell_t,Thread *); double Kapfunkt(void);

/*Hauptprogramm*/

DEFINE_ADJUST(Druckgradient,d) { Domain *mixture_domain=d; Thread *mixture_thread; Thread *c_sub_thread; cell_t c; int phase_domain_index=1;

thread_loop_c(mixture_thread,mixture_domain) { c_sub_thread=THREAD_SUB_THREAD(mixture_thread,phas e_domain_index);

begin_c_loop(c,c_sub_thread)

{

if(C_VOF(c,c_thread)==1.0 || C_VOF(c,c_thread)==0.0)

{

C_P_G(c,c_sub_thread)[1]=0.0;

}

if(C_VOF(c,c_thread)<1.0 && C_VOF(c,c_thread)>0.0)

{

Unterprg_2(cell_t c,Thread *c_sub_thread);

}

}

end_c_loop(c,c_sub_thread) } }

/*Berechnung des Kapillardrucks*/

double Kapfunkt(void) { double r=RP_Get_Real("r_scheme"); double sigma=RP_Get_Real("sigma_scheme"); double theta_Rad=(RP_Get_Real("theta_Grad_scheme")/180)*3.14; double R; double cos_theta; double p;

cos_theta=cos(theta_Rad); R=r/cos_theta; p=((2.0*sigma)/(R/1000.0));

return p; }

/*Unterprogramm 3 zur ...*/

void Unterprg_3(double MP_Face_y3,double MP_Cell_y3,double MP_Face_x3,double MP_Cell_x3,cell_t c3,Thread *c3_sub_thread) { if(MP_Face_y3>MP_Cell_y3) { if(MP_Face_x3==MP_Cell_x3) { double y_Differenz; y_Differenz=MP_Face_y3-MP_Cell_y3; C_P_G(c3,c3_sub_thread)[1]=((-1)*Kapfunkt())/(2*y_Differenz); } } }

/*Unterprogramm 2*/ void Unterprg_2(cell_t c2,Thread *c2_sub_thread) { Thread *f_thread; face_t f; int i; c_face_loop(c2,c2_sub_thread,i) { double MP_Face[2]; double MP_Cell[2]; double MP_Face_y=MP_Face[1]; double MP_Cell_y=MP_Cell[1]; double MP_Face_x=MP_Face[0]; double MP_Cell_x=MP_Cell[0];

f=C_FACE(c2,c2_sub_thread,i); f_thread=C_FACE_THREAD(c2,c2_sub_thread,i);

F_CENTROID(MP_Face,f,f_thread); C_CENTROID(MP_Cell,c2,c2_sub_thread);

Unterprg_3(MP_Face_y,MP_Cell_y,MP_Face_x,MP_Cell_x ,c2,c2_sub_thread); } }

  Reply With Quote

Old   December 26, 2006, 16:32
Default Re: assign pressure gradient
  #2
seyed Farid hosseinizadeh
Guest
 
Posts: n/a
Hi Buddy: Please send your UDF to my email. I will check it and let you know if I reach to any progress. Thanks/Farid

  Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
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
Inputting pressure gradient in Fluent Josyula FLUENT 2 December 23, 2009 07:26
Atmospheric pressure gradient Luc3er FLUENT 1 October 30, 2009 06:46
Hydrostatic pressure gradient Craig Finch (Finch) OpenFOAM Running, Solving & CFD 10 February 28, 2007 23:02
Flat plate with pressure gradient Sheila Main CFD Forum 3 September 24, 2005 13:58


All times are GMT -4. The time now is 12:49.