"This function needs size of 3 for force and moment. It works in parallel and the common arguments are the of the same type as your arguments. In addition you have to pass the domain as first arg and a boolean as last argument. This boolean has to be TRUE if you also call the function on the host else it has to be FALSE." Compute_Force_And_Moment (domain, tf, CG, force, moment, FALSE); domain = THREAD_DOMAIN (DT_THREAD ((Dynamic_Thread *)dt)); - pointer on Domain tf = Lookup_Thread(domain, ID); - pointer on the Thread in Domain I don't know if "force" includes viscose and pressure force or only pressure force!!! ************************************************** ************** compute viscose force in UDF you have to define in mem.h header or in local c-file this macro: #define F_VISCOSE(f,tf) F_STORAGE_R_N3V(f,tf,SV_WALL_SHEAR) Thread *tf = DT_THREAD(dt); /*pointer on thread*/ face_t f; /*number of faces*/ begin_f_loop(f, tf) { NV_VS(F_VISC, += , F_VISCOSE(f, tf), *, -1.0 * k); /* compute viscose force vector. k is a factor for depth in 2D computation and -1.0 corrects the sign of viscose force*/ } end_f_loop(f, tf); from CFD_online.com
the common arguments are the of the same type as your arguments.
In addition you have to pass the domain as first arg and a boolean as
last argument. This boolean has to be TRUE if you also call the function
on the host else it has to be FALSE."
Compute_Force_And_Moment (domain, tf, CG, force, moment, FALSE);
domain = THREAD_DOMAIN (DT_THREAD ((Dynamic_Thread *)dt)); - pointer on Domain
tf = Lookup_Thread(domain, ID); - pointer on the Thread in Domain
I don't know if "force" includes viscose and pressure force or only pressure force!!!
************************************************** **************
compute viscose force in UDF
you have to define in mem.h header or in local c-file this macro:
#define F_VISCOSE(f,tf) F_STORAGE_R_N3V(f,tf,SV_WALL_SHEAR)
Thread *tf = DT_THREAD(dt); /*pointer on thread*/
face_t f; /*number of faces*/
begin_f_loop(f, tf)
{
NV_VS(F_VISC, += , F_VISCOSE(f, tf), *, -1.0 * k); /* compute viscose force vector. k is a factor for depth in 2D computation and -1.0 corrects the sign of viscose force*/
}
end_f_loop(f, tf);
from CFD_online.com