# SOLUTION : Cg_motion UDF for a oscillating body

 User Name Remember Me Password
 Register Blogs Members List Search Today's Posts Mark Forums Read

 LinkBack Thread Tools 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: 57 Rep Power: 7 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; } Grigor Nikolov likes this.

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post bobo FLUENT 0 July 2, 2009 06:41 zhaoh FLUENT 0 February 5, 2007 05:10 Matt Umbel Main CFD Forum 14 January 12, 2001 15:34 Dr. Ahmed Hassaneen Main CFD Forum 2 November 8, 1999 15:59 Abhijit Tilak Main CFD Forum 6 February 5, 1999 02:16

All times are GMT -4. The time now is 11:31.

 Contact Us - CFD Online - Top