
[Sponsors] 
January 16, 2013, 01:04 
lagrange gun UDF

#1 
New Member
mehdi
Join Date: Jan 2013
Posts: 3
Rep Power: 5 
I want to simulate a piston which move on the differential pressure force acting on its two surfaces.
The UDF tha I use is: /************************************************** ********** * 1degree of freedom equation of motion (xdirection) * compiled UDF ************************************************** **********/ #include "udf.h" static real v_prev = 0.0; DEFINE_CG_MOTION(piston,dt,vel,omega,time,dtime) { Thread *t; face_t f; real NV_VEC(A); real force, dv; /* reset velocities */ NV_S(vel, =, 0.0); NV_S(omega, =, 0.0); if (!Data_Valid_P()) return; /* get the thread pointer for which this motion is defined */ t = DT_THREAD(dt); /* compute pressure force on body by looping through all faces */ force = 0.0; begin_f_loop(f,t) { F_AREA(A,f,t); force += F_P(f,t) * NV_MAG(A); } end_f_loop(f,t) /* compute change in velocity, i.e., dv = F * dt / mass velocity update using explicit Euler formula */ dv = dtime * force / 50.0; v_prev += dv; Message ("time = %f, x_vel = %f, force = %f\n", time, v_prev, force); /* set xcomponent of velocity */ vel[0] = v_prev; } But it doesn't work. would you please help me? thanks. 

January 21, 2013, 09:42 

#2 
Senior Member
Marion
Join Date: Jul 2012
Location: France
Posts: 122
Rep Power: 6 
Hi,
Why don't you use the "Compute_Force_And_Moment" function for the calculation of the force? I've seen it in the 6DOF examples of the tutorials. Marion. 

January 22, 2013, 09:40 

#3  
Senior Member
Syavash
Join Date: Apr 2010
Location: Tehran, Karaj
Posts: 270
Rep Power: 8 
Quote:
What tutorial exactly do you refer?! I can't find it among Fluent tutorials. If you'd have such tutorial would you please send it to me?! Me Email is syavash_azna@yahoo.com Thank you 

January 23, 2013, 01:05 

#4  
New Member
mehdi
Join Date: Jan 2013
Posts: 3
Rep Power: 5 
Quote:
Dear Marion Would you please send me that axample? aydinkabir88@gmail.com thanks in advance. 

January 23, 2013, 15:32 

#5  
Senior Member
Daniele
Join Date: Oct 2010
Location: Italy
Posts: 986
Rep Power: 16 
Quote:
This is the same approach I proposed to you in private message. Daniele 

August 9, 2014, 00:34 

#6 
New Member
arash
Join Date: Aug 2014
Posts: 9
Rep Power: 3 
Hi everyone
I have been working on moving projectile in a barrel. I need udf for dynamic mesh(Six degree of freedom solver). can anyone help me? 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Source Term UDF VS Porous Media Model  pchoopanya  Fluent UDF and Scheme Programming  1  August 28, 2013 06:12 
UDF parallel error: chipexec: function not found?????  shankara.2  Fluent UDF and Scheme Programming  1  January 16, 2012 23:14 
How to add a UDF to a compiled UDF library  kim  FLUENT  3  October 26, 2011 21:38 
Dynamic Mesh UDF  Qureshi  FLUENT  1  December 2, 2009 01:27 
UDF...UDF...UDF...UDF  Luc SEMINEL  FLUENT  0  November 25, 2002 05:03 