|
[Sponsors] |
August 30, 2016, 04:23 |
UDF errors when complile
|
#1 |
Member
ERMACORA Florian
Join Date: May 2016
Posts: 39
Rep Power: 10 |
Hello
I wrote a udf to move a reed valve in 6DOF and I want to calculate the moment in z to allow or not a rotation but when I compile my udf, it appears there are some mistakes. but I don't know how to resolve it. Someone can help me, pls? thnak you for your help Code:
#include "udf.h" #include "math.h" DEFINE_SDOF_PROPERTIES(Valve_6dof_ex, prop, dt, time, dtime) { static real theta, cg_x, cg_y; static real NV_VEC(A); static real Mz, netmoment; Thread *t; Node *node; face_t *f; Mz = 0.0; t = DT_THREAD(dt); cg_x = 0.01625; cg_y = 0.0185; begin_f_loop(f,t) { F_AREA(A,f,t); Mz += F_P(f,t)*(A[0]*(NODE_Y(node)-cg_y)-A[1]*(NODE_X(node)-cg_x)); } end_f_loop(f,t) prop[SDOF_MASS] = 0.00114; prop[SDOF_IZZ] = 0.000023; prop[SDOF_ZERO_TRANS_X] = TRUE; prop[SDOF_ZERO_TRANS_Y] = TRUE; prop[SDOF_ZERO_TRANS_Z] = TRUE; prop[SDOF_ZERO_ROT_X] = TRUE; prop[SDOF_ZERO_ROT_Y] = TRUE; prop[SDOF_ZERO_ROT_Z] = TRUE; prop[SDOF_LOAD_M_Z] = 9.81*0.0114*cos(DT_THETA (dt)[2])*0.0095; theta = DT_THETA(dt)[2]; netmoment = Mz + prop[SDOF_LOAD_M_Z]; Message("\n 2d_ex : theta_Z:%e,Mz:%e,Mass:%e,mom_tot:%e\n", DT_THETA(dt)[2],prop[SDOF_LOAD_M_Z],prop[SDOF_MASS],netmoment); if((theta<0)||(theta>0.087)) { prop[SDOF_ZERO_ROT_Z]=TRUE; Message("Clapet_ex_bloqué"); } else { prop[SDOF_ZERO_ROT_Z] = FALSE; } } Code:
errors: valve__7.c: In function Valve_6dof_ex: valve__7.c:19: warning: comparison between pointer and integer valve__7.c:21: error: array subscript is not an integer valve__7.c:21: error: array subscript is not an integer valve__7.c:21: warning: left-hand operand of comma expression has no effect valve__7.c:22: error: array subscript is not an integer |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Building OpenFOAM1.7.0 from source | ata | OpenFOAM Installation | 46 | March 6, 2022 13:21 |
UDF - compiling errors | Tscar | FLUENT | 1 | March 21, 2018 22:24 |
Stuck in a Rut- interDyMFoam! | xoitx | OpenFOAM Running, Solving & CFD | 14 | March 25, 2016 07:09 |
WILLING TO PAY/ FREELANCER REQUIRED / small UDF coding force loads over body / 6DOF | acasas | CFD Freelancers | 1 | January 23, 2015 07:26 |
errors in interpreted udf for two macro | Asghari | FLUENT | 0 | August 7, 2006 02:29 |