
[Sponsors] 
April 7, 2015, 00:19 
dynamic mesh using define grid motion udf

#1 
New Member
fredrick
Join Date: Apr 2015
Location: China
Posts: 15
Rep Power: 10 
hello ladies and gentlemen. I am trying to simulate deflecting a beam that is acting like a fan for a heat sink. i am using define grid motion udf but every time i try "smoothing" and "remeshing", i get a problem of negative volume error. Kindly help me to workaround this problem. this is my code based on the simple deflection equation of the fluent udf tutorial.
the equation for my deflection is s(z)=amplitude*sin(2*pi*f*time)*(z/0.075)^2 hence the velocity becomes velocity = amp * w * cos(w * time)*(z/0.075)^2; z ranges from zero to 75mm but i want deflection to start at 20mm this is my code #include "udf.h" DEFINE_GRID_MOTION(fan1,main, dt, time, dtime) { Thread *tf = DT_THREAD (dt); face_t f; Node *v; real NV_VEC (velocity), NV_VEC (axis); real NV_VEC (origin), NV_VEC (rvec); real velc; real freq; real amp; real w; int n; /* set deforming flag on adjacent cell zone */ SET_DEFORMING_THREAD_FLAG (THREAD_T0 (tf)); freq=50; amp=0.003; w=2*3.141592654*freq; velc = amp * w * cos(w * time); NV_S (velocity, =, 0.0); NV_D (axis, =, 0.0,0.0, 1.0); NV_D (origin, =, 0.00307, 0.023, 0.075);/*center of gravity for my beam*/ begin_f_loop (f, tf) { f_node_loop (f, tf, n) { v = F_NODE (f, tf, n); /* update node if z position is greater than 0.02 and that the current node has not been previously visited when looping through previous faces */ if (NODE_Z (v) > 0.020 && NODE_POS_NEED_UPDATE (v)) { /* indicate that node position has been update so that it's not updated more than once */ NODE_POS_UPDATED (v); velocity[0] = velc * pow (NODE_Z (v)/0.075, 2); NV_V_VS (rvec, =, NODE_COORD (v), +, velocity, *, dtime); NV_V (NODE_COORD (v), =, rvec); } } } end_f_loop (f, tf); } kindly guys, assist me with any suggestion. 

May 29, 2015, 04:43 
Dear Fredrick

#2 
New Member
MaSoud Rahimi
Join Date: Jan 2015
Posts: 5
Rep Power: 11 
I am also working on beam and dynamic mesh,i think it is really sensitive to time step and cell size. a minimum time step you could have is :1/8(1/freq).


July 14, 2015, 03:56 
thanks masoud6

#3 
New Member
fredrick
Join Date: Apr 2015
Location: China
Posts: 15
Rep Power: 10 
hello. thanks for your reply. do you think the code i have written for the dynamic mesh is okay?


July 14, 2015, 07:19 
another strategy for grid motion

#4 
New Member
MaSoud Rahimi
Join Date: Jan 2015
Posts: 5
Rep Power: 11 
it's true logically but it depends on your geometry. if it possible put the geometry. however you can carry out another strategy for code implement as following bellow (use your own equation and beam characteristic):
#include"udf.h" #include"unsteady.h" #include"dynamesh_tools.h" #include "udf.h" DEFINE_GRID_MOTION(beam,domain,dt,time,dtime) { Thread *tf; face_t f; int n; Node *v; /* get the thread pointer for which this motion is defined */ tf=DT_THREAD(dt); begin_f_loop(f,tf) { f_node_loop(f,tf,n) { v = F_NODE(f,tf,n); NODE_Y(v)=NODE_Y(v)+fabs(NODE_X(v))*dtime; } } end_f_loop(f,tf); } 

August 28, 2015, 04:32 
definition

#5 
New Member
MaSoud Rahimi
Join Date: Jan 2015
Posts: 5
Rep Power: 11 
Dear Fredrick
could you please tell me what does these three lines mean, specially line 3 ? NV_S (velocity, =, 0.0); NV_D (axis, =, 0.0,0.0, 1.0); NV_D (origin, =, 0.00307, 0.023, 0.075);/*center of gravity for my beam*/ 

August 28, 2015, 06:16 

