CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

UDF to calculate mass flow rate

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 10, 2018, 12:18
Default UDF to calculate mass flow rate
  #1
New Member
 
wasim
Join Date: Aug 2015
Posts: 9
Rep Power: 10
wasim_03 is on a distinguished road
Can someone find mistake in given below udf. Value calculated by udf at different time steps & reported by printf function is always coming zero......Why???please help




DEFINE_EXECUTE_AT_END(mass_flow)
{
Domain *d;
real flow=0.0;
Thread *f_thread;
face_t f;
d=Get_Domain(1);
f_thread=Lookup_Thread(d, 13);
begin_f_loop(f,f_thread)
{
flow += F_FLUX(f,f_thread);
}
end_f_loop(f, f_thread)
printf("Mass flow rate is %g kg/s\t \n",flow);
flow_tot=flow;
}
wasim_03 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


Similar Threads
Thread Thread Starter Forum Replies Last Post
[OpenFOAM] How to calculate mass flow rate through arbitrary rectangle plane in paraview manoj_nav ParaView 7 April 1, 2016 07:14
Calculating mass flow rate at multiphase flows Kuslo187 OpenFOAM Post-Processing 1 August 21, 2015 18:11
Please help (an UDF for regulating the mass flow rate) swidi Fluent UDF and Scheme Programming 2 July 30, 2015 12:32
Basic UDF for unsteady mass flow rate emmkell Fluent UDF and Scheme Programming 2 September 9, 2013 04:48
How to define mass flow rate using UDF? SAMUEL FLUENT 3 December 25, 2004 00:36


All times are GMT -4. The time now is 10:31.