|
[Sponsors] |
SOLUTION : Cg_motion UDF for a oscillating body |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
March 9, 2011, 06:02 |
SOLUTION : Cg_motion UDF for a oscillating body
|
#1 |
Member
Join Date: Apr 2010
Location: Pisa / Italy
Posts: 62
Rep Power: 16 |
Hope it can help someone
/* in this example a cilynder with CG=(0,0) in loaded by its own wake. A spring of K=15 keeps it in position*/ #include "udf.h" #include "dynamesh_tools.h" DEFINE_CG_MOTION(oscillazione,dt,vel,omega,time,dt ime) { real x[ND_ND]; Thread *t; face_t f; real A[ND_ND]; real Ft,Fel, dv; real Keq= 15; real m = 0.25; real s; real force=0; real v_prev=0; t = DT_THREAD(dt); s=DT_CG(dt)[1]; begin_f_loop(f,t) { F_AREA(A,f,t); force += F_P(f,t) * A[1]; } end_f_loop(f,t) Fel=-Keq*s; Ft=force+Fel; dv=(Ft/m)*dtime; vel[1] = DT_VEL_CG(dt)[1]+dv; } |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
CFL Condition | Matt Umbel | Main CFD Forum | 19 | June 30, 2020 09:20 |
body has to move in positive and negative x-direction (UDF?) | bobo | FLUENT | 0 | July 2, 2009 07:41 |
HELP! HELP! For udf of particle body force!!!! | zhaoh | FLUENT | 0 | February 5, 2007 05:10 |
Any Body got a Free Surface Solution in FIDAP | Dr. Ahmed Hassaneen | Main CFD Forum | 2 | November 8, 1999 15:59 |
Wall functions | Abhijit Tilak | Main CFD Forum | 6 | February 5, 1999 02:16 |