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

UDF errors when complile

Register Blogs Community New Posts Updated Threads Search

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   August 30, 2016, 04:23
Default UDF errors when complile
  #1
Member
 
ERMACORA Florian
Join Date: May 2016
Posts: 39
Rep Power: 10
flo90000 is on a distinguished road
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
flo90000 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
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


All times are GMT -4. The time now is 04:39.