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

UDF - Question

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 8, 2020, 10:10
Default UDF - Question
  #1
Member
 
sandy
Join Date: May 2013
Posts: 91
Rep Power: 12
archeoptyrx is on a distinguished road
Hi i am trying to understand the define grid motion udf given in the manual.

Can someone explain what is 0.230 "pow (NODE_X(v)/0.230, 0.5)" doing here ? . Why do we want to divide the node x by that number ?


Quote:
node motion based on simple beam deflection equation
compiled UDF
************************************************** ********/
#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[1] = sign * pow (NODE_X(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);
}
archeoptyrx is offline   Reply With Quote

Old   May 8, 2020, 12:21
Default Equation
  #2
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 35
vinerm will become famous soon enough
That's just an equation for a cantilever motion. You would anyway use your own equation.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   May 8, 2020, 15:37
Default
  #3
Member
 
sandy
Join Date: May 2013
Posts: 91
Rep Power: 12
archeoptyrx is on a distinguished road
Thanks Vinerm.
archeoptyrx 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
question on udf melj FLUENT 10 February 12, 2020 12:49
A general question on using UDF for defining reaction kinetics Morijef Fluent UDF and Scheme Programming 0 September 19, 2018 15:37
WILLING TO PAY/ FREELANCER REQUIRED / small UDF coding force loads over body / 6DOF acasas CFD Freelancers 1 January 23, 2015 07:26
Basic question: UDF for wall heat flux Carl FLUENT 1 August 5, 2006 19:01
UDF question Meghesh FLUENT 1 November 2, 2004 08:24


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