CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   2d Dynamic Mesh with udf (http://www.cfd-online.com/Forums/fluent-udf/69840-2d-dynamic-mesh-udf.html)

pvc November 6, 2009 06:57

2d Dynamic Mesh with udf
 
HI
i m try to moving mesh problem
my geometry like simple square box inside small rectangle blade with tet mesh
successful . But when i m using pave mesh it is not successful error came while mesh motion negative volume created .
please help me . Is there problem with udf? or dynamic parameter setting ?
:confused:

#include "udf.h"

#define omega 5.0 /* rotational speed, rad/sec */


DEFINE_CG_MOTION(butterfly_flex_UDF, dt, cg_vel, cg_omega, time, dtime)
{
cg_vel[0] = 0.0;
cg_vel[1] = 0.0;
cg_vel[2] = 0.0;

cg_omega[0] = 0.0;
cg_omega[1] = 0.0;
cg_omega[2] = omega;
}

DEFINE_GRID_MOTION(moving_arc, domain, dt, time, dtime)
{
Thread *tf = DT_THREAD (dt);
face_t f;
Node *node_p;
SET_DEFORMING_THREAD_FLAG (THREAD_T0 (tf));

}


this is my udf thank you........

O.D.Y. November 10, 2009 06:31

Hi there,

what mesh do you mean with pave mesh?

I mean you can do paved meshes of quad cells or tri cells in gambit?

If you're using quad cells you have to enable spring based smoothing for them, by default its only enabled for tri-cells (and see 11.3.2. of the user guide (6.3.26) for dynamic-mesh issues:

define / models / dynamic-mesh-controls / smoothing-parameter / spring-on-all-shapes? yes




pvc November 10, 2009 07:01

[QUOTE=O.D.Y.;235705]Hi there,

what mesh do you mean with pave mesh?

I mean you can do paved meshes of quad cells or tri cells in gambit?

If you're using



thanks for your suggestion I am using quad pave mesh
but when i try for mesh motion only boundary node moves internal node dosent move I also use cell height option .

O.D.Y. November 10, 2009 08:02

well if you mean the cell height option in the dynamic mesh zones menu, this one just plays a role for remeshing.

if only the boundary nodes move, make sure that the interior-domain is given a deforming flag in the dynamic-mesh-zones menu.
if this is the case, try to reduce the spring constant factor and to increase the number of mesh motion iteration, this distributes the displacement more over the entire domain.

If your displacements are bigger than the cell sizes, you should use remeshing-option to avoid negativ volumes.

hope this helps, let me know if it works!

pvc November 11, 2009 01:40

[QUOTE=O.D.Y.;235716]well if you mean the cell height option in the dynamic mesh zones menu, this one just plays a role for remeshing.

if only the boundary nodes move, make sure that the interior-domain is given a deforming flag in the dynamic-mesh-zones menu.
if this is the case, try to reduce the spring constant factor and to increase the number of mesh motion iteration, this distributes the displacement more over the entire domain.


Thank you for kind suggestion I also work on that but same problem occur internal node not moving so negative volume created .
If you want try on this i am giving you link for mesh file and udf file.

http://www.megaupload.com/?d=YWUI5DAG
mesh file

http://www.megaupload.com/?d=NSBYW5BN
udf file

Thank you.

pvc November 11, 2009 02:19

Quote:

Originally Posted by O.D.Y. (Post 235716)
well if you mean the cell height option in the dynamic mesh zones menu, this one just plays a role for remeshing.

if only the boundary nodes move, make sure that the interior-domain is given a deforming flag in the dynamic-mesh-zones menu.
if this is the case, try to reduce the spring constant factor and to increase the number of mesh motion iteration, this distributes the displacement more over the entire domain.

If your displacements are bigger than the cell sizes, you should use remeshing-option to avoid negativ volumes.

hope this helps, let me know if it works!


I have one more problem in 3d tetrahydral mesh this udf not works can you tell
me how to change in udf so that negative volume will not create because only
boundary node moves internal element doesnt move .

Thanks a lot

O.D.Y. November 11, 2009 04:13

Hi there,

I took a short look in the user guide and i found:

You can use the local remeshing method only in cell zones that contain tetrahedral or triangular cells.

So you can use dynamic mesh only on triangular cells.

But you might think about doing the caculation as moving reference frame with assigning the outer wall zero absolute veloctiy.
This surely depends on how the configuration looks like in reality....

cheers




pvc November 11, 2009 05:27

[QUOTE=O.D.Y.;235804]Hi there,

I took a short look in the user guide and i found:

You can use the local remeshing method only in cell zones that contain tetrahedral or triangular cells.

So you can use dynamic mesh only on triangular cells.

But


No i actually want do simulation in 3d tetrahydral dynamic meshing
I already done moving referance frame simulation but now i want give actual motion to the rigid body
thanks for reply




RockaFella November 13, 2009 06:58

Quote:

Originally Posted by O.D.Y. (Post 235804)
You can use the local remeshing method only in cell zones that contain tetrahedral or triangular cells.

Are you sure about that? I'm asking, because that is what I'm doing right now... and I also use Fluent 6.3

O.D.Y. November 13, 2009 07:33

Hi,

and is it working?

I mean this is what the user guide is telling me:

FLUENT includes several remeshing methods that include local remeshing, local face remeshing (for 3D flows only), face region remeshing, and 2.5D surface remeshing (for 3D flows only). The available remeshing methods in FLUENT work for triangular-tetrahedral zones and mixed zones where the non-triangular/tetrahedral elements are skipped

I made an simple example and there was no remeshing....
What's your experience?


RockaFella November 13, 2009 09:46

Oh, just noticed that I mixed up remeshing and smoothing. I'm sorry!!!
Acutally, I do have the same problem with the remeshing. It's a shame that fluent isn't able to remesh quad grids...

O.D.Y. November 13, 2009 11:23

So that's my problem too...

I switched to hybrid meshes with quad/hex-boundary layer mesh and tri/tet-meshes in the domain, that works pretty well.

RockaFella November 13, 2009 19:44

Okay, very good to know!

Thank you for the advice, this will probably work for my problem either.

DarrenC November 18, 2009 09:56

Hi everyone,

I am having this negative volume problem as well. My problem is a simulation of an aerofoil pitching upwards around the quarter chord. Let me just show you all how I have set up my mesh.

http://i932.photobucket.com/albums/a...e/NACA0012.jpg

http://i932.photobucket.com/albums/a...NACA0012-2.jpg

Basically it is a hybrid mesh with hex near the boundary and triangles everywhere else.

Ive tried to reduce the time step, but the mesh previews gives me a negative volume message at the very 1st iteration. I have also turned on the dynamic mesh parameter for quad mesh which was turned off by default but did not fix the problem.

Just for your information, I have tried the dynamic mesh with a purely triangular mesh and that worked. It is only when I added the hex mesh near the boundary that it stopped working. So i am assuming it has something to do with the hexa mesh?

ODY you mentioned that you got your simulation working with a hybrid mesh?? could you shed some light on this for me??

Thanks in advance

Darren

O.D.Y. November 18, 2009 12:11

Hi Darren.

Well I did calculation with "dynamic mesh" with meshes similar to yours.

1st thing is to make sure, that you enable spring-based-smoothing for all types of elements (spring on all shapes). But you wrote that you already did this, right?

Next thing is to use smoothing and remeshing.
you may want to try my dynamic mesh parameters:

spring factor: 0.01
boundary relaxation: 1
convergance tolerance: 0.0001
number of iterations: 150

and for remeshing you need to set the parameters according to your mesh.

set the remesh interval on 1.

That's how I'm doing it. Give it a try and let me know, I'm curious about it.

BTW: is this an inviscid calculation?

cheers

DarrenC November 19, 2009 00:59

Hey ODY,

Ive tried your settings and they work for me perfectly. Thanks a bunch!!!. I think the trick is to get it to move real slow so that it dosent deform to the point of negative volume. Ill have to fine tune it a little bit more and see how it all goes.

FYI i am actually running a compressible viscous calculation as I am simulating this at quite high mach numbers.

By the way, do u happen to use ICEM to build your 2d hybrid mesh? Apparently there are alot of methods to do this, and the way I do it (just specifying layer params in curve mesh setup' is not very good. Did you use '2dBlayer' in advanced prism meshing?

Thanks again!

Regards,
Darren

euzinho May 29, 2010 20:07

hello people
 
1 Attachment(s)
I am trying to rotate a butterfly valve, but I canīt make the valve move at all,
can you help me out, please?
I have been trying to compile this code that you attached here without success

I send you a .jpg
I hope you can lead my way,
thanks


Quote:

Originally Posted by O.D.Y. (Post 235716)
well if you mean the cell height option in the dynamic mesh zones menu, this one just plays a role for remeshing.

if only the boundary nodes move, make sure that the interior-domain is given a deforming flag in the dynamic-mesh-zones menu.
if this is the case, try to reduce the spring constant factor and to increase the number of mesh motion iteration, this distributes the displacement more over the entire domain.

If your displacements are bigger than the cell sizes, you should use remeshing-option to avoid negativ volumes.

hope this helps, let me know if it works!


O.D.Y. May 30, 2010 06:41

Hey euzinho,

how large should the displacement of your body you showed in the picture get? If its only a small one, the smoothing should be sufficient.
But then you need to specify smoothing for all cell types via TUI as decribed above...

Did you properly assign the rigid body movements to your body in the dynamic mesh option? Can you post your udf?

cheers

euzinho May 30, 2010 08:01

thanks for your response,
Actually i am trying to rotate this body 45š because it simulates a butterfly valve that opens

the idea is to create a transient simulation that studies the behaviour before and after the valve opens. So I need to rotate it just 45š. No displacement whatsoever, just rotation

the UDF ? well, I donīt have one concrete code developed at the moment but a lot instead,
because I am evaluating different options since I donīt have a clear idea about how it works.

for example:
#include "udf.h"
DEFINE_CG_MOTION(pod,dt,vel,omega,time,dtime)
{
NV_S(vel,=,0);
NV_S(omega,=,0);
omega[0]=1;
}

this one moves rotating through the x egde
the same one with omega[1] rotates through the y egde
and omega[2] should rotate through the z egde (what I need) but.. it doesnīt work..

And also it rotates according to a center o gravity far away from the one what I need... so not only I have to rotate this valve but also to specify its center of gravity...

I hope you can help me out because I am also dreaming about it during the night

thanks




Quote:

Originally Posted by O.D.Y. (Post 260865)
Hey euzinho,

how large should the displacement of your body you showed in the picture get? If its only a small one, the smoothing should be sufficient.
But then you need to specify smoothing for all cell types via TUI as decribed above...

Did you properly assign the rigid body movements to your body in the dynamic mesh option? Can you post your udf?

cheers


euzinho May 30, 2010 08:23

by the way,
Iīve read something about sliding mesh to resolve problems related with rotation... do you think it could be another way to face my problem instead of using UDF ?

thanks




Quote:

Originally Posted by O.D.Y. (Post 260865)
Hey euzinho,

how large should the displacement of your body you showed in the picture get? If its only a small one, the smoothing should be sufficient.
But then you need to specify smoothing for all cell types via TUI as decribed above...

Did you properly assign the rigid body movements to your body in the dynamic mesh option? Can you post your udf?

cheers



All times are GMT -4. The time now is 06:10.