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

Grid motion with UDF

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 5, 2010, 09:49
Default Grid motion with UDF
  #1
Senior Member
 
Phoevos
Join Date: Mar 2009
Posts: 104
Rep Power: 15
fivos is on a distinguished road
Hi to everyone !

I am trying to simulate a moving grid using Fluent dynamic mesh. I have created a structured quad mesh and used layering as a dynamic meshing technique. The grid motion is set from the Dynamic mesh zones Create/Edit menu as User-defined and the UDF supplied is the following :

#include"udf.h"
DEFINE_GRID_MOTION(motion,domain,dt,time,dtime)
{
Thread *tf = DT_THREAD(dt);
face_t f;
Node *v;
real NV_VEC(axis);
real displ;
int n;

displ=-17.2*dtime; // grid displacement
NV_D(axis, =, 0.0, 1.0, 0.0);


begin_f_loop(f,tf)
{
f_node_loop(f,tf,n)
{
v = F_NODE(f,tf,n);
/* update node if the current node has not been previously
visited when looping through previous faces */
if ( NODE_POS_NEED_UPDATE (v))
{
/* indicate that node position has been update
so that it's not updated more than once */
NODE_POS_UPDATED(v);
NV_V_VS(NODE_COORD(v), =, NODE_COORD(v), +, axis,*,displ);
}
}
}
end_f_loop(f,tf);
}

This simple UDF was based on the DEFINE_GRID_MOTION example in the fluent 12 UDF manual. What it actually does is that it displaces the mesh on the Y-axis (axis : 0, 1,0), by -17.2 * time_step (17.2 is the mesh velocity).

The UDF compiles and loads and the mesh moves and new elements are generated/merged at stationary zones.

But my problem is that when I calculate the mesh velocity, by simply finding its displacement between two times, the mesh velocity is substantially lower than the one set in the UDF (~10m/sec instead of 17.2m/sec) !

What I am missing here? Any ideas are welcome.

Thank you in advance.
fivos is offline   Reply With Quote

Old   April 5, 2010, 11:44
Default
  #2
Senior Member
 
Phoevos
Join Date: Mar 2009
Posts: 104
Rep Power: 15
fivos is on a distinguished road
I am posting myself because I found the cause of the problem. The problem was not the UDF at all, but the wrong time intervals for the extraction of the output data files.
fivos is offline   Reply With Quote

Old   February 27, 2011, 05:51
Smile can you help me
  #3
New Member
 
fika
Join Date: Jun 2010
Posts: 4
Rep Power: 14
rafik10 is on a distinguished road
have you, sir , tutorials a bout this domain?
my boreblem is to similate fllaping NACA0012 in 2D of tow degree of 2 freedom.
I try to do it with moving gird mesh , but i cant do it .
please
email: bouakkaz10@yagoo.fr
rafik10 is offline   Reply With Quote

Old   December 24, 2016, 11:50
Smile Define_grid_motion
  #4
New Member
 
fatemeh
Join Date: Apr 2016
Posts: 2
Rep Power: 0
f.barikloo is on a distinguished road
hello everyone.
does anyone know how to write define grid motion udf with cylindrical coordinates?
thanks in advance.
f.barikloo is offline   Reply With Quote

Old   June 26, 2018, 04:07
Default tutorial
  #5
Member
 
Join Date: Nov 2017
Posts: 54
Rep Power: 7
Saman95 is on a distinguished road
hello dear

can u give me a tutorial about grid motion dynamic mesh?

if u have an address link please send me.

thanks

Last edited by Saman95; June 30, 2018 at 09:42.
Saman95 is offline   Reply With Quote

Old   June 30, 2018, 09:50
Default
  #6
Member
 
Join Date: Nov 2017
Posts: 54
Rep Power: 7
Saman95 is on a distinguished road
Quote:
Originally Posted by fivos View Post
Hi to everyone !

I am trying to simulate a moving grid using Fluent dynamic mesh. I have created a structured quad mesh and used layering as a dynamic meshing technique. The grid motion is set from the Dynamic mesh zones Create/Edit menu as User-defined and the UDF supplied is the following :

#include"udf.h"
DEFINE_GRID_MOTION(motion,domain,dt,time,dtime)
{
Thread *tf = DT_THREAD(dt);
face_t f;
Node *v;
real NV_VEC(axis);
real displ;
int n;

displ=-17.2*dtime; // grid displacement
NV_D(axis, =, 0.0, 1.0, 0.0);


begin_f_loop(f,tf)
{
f_node_loop(f,tf,n)
{
v = F_NODE(f,tf,n);
/* update node if the current node has not been previously
visited when looping through previous faces */
if ( NODE_POS_NEED_UPDATE (v))
{
/* indicate that node position has been update
so that it's not updated more than once */
NODE_POS_UPDATED(v);
NV_V_VS(NODE_COORD(v), =, NODE_COORD(v), +, axis,*,displ);
}
}
}
end_f_loop(f,tf);
}

This simple UDF was based on the DEFINE_GRID_MOTION example in the fluent 12 UDF manual. What it actually does is that it displaces the mesh on the Y-axis (axis : 0, 1,0), by -17.2 * time_step (17.2 is the mesh velocity).

The UDF compiles and loads and the mesh moves and new elements are generated/merged at stationary zones.

But my problem is that when I calculate the mesh velocity, by simply finding its displacement between two times, the mesh velocity is substantially lower than the one set in the UDF (~10m/sec instead of 17.2m/sec) !

What I am missing here? Any ideas are welcome.

Thank you in advance.

hello sir

Do you know the meaning of the bottom commands?

NODE_POS_UPDATED(v);

NODE_COORD(v)

NV_D(axis, =, 0.0, 1.0, 0.0);

please help me

thanks
Saman95 is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
UDF problem: incorrect grid motion Fil FLUENT 5 December 19, 2020 10:16
udf for wall motion tseo Fluent UDF and Scheme Programming 1 June 14, 2012 18:57
MapFields to New Grid For Extreme Grid Deformations due to Body Motion albcem OpenFOAM 0 May 5, 2009 15:17
Grid Macros for UDF elena FLUENT 0 May 9, 2006 09:44
UDF to change BC from Wall to Grid Line Aaron Smith FLUENT 0 February 21, 2006 10:14


All times are GMT -4. The time now is 12:19.