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

Compile 6Dof-Rotary UDF code

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 24, 2022, 07:11
Default Compile 6Dof-Rotary UDF code
  #1
New Member
 
bob
Join Date: Oct 2017
Posts: 18
Rep Power: 9
batuning is on a distinguished road
Dear friends ,


can you run my code .i want simply rotate a turbine with wind velocity .but my code no compile and error , my fluent and visual studio works and no problem for compiling codes .just this code no works .can you find a problem ?


my other question is how can achieve ab omega (w) angular velocity every time?



#include "udf.h"
#include "math.h"

DEFINE_SDOF_PROPERTIES(rotor, prop, dt, time, dtime)
{
prop[SDOF_MASS] = 0.218786; /*Mass of the rigid body in [kg] */
prop[SDOF_IZZ] = 0.000161; /*Mass moment of inertia about Z axis [kg/m^2]*/

/* Translational motion setting, use TRUE and FALSE as applicable */
prop[SDOF_ZERO_TRANS_X] = TRUE; /*Translation allowed in global X-Direction? */
prop[SDOF_ZERO_TRANS_Y] = TRUE; /*Translation allowed in global Y-Direction? */
prop[SDOF_ZERO_TRANS_Z] = TRUE; /*Translation allowed in global Z-Direction? */

/* Rotational motion setting, use TRUE and FALSE as applicable*/
prop[SDOF_ZERO_ROT_X] = TRUE; /*Rotation allowed about global X-Axis? */
prop[SDOF_ZERO_ROT_Y] = TRUE; /*Rotation allowed about global Y-Axis? */
prop[SDOF_ZERO_ROT_Z] = FALSE; /*Rotation allowed about global Z-Axis? */


/* DT_THETA(dt): orientation of body-fixed axis vector, DT_CG(dt): center of gravity vector, DT_VEL_CG(dt): cg velocity vector, DT_OMEGA_CG(t): angular velocity vector */
prop[SDOF_LOAD_M_Z] = -9.81 * sin(DT_THETA(dt)[2]) ;
Message("\n 2D: updated 6DOF properties DT_THETA_Z: %e, Mz: %e, Mass: %e \n",
DT_THETA(dt)[2], prop[SDOF_MASS]);
}
batuning is offline   Reply With Quote

Old   November 28, 2022, 20:16
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
code is correct except last line
Code:
Message("\n 2D: updated 6DOF properties DT_THETA_Z: %e, Mz: %e, Mass: %e \n",DT_THETA(dt)[2], prop[SDOF_LOAD_M_Z], prop[SDOF_MASS]);
however, it should not be a problem,
try it anyway
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Old   November 29, 2022, 03:46
Default
  #3
New Member
 
bob
Join Date: Oct 2017
Posts: 18
Rep Power: 9
batuning is on a distinguished road
thanks .and can you tell me how i use (extract) omega (angular velocity ) for this code?
udf.c
i want move rotor and gate as wind power not as omega .


i should change omega (w) .and try put 6dof angular velocity
batuning is offline   Reply With Quote

Reply

Tags
fluent - udf, udf compilation


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
UDF ansys fluent error that I ́m unable to identify, happens when I compile the UDF JuanReyes Fluent UDF and Scheme Programming 2 August 14, 2023 12:01
Urgent help for UDF Code needed force_95 FLUENT 2 October 25, 2019 08:35
Dumb Ansys Fluent can't compile UDF ordinary FLUENT 1 October 9, 2019 08:55
ATTN ALL: SOLUTON TO UDF COMPILE PROBLEM Rizwan Fluent UDF and Scheme Programming 40 March 18, 2018 07:05
compile the UDF Li Jingping FLUENT 2 April 14, 2003 22:18


All times are GMT -4. The time now is 12:02.