CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

2d Dynamic Mesh with udf

Register Blogs Community New Posts Updated Threads Search

Like Tree9Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 6, 2009, 06:57
Exclamation 2d Dynamic Mesh with udf
  #1
pvc
New Member
 
pramod
Join Date: Mar 2009
Location: delhi
Posts: 7
Rep Power: 17
pvc is on a distinguished road
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 ?


#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........

Last edited by pvc; November 6, 2009 at 08:37.
pvc is offline   Reply With Quote

Old   November 10, 2009, 06:31
Default
  #2
Member
 
O.D.Y.'s Avatar
 
Join Date: Mar 2009
Posts: 49
Rep Power: 17
O.D.Y. is on a distinguished road
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



O.D.Y. is offline   Reply With Quote

Old   November 10, 2009, 07:01
Exclamation
  #3
pvc
New Member
 
pramod
Join Date: Mar 2009
Location: delhi
Posts: 7
Rep Power: 17
pvc is on a distinguished road
[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 .
pvc is offline   Reply With Quote

Old   November 10, 2009, 08:02
Default
  #4
Member
 
O.D.Y.'s Avatar
 
Join Date: Mar 2009
Posts: 49
Rep Power: 17
O.D.Y. is on a distinguished road
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!
Kent_Neo likes this.
O.D.Y. is offline   Reply With Quote

Old   November 11, 2009, 01:40
Exclamation
  #5
pvc
New Member
 
pramod
Join Date: Mar 2009
Location: delhi
Posts: 7
Rep Power: 17
pvc is on a distinguished road
[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 is offline   Reply With Quote

Old   November 11, 2009, 02:19
Exclamation
  #6
pvc
New Member
 
pramod
Join Date: Mar 2009
Location: delhi
Posts: 7
Rep Power: 17
pvc is on a distinguished road
Quote:
Originally Posted by O.D.Y. View Post
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
pvc is offline   Reply With Quote

Old   November 11, 2009, 04:13
Default
  #7
Member
 
O.D.Y.'s Avatar
 
Join Date: Mar 2009
Posts: 49
Rep Power: 17
O.D.Y. is on a distinguished road
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



O.D.Y. is offline   Reply With Quote

Old   November 11, 2009, 05:27
Default
  #8
pvc
New Member
 
pramod
Join Date: Mar 2009
Location: delhi
Posts: 7
Rep Power: 17
pvc is on a distinguished road
[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



pvc is offline   Reply With Quote

Old   November 13, 2009, 06:58
Default
  #9
New Member
 
Pablo
Join Date: Oct 2009
Posts: 5
Rep Power: 17
RockaFella is on a distinguished road
Quote:
Originally Posted by O.D.Y. View Post
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
RockaFella is offline   Reply With Quote

Old   November 13, 2009, 07:33
Default
  #10
Member
 
O.D.Y.'s Avatar
 
Join Date: Mar 2009
Posts: 49
Rep Power: 17
O.D.Y. is on a distinguished road
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?

O.D.Y. is offline   Reply With Quote

Old   November 13, 2009, 09:46
Default
  #11
New Member
 
Pablo
Join Date: Oct 2009
Posts: 5
Rep Power: 17
RockaFella is on a distinguished road
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...
RockaFella is offline   Reply With Quote

Old   November 13, 2009, 11:23
Default
  #12
Member
 
O.D.Y.'s Avatar
 
Join Date: Mar 2009
Posts: 49
Rep Power: 17
O.D.Y. is on a distinguished road
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.
O.D.Y. is offline   Reply With Quote

Old   November 13, 2009, 19:44
Default
  #13
New Member
 
Pablo
Join Date: Oct 2009
Posts: 5
Rep Power: 17
RockaFella is on a distinguished road
Okay, very good to know!

Thank you for the advice, this will probably work for my problem either.
RockaFella is offline   Reply With Quote

Old   November 18, 2009, 09:56
Default
  #14
Member
 
Join Date: Sep 2009
Posts: 69
Rep Power: 17
DarrenC is on a distinguished road
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.





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
DarrenC is offline   Reply With Quote

Old   November 18, 2009, 12:11
Default
  #15
Member
 
O.D.Y.'s Avatar
 
Join Date: Mar 2009
Posts: 49
Rep Power: 17
O.D.Y. is on a distinguished road
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
ftab, Kent_Neo and Mentorslayer like this.
O.D.Y. is offline   Reply With Quote

Old   November 19, 2009, 00:59
Default
  #16
Member
 
Join Date: Sep 2009
Posts: 69
Rep Power: 17
DarrenC is on a distinguished road
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
DarrenC is offline   Reply With Quote

Old   May 29, 2010, 21:07
Default hello people
  #17
New Member
 
euzinho
Join Date: May 2010
Posts: 15
Rep Power: 16
euzinho is on a distinguished road
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. View Post
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!
Attached Images
File Type: jpg Dibujo.jpg (92.4 KB, 260 views)
euzinho is offline   Reply With Quote

Old   May 30, 2010, 07:41
Default
  #18
Member
 
O.D.Y.'s Avatar
 
Join Date: Mar 2009
Posts: 49
Rep Power: 17
O.D.Y. is on a distinguished road
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
O.D.Y. is offline   Reply With Quote

Old   May 30, 2010, 09:01
Default
  #19
New Member
 
euzinho
Join Date: May 2010
Posts: 15
Rep Power: 16
euzinho is on a distinguished road
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. View Post
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 is offline   Reply With Quote

Old   May 30, 2010, 09:23
Default
  #20
New Member
 
euzinho
Join Date: May 2010
Posts: 15
Rep Power: 16
euzinho is on a distinguished road
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. View Post
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 is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 07:20
Dynamic mesh UDF problem Peter FLUENT 2 November 12, 2007 03:10
writing a dynamic mesh udf ALPER ALBAYRAQ FLUENT 0 October 24, 2005 09:41
Problem related with UDF for dynamic mesh Ryan FLUENT 6 April 29, 2004 10:29
UDF problem for dynamic mesh??? lyf FLUENT 1 April 19, 2004 07:43


All times are GMT -4. The time now is 22:40.