# Dynamic mesh Problem: How can I set UDF to the motion of train?

 Register Blogs Members List Search Today's Posts Mark Forums Read

 January 25, 2015, 09:56 Dynamic mesh Problem: How can I set UDF to the motion of train? #1 New Member   Majid Zarif Join Date: May 2014 Posts: 19 Rep Power: 11 Hi Every body I want to simulate this problem in fluent by dynamic mesh ,PLAESE help me how to set the dynamic mesh settings? and ... How can I set UDF to the motion of train in this problem? Thanks This is the link of problem....: https://www.dropbox.com/s/wv8mg77pyi...unnel.jpg?dl=0

 January 26, 2015, 06:28 #2 Senior Member   Paritosh Vasava Join Date: Oct 2012 Location: Lappeenranta, Finland Posts: 732 Rep Power: 22 You could use DEFINE_CG_MOTION macro. See the following example Code: ```DEFINE_CG_MOTION(butterfly_flex_UDF, dt, cg_vel, cg_omega, time, dtime) { cg_vel[0] = 0.0; //X-velocity cg_vel[1] = 0.0; //Y-velocity cg_vel[2] = 0.0; //Z-velocity cg_omega[0] = 0.0; cg_omega[1] = 0.0; cg_omega[2] = 0.0; }``` Majid Zarif likes this.

January 26, 2015, 08:23
#3
New Member

Majid Zarif
Join Date: May 2014
Posts: 19
Rep Power: 11
Quote:
 Originally Posted by vasava You could use DEFINE_CG_MOTION macro. See the following example Code: ```DEFINE_CG_MOTION(butterfly_flex_UDF, dt, cg_vel, cg_omega, time, dtime) { cg_vel[0] = 0.0; //X-velocity cg_vel[1] = 0.0; //Y-velocity cg_vel[2] = 0.0; //Z-velocity cg_omega[0] = 0.0; cg_omega[1] = 0.0; cg_omega[2] = 0.0; }```
As you said I should use this code if I want to move in X-direction with velocity of 0.5m/s?
#include "udf.h"

DEFINE_CG_MOTION(Train_Motion, dt, cg_vel, cg_omega, time, dtime)
{
cg_vel[0] = 0.50; //X-velocity
}

 January 27, 2015, 02:38 #4 Senior Member   Paritosh Vasava Join Date: Oct 2012 Location: Lappeenranta, Finland Posts: 732 Rep Power: 22 Yes. However you must also check some tutorial for mesh motion. You have such a large problem (in terms of mesh size) at hand. The mesh motion will make it even more challenging. Also in my opinion simulating the train entering and leaving the domain will also be another challenge. I have tried such an example but I did not have any success with it.

January 27, 2015, 02:44
#5
New Member

Majid Zarif
Join Date: May 2014
Posts: 19
Rep Power: 11
Quote:
 Originally Posted by vasava Yes. However you must also check some tutorial for mesh motion. You have such a large problem (in terms of mesh size) at hand. The mesh motion will make it even more challenging. Also in my opinion simulating the train entering and leaving the domain will also be another challenge. I have tried such an example but I did not have any success with it.
As you said we don't have any solution?!
Is the way of changing CG motion is the solution?I tried it the fluent responded that "considering no motion"!