CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   Dynamic mesh : Oscillating cylinder (https://www.cfd-online.com/Forums/fluent/153811-dynamic-mesh-oscillating-cylinder.html)

Bobby155 June 4, 2015 03:09

Dynamic mesh : Oscillating cylinder
 
Hi,

I am a beginner in Fluent 15.0 and I am trying to realize the modelisation of a flow through an oscillating cylinder. I don't have any problem loading the UDF describing the movement of the cylinder but I can't see anthing with "Preview Mesh Motion" or even "Display Zone Motion" in the Dynamic Task page. I am using Smoothing and Remeshing as Mesh Methods.

Maybe the problem comes from the UDF I am using :

#include "udf.h"


DEFINE_CG_MOTION(pis,dt,vel,omega,time,dtime)
{
Thread*t;
face_t*f;
real A=1;
real freq=1;
real pi=3.14159265;
real w=2*pi*freq;
real v=A*w*sin(w*time);

/*reset velocities */

NV_S(vel,=,0.0);
NV_S(omega,=,0.0);
if (!Data_Valid_P()) return;


t=DT_THREAD(dt);

vel[1] = v;

}



I don't know if it is related but i am also not able to edit the Function Hooks.
This problem may have been already explained in this forum but I couldn't find any explanations.

Does someone have an answer ?

Thanks !

alireza_b June 4, 2015 07:22

Hi
1- Did you use complied or interpreted? you should use compiled.
2- Did you set solver to unsteady condition?

you UDF is right but you can comment this lines (its not necessary).

/*reset velocities */

NV_S(vel,=,0.0);
NV_S(omega,=,0.0);
if (!Data_Valid_P()) return;


t=DT_THREAD(dt);

--------------------------------------
if you did (do) these steps, you have to see mesh motion.

Bobby155 June 8, 2015 03:23

Hi alireza_b,

Thanks for your answer. Unfortunately, I already used compiled UDF and the solver was in unsteady conditions. Therefore, I still do not know how to see the mesh motion.

When I use "Preview Mesh Motion", the same calcul is done all over again without changes in the meshing.

Isn't there other options that have to be activated to display the mesh motion ?

Thanks.

alireza_b June 8, 2015 14:00

Hi
what is your time step? Could you increases it and see what happens?
maybe your time step is too low, so it takes time a lot to change in cylinder position.
I suggest you calculate the frequency and then calculate period and use this time step.
Dt=Period/2000
I saw it a lot in many paper by Fluent.

Bobby155 June 9, 2015 15:18

Thanks for your advices. It turns out I just had to launch the simulation without the moving cylinder before adding the dynamic mesh and the movement based on the UDF (maybe this was evident for anyone else). I can finally see the cylinder moving.

Now, I am having trouble with the position of the cylinder during the simulation. Even when I set his gravity center at the coordinates (0,0) in the Dynamic Mesh options, it oscillates with another origin during the simulation. But maybe it is just a small problem to solve.

Anyway, thank you for your answers.

nehir May 12, 2017 08:01

oscillating cylinder dynamic mesh
 
I try to solve a flow past a oscillating cylinder between paralel wall. I would like to make cylinder goes up and down. But I cannot prepare udf file for cylinder motion. Can you help me?


All times are GMT -4. The time now is 23:52.