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

udf dynamic mesh

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 6, 2013, 15:49
Default udf dynamic mesh
  #1
New Member
 
hilla tor
Join Date: Nov 2012
Posts: 22
Rep Power: 13
hillat is on a distinguished road
I am trying to built a simple problem of dynamic mesh

the grid is a rectangle and I want the lower wall would behave like a wave, something like
y=0.5*sin(10*t)
when t is the time

I wrote the following code but when I put it in the dynamic mesh I don't see any change in the mesh while run the calculation


Code:
 
#include"udf.h"
DEFINE_GRID_MOTION(beam,domain,dt,time,dtime)
{
Thread *tf = DT_THREAD(dt);
face_t f;
Node *v;
real NV_VEC(omega), NV_VEC(axis), NV_VEC(dx);
real NV_VEC(origin), NV_VEC(rvec);
real sign;
int n;
/* set deforming flag on adjacent cell zone */
SET_DEFORMING_THREAD_FLAG(THREAD_T0(tf));
sign = -5.0 * sin (26.178 * time);
Message ("time = %f, omega = %f\n", time, sign);
NV_S(omega, =, 0.0);
NV_D(axis, =, 0.0, 1.0, 0.0);
NV_D(origin, =, 0.0, 0.0, 0.152);
begin_f_loop(f,tf)
{
f_node_loop(f,tf,n)
{
v = F_NODE(f,tf,n);
/* update node if x position is greater than 0.02
and that the current node has not been previously
visited when looping through previous faces */
if (NODE_X(v) > 0.020 && 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);
omega[2] = sign * pow (NODE_y(v)/0.230, 0.5);
NV_VV(rvec, =, NODE_COORD(v), -, origin);
NV_CROSS(dx, omega, rvec);
NV_S(dx, *=, dtime);
NV_V(NODE_COORD(v), +=, dx);
}
}
}
end_f_loop(f,tf);
}
thanks for the help
hilla
hillat is offline   Reply With Quote

Old   February 10, 2013, 19:00
Default
  #2
Senior Member
 
Syavash Asgari
Join Date: Apr 2010
Posts: 473
Rep Power: 18
syavash is on a distinguished road
Quote:
Originally Posted by hillat View Post
I am trying to built a simple problem of dynamic mesh

the grid is a rectangle and I want the lower wall would behave like a wave, something like
y=0.5*sin(10*t)
when t is the time

I wrote the following code but when I put it in the dynamic mesh I don't see any change in the mesh while run the calculation


Code:
 
#include"udf.h"
DEFINE_GRID_MOTION(beam,domain,dt,time,dtime)
{
Thread *tf = DT_THREAD(dt);
face_t f;
Node *v;
real NV_VEC(omega), NV_VEC(axis), NV_VEC(dx);
real NV_VEC(origin), NV_VEC(rvec);
real sign;
int n;
/* set deforming flag on adjacent cell zone */
SET_DEFORMING_THREAD_FLAG(THREAD_T0(tf));
sign = -5.0 * sin (26.178 * time);
Message ("time = %f, omega = %f\n", time, sign);
NV_S(omega, =, 0.0);
NV_D(axis, =, 0.0, 1.0, 0.0);
NV_D(origin, =, 0.0, 0.0, 0.152);
begin_f_loop(f,tf)
{
f_node_loop(f,tf,n)
{
v = F_NODE(f,tf,n);
/* update node if x position is greater than 0.02
and that the current node has not been previously
visited when looping through previous faces */
if (NODE_X(v) > 0.020 && 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);
omega[2] = sign * pow (NODE_y(v)/0.230, 0.5);
NV_VV(rvec, =, NODE_COORD(v), -, origin);
NV_CROSS(dx, omega, rvec);
NV_S(dx, *=, dtime);
NV_V(NODE_COORD(v), +=, dx);
}
}
}
end_f_loop(f,tf);
}
thanks for the help
hilla
Hi,

I can't see any motion specified to y coordinate like that you've stated earlier!! Try to clarify your exact motion for us at first step till we might be able to help you.

tnx
syavash 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
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 06:20
Dynamic mesh UDF problem Peter FLUENT 2 November 12, 2007 02:10
writing a dynamic mesh udf ALPER ALBAYRAQ FLUENT 0 October 24, 2005 08:41
Problem related with UDF for dynamic mesh Ryan FLUENT 6 April 29, 2004 09:29
UDF problem for dynamic mesh??? lyf FLUENT 1 April 19, 2004 06:43


All times are GMT -4. The time now is 04:46.