CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   UDF applied dynamic mesh and mesh motion in the same time (https://www.cfd-online.com/Forums/fluent-udf/150003-udf-applied-dynamic-mesh-mesh-motion-same-time.html)

lostmmind March 13, 2015 02:09

UDF applied dynamic mesh and mesh motion in the same time
 
Hi guys

I'm working on a car electroplate case. It is about a car rotate and translate in a big water tank. I tried dynamic mesh for both rotation and translation. But as you can imagine, the mesh twisted so hard and give me errors about negative volume. So i am thinking about applying interface boundary for the car rotational region, and apply mesh motion in it. Then use dynamic mesh only for the outter interface which does not rotate.

Anyone done that before? Is that possible? please help me, my boss is killing me

Thank you.

lostmmind March 16, 2015 20:22

hahaha
 
I nailed it!! write a udf contains both CG_MOTION and ZONE_MOTION. Compile it and apply ZONE_MOTION in the mesh motion(in cell zone conditions). And apply CG_MOTION in dynamic mesh part.

Here is something important.
1.CG_MOTION should only contain the translational velocity but not the rotational velocity.
2.CG_MOTION should be applied to all the moving boundaries including those you already defined in mesh motion

here is my udf, hope it is helpful.


#include "udf.h"
DEFINE_CG_MOTION(dong, dt, vel, omega, time, dtime)
{
vel[0]=0.1;
vel[1]=-0.3;
vel[2]=0;
}

DEFINE_ZONE_MOTION(rotor, omega, axis, origin, velocity, time, dtime)
{
real ox1, oy1;

*omega = 1;

ox1 = -2.3+0.1*(time+dtime);
oy1 = 0.8-0.3*(time+dtime);
origin[0] = ox1;
origin[1] = oy1;
origin[2] = 0.0;
}

shadiparsa March 26, 2015 04:37

Hello and thanks for the case
I am using the DEFINE_GRID_MOTION and the DEFINE_GEOM macros for the UDF of mine. My case is a 2D case with a moving part. I have been getting the negative mesh error constantly and don't know how to solve the problem. Do you have any idea how this can be solve?

lostmmind March 26, 2015 19:36

hi
 
I think the reason you get negative volume is because the displacement of you boundary in some time step is bigger than the size of your mesh, try to coarsen your mesh or reduce the size of you time step.

sorry for reply late, it's been so busy of me.

XU

shadiparsa March 27, 2015 03:18

Quote:

Originally Posted by lostmmind (Post 538462)
I think the reason you get negative volume is because the displacement of you boundary in some time step is bigger than the size of your mesh, try to coarsen your mesh or reduce the size of you time step.

sorry for reply late, it's been so busy of me.

XU

Hello lostmind
Thanks alot for your reply.
I will try this to see what is the problem but I will post the pictures I get to show you what is going on,I tried first with the very coarse mesh but still got the same error.
https://drive.google.com/file/d/0B1n...ew?usp=sharing
https://drive.google.com/file/d/0B1n...ew?usp=sharing

lostmmind March 28, 2015 21:25

sorry pal, im in china, google is blocked, please try something else. and Dropbox is blocked too.

lostmmind March 28, 2015 21:34

and please put some pics about your dynamic mesh settings in Fluent. My email 1067542448@qq.com

shadiparsa April 6, 2015 09:57

Thanks lostmmind,I have sent some details to the prescribed email...still stuck with this error!


All times are GMT -4. The time now is 00:56.