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

problem with UDF

Register Blogs Community New Posts Updated Threads Search

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   April 21, 2008, 15:57
Default problem with UDF
  #1
Nina
Guest
 
Posts: n/a
Hi All, I've problem with an UDF. I have to define a pressure profile that respond to the following equation: ((Ql*Ri)+(vol/C)) where Ql is the flow rate at the current time, Ri and C are costant and vol derive to the following expression ((Ql*(current time-previous time))+volume at the previous time). I've made different UDF where I've used the variables F_U, F_V, F_W e F_U_M1, F_V_M1, F_W_M1 but I'm not an expert so maybe I've missed something because UDF doesn't run well. I've tried also with some external variables but I don't understand how I've to use them…I'm really hopeless!! This is the UDF: DEFINE_PROFILE(press_insp,thread,position)

{

face_t f;

real NV_VEC(psi);

real NV_VEC(A);

real NV_VEC(psit);

real intervallo =0.0;

real ora = 0.0;

real prima = 0.0;

real Q=0;

real Ql=0;

real vol=0;

real Qtl=0;

real volprec=0;

real Qt=0;

ora=CURRENT_TIME;

prima=PREVIOUS_TIME;

intervallo=ora-prima;

begin_f_loop(f,thread)

{

F_AREA(A,f,thread);

NV_D(psi,=,F_U(f,thread),F_V(f,thread),F_W(f,threa d));

Q=NV_DOT(psi,A);

Ql= Q*1000;

NV_D(psit,=,F_U_M1(f,thread),F_V_M1(f,thread),F_W_ M1(f,thread));

Qt=NV_DOT(psit,A);

Qtl=Qt*1000;

volprec=Qtl*intervallo;

vol=((Ql*intervallo)+volprec);

intervallo = istante - precedente;

F_PROFILE(f,thread,position)=((Q/C)+(((Q-Qt)/intervallo)*Ri));

}

end_f_loop(f,thread)

}

  Reply With Quote

 


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
VOF diffuse problem on two fluids problem Fang Jin FLUENT 5 February 17, 2011 05:38
Problem in Modelling Heat Transfer Problem Deepak R FLUENT 1 December 6, 2007 09:37
Problem in cavity flow problem saad Main CFD Forum 4 November 1, 2007 07:45
natural convection problem for a CHT problem Se-Hee CFX 2 June 10, 2007 06:29
problem in solving "wave generation" problem san FLUENT 2 April 3, 2006 23:37


All times are GMT -4. The time now is 05:34.