CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   initial velocity in dynamic mesh (https://www.cfd-online.com/Forums/fluent/149443-initial-velocity-dynamic-mesh.html)

amin.z March 4, 2015 10:04

initial velocity in dynamic mesh
 
Hi friends!

I'm working on a problem about projectiles moving!
I need a UDF to set mass, inertia and initial velocity of the projectile!
the problem is that I don't find a macro to set the velocity at start time! :confused:
Does it need a macro? or it should be set in fluent?

ghost82 March 5, 2015 05:58

Hi Amin,
to set mass and inertia you can use DEFINE_SDOF_PROPERTIES.
To set initial velocity you can use DEFINE_CG_MOTION to be applied to rigid bodies.

amin.z March 5, 2015 11:43

Hi Daniele!
tnx! I haven't enough experience in dynamic mesh field!
I was thinking CG-MOTION is for a constant speed and uniform motion!
How can I use this macro for initial velocity? only a value for "vel" argument? what about values of "time" and "dtime"?

ghost82 March 5, 2015 12:18

Better explain with an example:

This udf, for example:

Code:

# include "udf.h"
# include "dynamesh_tools.h"

DEFINE_CG_MOTION(mymotion, dt, vel, omega, time, dtime)
{
Thread *t;
face_t f;
vel[0]= 0.1;
vel[1] = 0.0;   
vel[2] = 0.0;
}

sets a constant translational velocity of 0.1 m/s in +x direction.
So, if you apply it to your rigid body at the first time step it will translate with 0.1 m/s velocity.

omega refers to rotational velocity (omega[0], omega[1], omega[2]).

If you want to change velocities with time, then you can use directly 'time' without use the macro CURRENT_TIME.

So if you have a linear increasing velocity you can replace for example in the udf:

vel[0]= 0.1*time;

dtime is the timestep; as 'time' you can use dtime directly into the udf if you need it.

amin.z March 5, 2015 12:30

ok!
I need just a constant speed at first time step and want to fluent calculates the speed at final step! so did I just need "vel[0]= 0.1"?
and what about X , Y compnents!?

ghost82 March 5, 2015 13:09

Explain better your problem, as I cannot understand why you want a positive velocity only for the first timestep. And after the first one?

amin.z March 5, 2015 13:22

yeah! I have a projectile! it's a component of a bigger moving part and released from it! so it has a initial velocity and I want to know what happen for it after a few seconds! it hasn't any internal force! only gravity and drag reduce its speed!
Is it clear dear?

ghost82 March 5, 2015 16:13

Can't this be simulated by patching with high pressure and temperature a small space adjacent to the projectile? Then it will be the pressure that will move the projectile, which will move with 6dof (or restricted 6 dof)

amin.z March 7, 2015 01:23

1 Attachment(s)
I think it maybe causes significant error in simulation! and also will effects on next time steps!
there is a tab as "center of gravity velocity" in dynamic mesh tab! do you know what is this? I've attached a pic from this tab...

ghost82 March 7, 2015 04:26

It is the velocity of the center of gravity.
At time 0, your projectile has a defined position and a defined velocity.
For your case before igniting the high pressure and temperature zone, your projectile is at rest, so you can set velocity to 0 m/s.
Moreover you have to set the initial position of the center of gravity.
These values will be automatically updated during the simulation, as your projectile moves.

amin.z March 8, 2015 04:19

Quote:

Originally Posted by ghost82 (Post 535065)
It is the velocity of the center of gravity.
At time 0, your projectile has a defined position and a defined velocity.
For your case before igniting the high pressure and temperature zone, your projectile is at rest, so you can set velocity to 0 m/s.
Moreover you have to set the initial position of the center of gravity.
These values will be automatically updated during the simulation, as your projectile moves.

Ok! so I could use this tab for applying an initial velocity to the projectile! this velocity only use for time 0 and changes during the solution based on the domain conditions! is this correct!?

ghost82 March 8, 2015 09:57

Yes, I think so.

amin.z March 9, 2015 01:53

Quote:

Originally Posted by ghost82 (Post 535188)
Yes, I think so.

hooom! good! tnx friend

AUGUZUN September 26, 2015 06:35

Hello.
Amin, did it helped ? Did you manage to solve your problem?
I have very simular one.


All times are GMT -4. The time now is 02:37.