|
[Sponsors] |
April 21, 2008, 15:57 |
problem with UDF
|
#1 |
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) } |
|
|
|
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 |