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

Simple UDF Define Grid Motion Error

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By mollybinni

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 1, 2019, 15:52
Default Simple UDF Define Grid Motion Error
  #1
New Member
 
Molly Binni
Join Date: Feb 2019
Posts: 2
Rep Power: 0
mollybinni is on a distinguished road
Hi everyone. I have a simple box that I am trying to deform. I want to move all nodal x coordinates by 0.5 mm at 20 seconds. This is only applied to the wall. When I use my UDF in ANSYS Fluent, however, nothing happens when previewing the mesh movement. What I am I doing wrong?

Here is my code:
#include "udf.h"

DEFINE_GRID_MOTION(moveit,domain,dt,time,dtime)
{
Thread *tf = DT_THREAD(dt);
face_t f;
Node *node;
int n;
real current_time;
current_time = CURRENT_TIME ;

real NV_VEC(vetcoord);
vetcoord[0] = 0.5 ;
vetcoord[1] = 0 ;
vetcoord[2] = 0 ;

SET_DEFORMING_THREAD_FLAG(THREAD_T0(tf));


begin_f_loop(f,tf)
{
f_node_loop(f,tf,n)
{
node = F_NODE(f,tf,n);

if (NODE_POS_NEED_UPDATE(node) && current_time == 20)
{

NODE_POS_UPDATED(node);
NV_V(NODE_COORD(node), +=, vetcoord);

}
}
}

end_f_loop(f,tf);
}

Any ideas are welcomed and thanks for the help!

EDITED: I need to use Define Grid Motion because the final UDF will involve different displacements for each node. Right now this is a just a simplified version for debugging.
lakku12 likes this.

Last edited by mollybinni; March 1, 2019 at 16:54. Reason: update
mollybinni is offline   Reply With Quote

Reply

Tags
dynamic mesh, udf


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
checking the system setup and Qt version vivek070176 OpenFOAM Installation 22 June 1, 2010 12:34
[swak4Foam] groovyBC: problems compiling: "flex: not found" and "undefined reference to ..." sega OpenFOAM Community Contributions 12 February 17, 2010 09:30
Version 15 on Mac OS X gschaider OpenFOAM Installation 113 December 2, 2009 10:23
Compiling problems with hello worldC fw407 OpenFOAM Installation 21 January 6, 2008 17:38
user subroutine error CFDUSER CFX 2 December 9, 2006 06:31


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