|
[Sponsors] |
November 24, 2022, 07:11 |
Compile 6Dof-Rotary UDF code
|
#1 |
New Member
bob
Join Date: Oct 2017
Posts: 18
Rep Power: 9 |
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]); } |
|
November 28, 2022, 20:16 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
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]); try it anyway
__________________
best regards ****************************** press LIKE if this message was helpful |
|
Tags |
fluent - udf, udf compilation |
|
|
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 |