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

Can someone help me with an UDF for a rotatory mesh?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 1, 2013, 23:27
Default Can someone help me with an UDF for a rotatory mesh?
  #1
Member
 
Arthur Loginow
Join Date: Aug 2012
Posts: 99
Rep Power: 13
Maralady is on a distinguished road
Hello, I am trying to create a code to this geometry, as you can see at the images it is a simple geometry, it is a pipe with 2 bodies rotating inside, so far I have been reading the UDF manual, and I made a code I would like to make some questions but first here is the code:

#include "udf.h"

DEFINE_CG_MOTION(Rotation,dt,vel,omega,time,dtime)
{
Thread *t;
face_t f;

/*reset velocities*/
NV_S(vel, =, 0.0);
NV_S(omega, =, 0.0);

/*not too sure what this is for*/
if (!Data_Valid_P())
return;
/*get the thread pointer for which this motion is defines (I assume that this is the cell zone that I made)*/
t = DT_THREAD(dt);

/* motion */
velocity[0] = 0;
velocity[1] = 0;
velocity[2] = 0;
omega[0] = 0;
omega[1] = 0;
/*This will be just a random number, I will try different values anyway*/
omega[2] = 120;
/*not sure how to do the loop and if I should make the loop for faces or cells*/
}



Question 1: Do I have to create a UDF for each body? Or can I include both bodies at the same UDF?

Question 2: Well as you can see at the code, I am not quite sure of how to make the loop (I have a decent programming knowledge, and because of this forced to learn C, I know how to create a loop, but I do not know what variables to include for the loop, so far I know the pointer will tell the program to use some faces/cells and that leads me to my other question)

Question 3: Should I use faces or cells for the Loop?

Question 4: There is something that I am missing?

I read just the first 2 chapters of the UDF guide, I will finish all the guide soon, but I think that the next chapters will not clear those doubts.

Thanks
Attached Images
File Type: jpg Example.jpg (18.1 KB, 6 views)
Maralady is offline   Reply With Quote

Old   August 3, 2013, 11:17
Default
  #2
Member
 
Arthur Loginow
Join Date: Aug 2012
Posts: 99
Rep Power: 13
Maralady is on a distinguished road
I would like to know if I should use the cells or the faces, so far I understand that I should use the faces because that will make the adjacent cells to move as well and that is what I am looking for
Maralady is offline   Reply With Quote

Reply


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
Dynamic Mesh UDF Qureshi FLUENT 7 March 23, 2017 07:37
[Gmsh] 2D Mesh Generation Tutorial for GMSH aeroslacker OpenFOAM Meshing & Mesh Conversion 12 January 19, 2012 03:52
Help with UDF to change mesh by external mesh generator zou_mo Fluent UDF and Scheme Programming 1 July 1, 2009 04:57
with UDF to change mesh by external mesh generator zou_mo FLUENT 0 June 30, 2009 07:15
Convergence moving mesh lr103476 OpenFOAM Running, Solving & CFD 30 November 19, 2007 14:09


All times are GMT -4. The time now is 21:31.