#6  
Senior Member
Amin
Join Date: Oct 2013
Location: Germany
Posts: 397
Rep Power: 14 
Quote:
I'm working on same projects, the first question, Fredrick, what's the direction of the beam in your code? Is it in X direction? I've also prepared a same code based on fluent tutorial but it's not working, actually the domain is completely stationary! My domain is 2D and I've checked the beam in X and Y direction, bot it's still not working 

August 28, 2015, 06:17 

#7  
Senior Member
Amin
Join Date: Oct 2013
Location: Germany
Posts: 397
Rep Power: 14 
Quote:
Based on your code, is the beam bending? or only rotate as a rigid beam? 

August 31, 2015, 01:14 
bending grid motion

#8 
New Member
MaSoud Rahimi
Join Date: Jan 2015
Posts: 5
Rep Power: 11 
Dear Amin
the geometry has been attached. as can be seen from fig. this cod is expedient for bending of a beam. best 

October 11, 2015, 23:25 
masoud6

#9  
New Member
fredrick
Join Date: Apr 2015
Location: China
Posts: 15
Rep Power: 10 
Quote:
my thoughts are, since I'm working with velocity equation, the first line is to reset vel as 0; the second line means my beam lies in the z axis. the third line i suspect I'm wrong.. maybe i could have ignored x, y and just indicate z (0.0, 0.0, 0.075) since the starting point for my beam is 75mm in the Z axis... I'm restarting the project and I am still stuck. I guess your code looks nice but i don't understand this line "NODE_Y(v)=NODE_Y(v)+fabs(NODE_X(v))*dtime; " what do u mean by fabs? couldyou also kindly send me your entire code so to my email if you don't mind "irungufred@yahoo.com". thanks 

October 11, 2015, 23:35 

#10  
New Member
fredrick
Join Date: Apr 2015
Location: China
Posts: 15
Rep Power: 10 
Quote:
sorry that I could not reply on time. my domain is 3D. mine works and I can see the bean vibrating but the problem of negative volume is the headache. My beam lies in the Z axis. It vibrates in X direction. which equation of vibration did you use? 

October 14, 2016, 03:37 
define grid motion

#11 
New Member
Amit soni
Join Date: Jul 2015
Posts: 10
Rep Power: 10 
In my case it is showing
Warning: incorrect cg motion UDF beam::libudf on zone 14 (assuming no motion), What does it mean 

June 26, 2018, 04:11 
tutorial

#12 
Member
Join Date: Nov 2017
Posts: 54
Rep Power: 8 
hi
can u give me a tutorial for dynamic mesh grid motion dynamic msh? 

June 30, 2018, 08:18 

#13  
Member
Join Date: Nov 2017
Posts: 54
Rep Power: 8 
Quote:
I want to learn grid motion 

June 30, 2018, 08:25 

#14 
Member
Join Date: Nov 2017
Posts: 54
Rep Power: 8 
hello
Does any one know what the two bettom lines mean real NV_VEC (omega), NV_VEC (axis), NV_VEC (dx); real NV_VEC (origin), NV_VEC (rvec); 

July 23, 2018, 05:20 

#15  
Member
Join Date: Nov 2017
Posts: 54
Rep Power: 8 
Quote:
I have a geometry like square with four node and this geometry has a shadow. I want to move just a node, but I have a problem that the node between shadow and geometry is different and after the motion, the shapes are different can you explain me how to match the node arrangement? 

December 21, 2020, 18:06 
Define as UDF

#16  
New Member
Haitham Osman
Join Date: Jan 2020
Posts: 6
Rep Power: 6 
Quote:
you have to define your udf as a DEFINE UDF from the grid motion options. I think you got this message cause you selected rigid body option 

Thread Tools  Search this Thread 
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
2d Dynamic Mesh with udf  pvc  Fluent UDF and Scheme Programming  44  May 19, 2021 19:10 
HELPSurface Reaction UDF  Ashi  Fluent UDF and Scheme Programming  1  May 19, 2020 22:13 
UDF for Dynamic Mesh  vasava  Fluent UDF and Scheme Programming  2  September 25, 2013 01:54 
dynamic mesh and udf problem  boboroo  FLUENT  1  January 20, 2008 22:26 
Problem related with UDF for dynamic mesh  Ryan  FLUENT  6  April 29, 2004 10:29 