Fluids

Fluids

Decoding UDF compilation error

    • maria.marinari
      Subscriber

      Hi All,

      I am getting an error compiling a UDF which isn't telling me what in my UDF it's upset with:

      1 Warning:

      C:\PROGRA~1\ANSYSI~1\v212\fluent\ntbin\clang\10\Include\10.0.18362.0\shared\basetsd.h(322,12): warning: cast to 'void * __ptr32' from smaller integer type 'unsigned long' [-Wint-to-void-pointer-cast]

      return((void * POINTER_32) (unsigned long) (ULONG_PTR) p);

      ^

      1 warning generated.

       

      I can attach my UDF if needed.

    • Rob
      Ansys Employee

      It's a warning rather than an error, but I think there will be another part to the message that's more useful. 

    • maria.marinari
      Subscriber

      This is the whole compilation message:

      Working with C-Source file names: C:/Users/laouit0115/Desktop/VariableThrustTest/p(U,r)Devel/VariableThrust.c

       

      Give header file names:

      Copied C:\Users\laouit0115\Desktop\VariableThrustTest\p(U,r)Devel\VariableThrust.c to libudf\src

      (system "copy "C:\PROGRA~1\ANSYSI~1\v212\fluent"\fluent21.2.0\src\udf\sconstruct.udf "libudf\win64\3d_host\SConstruct" ")

      1 file(s) copied.

      (system "copy "C:\PROGRA~1\ANSYSI~1\v212\fluent"\fluent21.2.0\src\udf\scons_default.bat "libudf\win64\3d_host\scons_test.bat" ")

      1 file(s) copied.

      Files udf_names.c and user_nt.udf in 3d_host are up-to-date.

      (system "copy "C:\PROGRA~1\ANSYSI~1\v212\fluent"\fluent21.2.0\src\udf\makefile_nt.udf "libudf\win64\3d_host\makefile" ")

      1 file(s) copied.

      (chdir "libudf")(chdir "win64\3d_host")

      C:\Users\laouit0115\Desktop\VariableThrustTest\p(U,r)Devel\libudf\win64\3d_host>rem

       

      C:\Users\laouit0115\Desktop\VariableThrustTest\p(U,r)Devel\libudf\win64\3d_host>rem Copyright 1987-2021 ANSYS, Inc. All Rights Reserved.

       

      C:\Users\laouit0115\Desktop\VariableThrustTest\p(U,r)Devel\libudf\win64\3d_host>rem

      'cl.exe' is not recognized as an internal or external command,

      operable program or batch file.

      'clang-cl' is not recognized as an internal or external command,

      operable program or batch file.

      scons: Reading SConscript files ...

      Compiler used is "C:\PROGRA~1\ANSYSI~1\v212\fluent"\ntbin\clang\bin\clang-cl

      Linker used is "C:\PROGRA~1\ANSYSI~1\v212\fluent"\ntbin\clang\bin\lld-link

      Copy("C:\Users\laouit0115\Desktop\VariableThrustTest\p(U,r)Devel\libudf\win64\3d_host\resolve.exe", "C:\PROGRA~1\ANSYSI~1\v212\fluent\ntbin\win64\resolve.exe")

      Copy("C:\Users\laouit0115\Desktop\VariableThrustTest\p(U,r)Devel\libudf\win64\3d_host\VariableThrust.c", "C:\Users\laouit0115\Desktop\VariableThrustTest\p(U,r)Devel\libudf\src\VariableThrust.c")

      c_sources ['VariableThrust.c', 'udf_names.c']

      c_sources_ ['VariableThrust.c']

      scons: done reading SConscript files.

      scons: Building targets ...

      resolve.exe -udf VariableThrust.c -head_file ud_io1.h

      "C:\PROGRA~1\ANSYSI~1\v212\fluent"\ntbin\clang\bin\clang-cl /c /DUDF_EXPORTING /DUDF_NT /DWIN64 /EHa /wd4224 -Wno-return-type -Wno-implicit-function-declaration -Wno-comment -Wno-incompatible-library-redeclaration -Wno-reserved-user-defined-literal /clang:-std=c99 -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\win64\3d_host -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\src\main -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\src\addon-wrapper -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\src\io -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\src\species -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\src\pbns -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\src\numerics -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\src\sphysics -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\src\storage -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\src\mphase -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\src\bc -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\src\models -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\src\material -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\src\amg -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\src\util -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\src\mesh -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\src\udf -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\src\ht -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\src\dx -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\src\turbulence -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\src\acoustics -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\src\parallel -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\src\etc -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\src\ue -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\src\dpm -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\src\dbns -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\cortex\src -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\client\src -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\tgrid\src -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\PRIME\tgrid\src -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\multiport\src -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\multiport\mpi_wrapper\src -I C:\PROGRA~1\ANSYSI~1\v212\fluent\include -I C:\Users\laouit0115\Desktop\VariableThrustTest\p(U,r)Devel\libudf\win64\3d_host -I C:\PROGRA~1\ANSYSI~1\v212\fluent\ntbin\clang\MSVC\14.10.25017\include -I C:\PROGRA~1\ANSYSI~1\v212\fluent\ntbin\clang\x64\lib\clang\10.0.0\include -I C:\PROGRA~1\ANSYSI~1\v212\fluent\ntbin\clang\10\Include\10.0.18362.0\shared -I C:\PROGRA~1\ANSYSI~1\v212\fluent\ntbin\clang\10\Include\10.0.18362.0\ucrt -I C:\PROGRA~1\ANSYSI~1\v212\fluent\ntbin\clang\10\Include\10.0.18362.0\um VariableThrust.c

      In file included from VariableThrust.c:4:

      In file included from C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\src\udf\udf.h:22:

      In file included from C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\src\main\global.h:258:

      In file included from C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\src\storage\var.h:10:

      C:\PROGRA~1\ANSYSI~1\v212\fluent\ntbin\clang\10\Include\10.0.18362.0\shared\basetsd.h(322,12): warning: cast to 'void * __ptr32' from smaller integer type 'unsigned long' [-Wint-to-void-pointer-cast]

      return((void * POINTER_32) (unsigned long) (ULONG_PTR) p);

      ^

      1 warning generated.

      "C:\PROGRA~1\ANSYSI~1\v212\fluent"\ntbin\clang\bin\lld-link C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\win64\3d_host\fl2120.lib C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\multiport\win64\net\shared\mport.lib C:\PROGRA~1\ANSYSI~1\v212\fluent\ntbin\clang\lib\libcmt.lib C:\PROGRA~1\ANSYSI~1\v212\fluent\ntbin\clang\lib\libcpmt.lib C:\PROGRA~1\ANSYSI~1\v212\fluent\ntbin\clang\lib\libvcruntime.lib C:\PROGRA~1\ANSYSI~1\v212\fluent\ntbin\clang\lib\oldnames.lib C:\PROGRA~1\ANSYSI~1\v212\fluent\ntbin\clang\lib\uuid.lib C:\PROGRA~1\ANSYSI~1\v212\fluent\ntbin\clang\lib\onecore.lib C:\PROGRA~1\ANSYSI~1\v212\fluent\ntbin\clang\lib\libucrt.lib /dll /out:libudf.dll VariableThrust.obj udf_names.obj

      scons: done building targets.

      (system "copy "C:\PROGRA~1\ANSYSI~1\v212\fluent"\fluent21.2.0\src\udf\sconstruct.udf "libudf\win64\3d_node\SConstruct" ")

      1 file(s) copied.

      (system "copy "C:\PROGRA~1\ANSYSI~1\v212\fluent"\fluent21.2.0\src\udf\scons_default.bat "libudf\win64\3d_node\scons_test.bat" ")

      1 file(s) copied.

      Files udf_names.c and user_nt.udf in 3d_node are up-to-date.

      (system "copy "C:\PROGRA~1\ANSYSI~1\v212\fluent"\fluent21.2.0\src\udf\makefile_nt.udf "libudf\win64\3d_node\makefile" ")

      1 file(s) copied.

      (chdir "libudf")(chdir "win64\3d_node")

      C:\Users\laouit0115\Desktop\VariableThrustTest\p(U,r)Devel\libudf\win64\3d_node>rem

       

      C:\Users\laouit0115\Desktop\VariableThrustTest\p(U,r)Devel\libudf\win64\3d_node>rem Copyright 1987-2021 ANSYS, Inc. All Rights Reserved.

       

      C:\Users\laouit0115\Desktop\VariableThrustTest\p(U,r)Devel\libudf\win64\3d_node>rem

      'cl.exe' is not recognized as an internal or external command,

      operable program or batch file.

      'clang-cl' is not recognized as an internal or external command,

      operable program or batch file.

      scons: Reading SConscript files ...

      Compiler used is "C:\PROGRA~1\ANSYSI~1\v212\fluent"\ntbin\clang\bin\clang-cl

      Linker used is "C:\PROGRA~1\ANSYSI~1\v212\fluent"\ntbin\clang\bin\lld-link

      Copy("C:\Users\laouit0115\Desktop\VariableThrustTest\p(U,r)Devel\libudf\win64\3d_node\resolve.exe", "C:\PROGRA~1\ANSYSI~1\v212\fluent\ntbin\win64\resolve.exe")

      Copy("C:\Users\laouit0115\Desktop\VariableThrustTest\p(U,r)Devel\libudf\win64\3d_node\VariableThrust.c", "C:\Users\laouit0115\Desktop\VariableThrustTest\p(U,r)Devel\libudf\src\VariableThrust.c")

      c_sources ['VariableThrust.c', 'udf_names.c']

      c_sources_ ['VariableThrust.c']

      scons: done reading SConscript files.

      scons: Building targets ...

      resolve.exe -udf VariableThrust.c -head_file ud_io1.h

      "C:\PROGRA~1\ANSYSI~1\v212\fluent"\ntbin\clang\bin\clang-cl /c /DUDF_EXPORTING /DUDF_NT /DWIN64 /EHa /wd4224 -Wno-return-type -Wno-implicit-function-declaration -Wno-comment -Wno-incompatible-library-redeclaration -Wno-reserved-user-defined-literal /clang:-std=c99 -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\win64\3d_node -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\src\main -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\src\addon-wrapper -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\src\io -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\src\species -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\src\pbns -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\src\numerics -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\src\sphysics -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\src\storage -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\src\mphase -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\src\bc -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\src\models -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\src\material -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\src\amg -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\src\util -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\src\mesh -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\src\udf -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\src\ht -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\src\dx -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\src\turbulence -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\src\acoustics -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\src\parallel -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\src\etc -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\src\ue -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\src\dpm -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\src\dbns -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\cortex\src -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\client\src -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\tgrid\src -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\PRIME\tgrid\src -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\multiport\src -I C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\multiport\mpi_wrapper\src -I C:\PROGRA~1\ANSYSI~1\v212\fluent\include -I C:\Users\laouit0115\Desktop\VariableThrustTest\p(U,r)Devel\libudf\win64\3d_node -I C:\PROGRA~1\ANSYSI~1\v212\fluent\ntbin\clang\MSVC\14.10.25017\include -I C:\PROGRA~1\ANSYSI~1\v212\fluent\ntbin\clang\x64\lib\clang\10.0.0\include -I C:\PROGRA~1\ANSYSI~1\v212\fluent\ntbin\clang\10\Include\10.0.18362.0\shared -I C:\PROGRA~1\ANSYSI~1\v212\fluent\ntbin\clang\10\Include\10.0.18362.0\ucrt -I C:\PROGRA~1\ANSYSI~1\v212\fluent\ntbin\clang\10\Include\10.0.18362.0\um VariableThrust.c

      In file included from VariableThrust.c:4:

      In file included from C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\src\udf\udf.h:22:

      In file included from C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\src\main\global.h:258:

      In file included from C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\src\storage\var.h:10:

      C:\PROGRA~1\ANSYSI~1\v212\fluent\ntbin\clang\10\Include\10.0.18362.0\shared\basetsd.h(322,12): warning: cast to 'void * __ptr32' from smaller integer type 'unsigned long' [-Wint-to-void-pointer-cast]

      return((void * POINTER_32) (unsigned long) (ULONG_PTR) p);

      ^

      1 warning generated.

      "C:\PROGRA~1\ANSYSI~1\v212\fluent"\ntbin\clang\bin\lld-link C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\win64\3d_node\fl_mpi2120.lib C:\PROGRA~1\ANSYSI~1\v212\fluent\fluent21.2.0\multiport\win64\mpi\shared\mport.lib C:\PROGRA~1\ANSYSI~1\v212\fluent\ntbin\clang\lib\libcmt.lib C:\PROGRA~1\ANSYSI~1\v212\fluent\ntbin\clang\lib\libcpmt.lib C:\PROGRA~1\ANSYSI~1\v212\fluent\ntbin\clang\lib\libvcruntime.lib C:\PROGRA~1\ANSYSI~1\v212\fluent\ntbin\clang\lib\oldnames.lib C:\PROGRA~1\ANSYSI~1\v212\fluent\ntbin\clang\lib\onecore.lib C:\PROGRA~1\ANSYSI~1\v212\fluent\ntbin\clang\lib\libucrt.lib C:\PROGRA~1\ANSYSI~1\v212\fluent\ntbin\clang\lib\uuid.lib /dll /out:libudf.dll VariableThrust.obj udf_names.obj

      scons: done building targets.

       

      Done.

       

      This is the whole UDF:

       

      #include "udf.h"
      #include "math.h"
      #define R 89.15

          /* Defining the parameters of the equations */
          real  A[ND_ND],C[ND_ND],r, thrust, fit, Area;

      void calc_Thrust(real* F, real* Thu, real Uin, real maxU, real U)
      {

              real a, b, c, fit;
              if (U <= maxU) // this should be based on velocity at the disk
              {
                  a =        6547;
                  b =       2.593;
                  c =   2.565e+05;
                  fit = 1;
              }
              else
              {
                  a =   8.283e+06;
                  b =     -0.7729;
                  c =  -1.366e+05;
                  fit = 2;
              }
              real thrust = a * pow(U, b) + c;

              if (Uin < 5 || Uin > 25) // this should be based on the inflow velocit
              {
                      thrust = 0;
                      fit = 0;
              }

              *F = fit;
              *Thu = thrust;
              return;
             

      }


       real find_U(int zone_ID)
          {
              Thread *t = Lookup_Thread(Get_Domain(1),zone_ID);
              real  A[ND_ND], area, u, FU;
              //Setting up parameters for intergration calculations
              real Area = 0.;
              real Uint = 0.;
              //Parameters use in velocity calculation
              face_t f;
              cell_t c0, c1 = -1;
              Thread *t0, *t1 = NULL;
              //Loop finding the velocity in the at the face of the bounday
         
              begin_f_loop(f, t)
              {
                  c0 = F_C0(f,t);
                  t0 = F_C0_THREAD(f,t);
                  c1 = F_C1(f,t); /* Get cell on other side of face */
                  t1 = F_C1_THREAD(f,t);

              //This loop would be used if using a boundary at a face (currently not working)
                  //if (BOUNDARY_FACE_THREAD_P(t))
                  //{
                  //  FU = F_W(f,t);
                  //}
                  //else
                  {
                      FU = (C_W(c1,t1) + C_W(c0,t0))/2;
                  }
                  //Finding the intigral of the area and velocity over the face
                  F_AREA(A, f, t);
                  area = NV_MAG(A);
                  Area += area;
                  Uint += FU * area;
              }
              end_f_loop(f,t)

              //Finding the absolute velocity from the itteration
              u = fabs(Uint)/Area;

              return u;

          }


      DEFINE_PROFILE(P_profile,t,i)
      {

          //The velocity that the maximum thrust occours at  
          real TmaxU = Get_Input_Parameter("real-1");
          real Uin = Get_Input_Parameter("real-2");
          real Fit, Thrust;
          //Setting up parameters for intergration calculations
          real T = 0.;
          face_t f;
          int zone_ID = THREAD_ID(t);



              //Finding the absolute velocity from the itteration
              real U = find_U(zone_ID);

              //Finding the thrust from the rotor

              //real thrust =
              calc_Thrust(&Fit, &Thrust, Uin, TmaxU, U);

              Message("\n Iteration %i \n", N_ITER);
              Message("\n The velocity at the disk = %g [ms^-1] \n", U);
              Message("\n Thrust = %g [N] \n", Thrust);
              Message("\n The fit type is is %g \n If fit = 0 the rotor has cut out \n if fit = 1 the rotor is operating at prerated power \n if the fit = 2 the rotor is opperating at rated power \n", Fit);

              // Definging the nomalizer and fit for the variying thrust appliction
              real Normalizer =   M_PI*(U*1.900312055711436E+31-(U*U)*1.239282151015246E+30+(U*U*U)*1.527746910810211E+28+(U*U*U*U)*2.960019334514253E+26-2.963673545740138E+31)*7.618884895355087E-27;


                  begin_f_loop(f,t)
                      //Finding the position of the center of the face
                      F_CENTROID(C,f,t);
                      //Defining r
                      real r = pow((pow(C[0], 2) + pow(C[1], 2)), 0.5);
                      Message("\n r = %g \n", r);
                      Message("\n x,y,z = %g, %g, %g \n", C[0], C[1], C[2]);
                      real Fit = ( U*1.190921231278848E+1+r*3.406508852232519E-1+U*r*3.808625743577649E-1-U*(r*r)*5.733850224296987E-3-(U*U)*r*1.718198730826162E-2+U*(r*r*r)*2.282749620835556E-5+(U*U*U)*r*9.337225041318572E-5-(U*U)*6.514728979124498E-1+(U*U*U)*9.105092229400679E-3+(U*U*U*U)*2.840350168618951E-4-(r*r)*3.901239873300466E-2+(r*r*r)*9.475025722676119E-4-(r*r*r*r)*6.279363133413672E-6+(U*U)*(r*r)*1.217896337041497E-4-2.997824644171244E+1);
                      F_PROFILE(f, t, i) = (thrust/ Normalizer)* Fit;
                      //Calculating the thrust on the actuator disk
                      F_AREA(A, f, t);
                      real area = NV_MAG(A);
                      Area += area;
                      T += F_PROFILE(f, t, i) * area;
                  end_f_loop(f,t)


       FILE *fp = NULL;
       char filename[20];
       sprintf(filename, "Output_%gms.txt", Uin);
       Message("%s ", filename);
        Message("%g ", Uin);
       //char filename[]="udfTEST_out.txt";
       fp = fopen(filename, "a");
        fprintf(fp, "Itteration %i [m^2]\n", N_ITER);
       fprintf(fp, "Area of the actuator disk = %g [m^2]\n", Area);
       fprintf(fp, "Absolute Area-Weighted Average Velocity Over the Disk %g [ms^-1]\n", U);
       fprintf(fp, "Value of the Normalizer = %g\n", Normalizer);
       fprintf(fp, "Total thrust fromt the disk = %g [N]\n", T);
       fprintf(fp, "Input thrust = %g [N]\n \n", thrust);
       fclose(fp);    
      }
    • Rob
      Ansys Employee

      Please tell me you didn't call a folder   p(U,r)Devel  ?   If you did, please rename to remove the ( , and ) symbols, then try again. 

      I also recommend not defining R and then using r elsewhere, you're bound to mix them up somewhere, and that's assuming everything is case sensitive all the time. Single letter variables are also more likely to exist in the solver, so you may be trying to redefine something. 

    • maria.marinari
      Subscriber

      I did! okay, I will do that and give it another go.

      Thank you!

    • maria.marinari
      Subscriber

      Hey thanks so much, it's working now this is the message I am getting after compilation:

       

      Working with C-Source file names: C:/Users/laouit0115/Desktop/VariableThrustTest/VariableThrust/VariableThrust.c

       

       Give header file names:

      Copied C:\Users\laouit0115\Desktop\VariableThrustTest\VariableThrust\VariableThrust.c to libudf\src

      (system "copy "C:\PROGRA~1\ANSYSI~1\v212\fluent"\fluent21.2.0\src\udf\sconstruct.udf "libudf\win64\3d_host\SConstruct" ")

              1 file(s) copied.

      (system "copy "C:\PROGRA~1\ANSYSI~1\v212\fluent"\fluent21.2.0\src\udf\scons_default.bat "libudf\win64\3d_host\scons_test.bat" ")

              1 file(s) copied.

      Files udf_names.c and user_nt.udf in 3d_host are up-to-date.

      (system "copy "C:\PROGRA~1\ANSYSI~1\v212\fluent"\fluent21.2.0\src\udf\makefile_nt.udf "libudf\win64\3d_host\makefile" ")

              1 file(s) copied.

      (chdir "libudf")(chdir "win64\3d_host")

      C:\Users\laouit0115\Desktop\VariableThrustTest\VariableThrust\libudf\win64\3d_host>rem 

       

      C:\Users\laouit0115\Desktop\VariableThrustTest\VariableThrust\libudf\win64\3d_host>rem  Copyright 1987-2021 ANSYS, Inc. All Rights Reserved.

       

      C:\Users\laouit0115\Desktop\VariableThrustTest\VariableThrust\libudf\win64\3d_host>rem 

      'cl.exe' is not recognized as an internal or external command,

      operable program or batch file.

      'clang-cl' is not recognized as an internal or external command,

      operable program or batch file.

      scons: Reading SConscript files ...

      Compiler used is  "C:\PROGRA~1\ANSYSI~1\v212\fluent"\ntbin\clang\bin\clang-cl

      Linker used is  "C:\PROGRA~1\ANSYSI~1\v212\fluent"\ntbin\clang\bin\lld-link

      Copy("C:\Users\laouit0115\Desktop\VariableThrustTest\VariableThrust\libudf\win64\3d_host\resolve.exe", "C:\PROGRA~1\ANSYSI~1\v212\fluent\ntbin\win64\resolve.exe")

      Copy("C:\Users\laouit0115\Desktop\VariableThrustTest\VariableThrust\libudf\win64\3d_host\VariableThrust.c", "C:\Users\laouit0115\Desktop\VariableThrustTest\VariableThrust\libudf\src\VariableThrust.c")

      c_sources  ['VariableThrust.c', 'udf_names.c']

      c_sources_  ['VariableThrust.c']

      scons: done reading SConscript files.

      scons: Building targets ...

      resolve.exe -udf VariableThrust.c -head_file ud_io1.h

      scons: done building targets.

      (system "copy "C:\PROGRA~1\ANSYSI~1\v212\fluent"\fluent21.2.0\src\udf\sconstruct.udf "libudf\win64\3d_node\SConstruct" ")

              1 file(s) copied.

      (system "copy "C:\PROGRA~1\ANSYSI~1\v212\fluent"\fluent21.2.0\src\udf\scons_default.bat "libudf\win64\3d_node\scons_test.bat" ")

              1 file(s) copied.

      Files udf_names.c and user_nt.udf in 3d_node are up-to-date.

      (system "copy "C:\PROGRA~1\ANSYSI~1\v212\fluent"\fluent21.2.0\src\udf\makefile_nt.udf "libudf\win64\3d_node\makefile" ")

              1 file(s) copied.

      (chdir "libudf")(chdir "win64\3d_node")

      C:\Users\laouit0115\Desktop\VariableThrustTest\VariableThrust\libudf\win64\3d_node>rem 

       

      C:\Users\laouit0115\Desktop\VariableThrustTest\VariableThrust\libudf\win64\3d_node>rem  Copyright 1987-2021 ANSYS, Inc. All Rights Reserved.

       

      C:\Users\laouit0115\Desktop\VariableThrustTest\VariableThrust\libudf\win64\3d_node>rem 

      'cl.exe' is not recognized as an internal or external command,

      operable program or batch file.

      'clang-cl' is not recognized as an internal or external command,

      operable program or batch file.

      scons: Reading SConscript files ...

      Compiler used is  "C:\PROGRA~1\ANSYSI~1\v212\fluent"\ntbin\clang\bin\clang-cl

      Linker used is  "C:\PROGRA~1\ANSYSI~1\v212\fluent"\ntbin\clang\bin\lld-link

      Copy("C:\Users\laouit0115\Desktop\VariableThrustTest\VariableThrust\libudf\win64\3d_node\resolve.exe", "C:\PROGRA~1\ANSYSI~1\v212\fluent\ntbin\win64\resolve.exe")

      Copy("C:\Users\laouit0115\Desktop\VariableThrustTest\VariableThrust\libudf\win64\3d_node\VariableThrust.c", "C:\Users\laouit0115\Desktop\VariableThrustTest\VariableThrust\libudf\src\VariableThrust.c")

      c_sources  ['VariableThrust.c', 'udf_names.c']

      c_sources_  ['VariableThrust.c']

      scons: done reading SConscript files.

      scons: Building targets ...

      resolve.exe -udf VariableThrust.c -head_file ud_io1.h

      scons: done building targets.

       

      Done.

       

    • Rob
      Ansys Employee

      It's something screwy in the compiler, if the UDF compiles & works there's nothing to worry about: it's not a message I or a colleague have seen before.  If it doesn't it's the code, so check your .c file. 

Viewing 6 reply threads
  • You must be logged in to reply to this topic.