|
[Sponsors] |
March 1, 2019, 16:52 |
Simple UDF Define Grid Motion Error
|
#1 |
New Member
Molly Binni
Join Date: Feb 2019
Posts: 2
Rep Power: 0 |
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. Last edited by mollybinni; March 1, 2019 at 17:54. Reason: update |
|
Tags |
dynamic mesh, udf |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
checking the system setup and Qt version | vivek070176 | OpenFOAM Installation | 22 | June 1, 2010 13:34 |
[swak4Foam] groovyBC: problems compiling: "flex: not found" and "undefined reference to ..." | sega | OpenFOAM Community Contributions | 12 | February 17, 2010 10:30 |
Version 15 on Mac OS X | gschaider | OpenFOAM Installation | 113 | December 2, 2009 11:23 |
Compiling problems with hello worldC | fw407 | OpenFOAM Installation | 21 | January 6, 2008 18:38 |
user subroutine error | CFDUSER | CFX | 2 | December 9, 2006 07:31 |