|
[Sponsors] |
March 6, 2011, 14:22 |
CG_motion problem
|
#1 |
Member
Join Date: Apr 2010
Location: Pisa / Italy
Posts: 62
Rep Power: 16 |
Hi,
I have to simulate a cylinder contrained with a spring and loaded only with its weight. I've written this UDF but monitoring the X-position of the center of the body it tends to 1mm and Cd tends to 0 .... where are the mistakes? Thanks a lot for your help #include "udf.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,F_el,F_pressure, dv, v_prev; real Keq= 50.0; real m = 0.25; NV_S(vel, =, 0.0); t = DT_THREAD(dt); F_pressure = 0.0; F_el=0; begin_f_loop(f,t) { F_CENTROID(x,f,t); F_el += -Keq*x[0]; /* is this wrong? */ } end_f_loop(f,t) begin_f_loop(f,t) { F_AREA(A,f,t); F_pressure += F_P(f,t) * A[0]; /* or F_P*NV_MAG(A) ? */ } end_f_loop(f,t) Ft=F_pressure+F_el+9.81*m; dv = dtime * (Ft / m); v_prev += dv; vel[0] = v_prev; } |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF compiling problem | Wouter | Fluent UDF and Scheme Programming | 6 | June 6, 2012 05:43 |
Incoherent problem table in hollow-fiber spinning | Gianni | FLUENT | 0 | April 5, 2008 11:33 |
natural convection problem for a CHT problem | Se-Hee | CFX | 2 | June 10, 2007 07:29 |
Adiabatic and Rotating wall (Convection problem) | ParodDav | CFX | 5 | April 29, 2007 20:13 |
Is this problem well posed? | Thomas P. Abraham | Main CFD Forum | 5 | September 8, 1999 15:52 |