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 a UDF for a simple rotatory geometry??

Register Blogs Community New Posts Updated Threads Search

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   August 1, 2013, 22:00
Default Can someone help me with a UDF for a simple rotatory geometry??
  #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, 43 views)
Maralady is offline   Reply With Quote

 


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
FLUENT UDF Simple error. startup0820 Fluent UDF and Scheme Programming 0 August 14, 2012 03:54
Need help on meshing this simple geometry nha1g08 ANSYS Meshing & Geometry 3 March 9, 2011 02:13
[snappyHexMesh] Irregular mesh generation for simple box geometry ajl42 OpenFOAM Meshing & Mesh Conversion 0 March 7, 2011 17:04
Problem with a simple UDF to calculate cell-averaged particle values kmayank FLUENT 1 January 18, 2011 01:40
vitual _ real deneb FLUENT 3 January 22, 2007 04:31


All times are GMT -4. The time now is 20:09.