Mass Flow Rate on an interface


Following UDF could be used to display mass flow rate on an interface. User defined memory is used to store face fluxes on the interface.
/*UDF to display mass flow rate on an interface*/
/****************USUAGE************************/
/*

1)Read case and data file into Fluent session.

2)Specify the id of interface in the UDF. id could be seen from Define--->Boundary Conditions.

2)Allocate a user define memory through Define--->User-Defined--->Memory

3)Compile following udf through Define--->User-Defined-->Functions-->Compile

4)Run the case for atleast one iteration.

5)Mass-flow rate on the interface could be displayed through Display--->Contours.
*/


#include "udf.h"
#define interface_id 17

DEFINE_ON_DEMAND(mass_flow)
{
Domain *d;
Thread *t;
Thread *t1;
cell_t c;
face_t f;

d=Get_Domain(1);
t=Lookup_Thread(d,interface_id);
begin_f_loop(f,t)
{
c=F_C0(f,t);
t1=THREAD_T0(t);
C_UDMI(c,t1,0)=F_FLUX(f,t);
}
end_f_loop(f,t)
}





Show Form
No comments yet. Be the first to add a comment!