dhaya400
Subscriber
Hi Rob,
Q12 is the flow rate, which i am calculating using DEFINE_EXECUTE_AT_END macro.
The macro given below:
real Q12; /* current time step flow rate */
#define BCA_ID 63 /* domain id*/
DEFINE_EXECUTE_AT_END(flow_rate_bca)
{
#if !RP_HOST
Domain *d;
real m;
cell_t c;
Thread *t;
face_t f;
d = Get_Domain(1);
t= Lookup_Thread(d, BCA_ID);
/* loop to calculate mass flow rate at outlet */
begin_f_loop(f,t)
{
if (PRINCIPAL_FACE_P(f,t))
{
m += F_FLUX(f,t);
}
}
end_f_loop(f,t)
Q12 = m / 1060.0; /* convert mass flow rate to volume flow rate */
#if RP_NODE
/* Perform node synchronized actions here. Does nothing in Serial */
Q12 = PRF_GRSUM1(Q12);
#endif /* RP_NODE */
m = 0.0;
#endif /* !RP_HOST */
}