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

useful udf ! thanks to macfly

Register Blogs Community New Posts Updated Threads Search

Rate this Entry

useful udf ! thanks to macfly

Posted October 21, 2014 at 18:33 by diamondx

#include "udf.h"
real T_mean; /* defined outside because will be used in multiple DEFINE macros */

DEFINE_ADJUST(adjust, domain, t)
{
real T_tot;
real u;
real counter = 0;

face_t f;
int ID = 20; /* outlet ID displayed in Fluent boundary conditions panel */
Thread *thread;
thread = Lookup_Thread(domain, ID);
begin_f_loop(f, thread)
{
u = F_U(f, thread); /* x velocity */
if (u >= 0) /* if fluid is going out... */
{
T_tot += F_T(f, thread);
counter = counter + 1;
}
}
end_f_loop(f, thread)
T_mean = T_tot/counter; /* arithmetic mean T of outflow */
}



DEFINE_PROFILE(T_backflow, thread, position)
{
face_t f;
begin_f_loop(f, thread)
{
F_PROFILE(f, thread, position) = T_mean;
}
end_f_loop(f, thread)
}
Posted in Uncategorized
Views 3021 Comments 1 Edit Tags Email Blog Entry
« Prev     Main     Next »
Total Comments 1

Comments

  1. Old Comment
    can you explain what is this

    thanks a lot
    permalink
    Posted January 25, 2018 at 03:44 by tufygo tufygo is offline
 

All times are GMT -4. The time now is 18:19.