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

UDF for transient pressure inlet, mass flow check at nozzle exit and volumetric heat

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 17, 2011, 03:07
Default UDF for transient pressure inlet, mass flow check at nozzle exit and volumetric heat
  #1
New Member
 
denny lee
Join Date: Feb 2011
Posts: 7
Rep Power: 15
kokoory is on a distinguished road
hello, guys.

I have a problem to apply udf to my model.
the problem is analysizing very small nozzle.
However, I have no idea to code and apply udf.

first, I used a pressure inlet to vary a total pressure from 0 to 10Mpa using udf.
It's good to check and analysis the nozzle. But, in addition, I have to apply checking a mass flow rate at nozzle exit. after checking the mass flow rate, I should apply a volumetric heat addition as per mass flow rate( mass flow rate * mdot Q).

here is the question.

1. I hooked the below code, however, I think it is not working. I wanna do change the pressure from 2Mpa to 10Mpa and check the mass flow rate at the exit simultaneously.
plz help me..

Please see the attach

#include "udf.h"

face_t f;
cell_t c;

DEFINE_EXECUTE_AT_END(mass)
{
Domain *d;

real flow=0;
real p=0;

Thread *t;


d = Get_Domain(1);
t= Lookup_Thread(d, 7);

begin_f_loop(f,t)
{
flow+=F_FLUX(f,t);
}
end_f_loop(f,t)
p = C_P(c,t);
printf("MASS Flow Rate: %g\n",flow);
}

DEFINE_PROFILE(pre, t, i)
{
real pressure_mag;
real cu_tim;
//face_t f;
cu_tim = CURRENT_TIME;

if((cu_tim>=0)&&(cu_tim<10))
{
pressure_mag=202650+101325*cu_tim;
}

else
{
pressure_mag=1013250;
}

begin_f_loop(f,t)
{
F_PROFILE(f,t,i) = pressure_mag;
}
end_f_loop(f,t)
}
Attached Images
File Type: png 캡처.PNG (76.1 KB, 14 views)

Last edited by kokoory; August 17, 2011 at 09:16. Reason: add the code
kokoory is offline   Reply With Quote

Reply


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



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