|
[Sponsors] |
July 28, 2021, 05:48 |
|
#21 | |
New Member
Burhan Ibrar
Join Date: Dec 2018
Posts: 21
Rep Power: 8 |
Quote:
/************************************************** ***** SDOF property compiled UDF with external forces/moments ************************************************** *****/ #include "udf.h" static real acc = 4.631; static real mass = 5; static real velocity, vel, area_tot, area[3]; DEFINE_SDOF_PROPERTIES(acce, prop, dt, time, dtime) { prop[SDOF_MASS] =5; prop[SDOF_IXX] = 8.333e-4; prop[SDOF_IYY] = 4.1667e-3; prop[SDOF_IZZ] = 5.2e-5; prop[SDOF_ZERO_TRANS_X] = False;/* boolean, allow translation in x-direction */ prop[SDOF_ZERO_TRANS_Y] = True; /* boolean, suppress translation in y-direction */ prop[SDOF_ZERO_TRANS_Z] = True; /* boolean, suppress translation in z-direction */ prop[SDOF_ZERO_ROT_X] = True; /* boolean, suppress rotation around x-axis */ prop[SDOF_ZERO_ROT_Y] = True; /* boolean, suppress rotation around y-axis */ prop[SDOF_ZERO_ROT_Z] = False; /* boolean, allow rotation around z-axis */ { #if !RP_HOST Thread *t; face_t f; Domain *domain; int nid; domain = THREAD_DOMAIN (DT_THREAD (dt)); nid = THREAD_ID (DT_THREAD (dt)); t = Lookup_Thread (domain, nid); velocity=0.0; area_tot=0; #endif /*t = DT_THREAD(dt);*/ /*NV_S(A, =,0.0);*/ #if !RP_HOST begin_f_loop(f, t) if (PRINCIPAL_FACE_P(f, t)) { F_AREA(area,f,t); area_tot += NV_MAG(area); velocity += F_U(f, t)*NV_MAG(area); } end_f_loop(f, t) /*area_tot=PRF_GRSUM1(noface); velocity=PRF_GRSUM1(velocity);*/ #if RP_NODE area_tot = PRF_GRSUM1(area_tot); velocity = PRF_GRSUM1(velocity); /*vel = velocity/area_tot;*/ /*Message0("\nV1 %f Area Total %f /n",vel, area_tot);*/ #endif /*RP_NODE*/ #endif /*!RP_HOST*/ /* Pass the node's total area and Velocity to the Host for averaging */ node_to_host_real_2(area_tot,velocity); #if !RP_NODE vel = velocity/area_tot; Message("Total Area: %f (m2)\n",area_tot); Message("Averaged Velocity of the Guide Rail %f (N)\n",vel); #endif /* !RP_NODE */ |
||
Tags |
6dof, face loop |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF ——wrong on the thread or cell loop? | Steve-Tian | Fluent UDF and Scheme Programming | 2 | April 21, 2019 22:39 |
Fluent UDF for Micro Flow Face Slip Velocity | daniel_george_carter | Fluent UDF and Scheme Programming | 0 | May 12, 2013 06:39 |
UDF for Heat Exchanger model | francois louw | FLUENT | 2 | July 16, 2010 03:21 |
I want to use pressure of 1 face in udf that compiled on other face | iman_1844 | Fluent UDF and Scheme Programming | 3 | June 10, 2010 13:55 |
NACA0012 geometry/design software needed | Franny | Main CFD Forum | 13 | July 7, 2007 16:57 |