Fluids

Fluids

Topics relate to Fluent, CFX, Turbogrid and more

UDF 3D Rotation for Fluid in concentric sphere

    • AndyHor
      Subscriber

      Hi everyone, 


      I am first time user to UDF, and using ansys 2016.


       


      I am trying to put expressions for a 3D , 1/8 concentric sphere, and the fluid is driven by lower surface to oscillate with respect to z-axis. Two pictures is shown in below for better view.


       


      In 2019 version, i can put the boundary conditions as expression as sin(t/1)*1[rad/s] for the lower oscillating surface.


       


      If I want to write in UDF, can I write in this way ? Please advise. 


      /**********************************************************************


        oscillatingwall.c 


        UDF for specifying a transient simple harmonic motion


       ***********************************************************************/


       


      #include "udf.h"


      #define angular_freq 1


      DEFINE_GRID_MOTION(inneroscillatingwall, dt, cg_vel, cg_omega, time, dtime)


       


      {


         Thread*t; /*is the pointer to the structure that store*/


         real omega;


         


         /* reset velocities */


         NV_S (vel, =, 0.0);


         NV_S (omega, =, 0.0);


       


        t=DT_THREAD(dt); /*Get the tread pointer for which this motion is defined*/


         


         omega = sin(angular_freq*time); /*rotional speed about axis*/


       


         cg_vel[0] = 0.0; /*x y z translation*/


         cg_vel[1] = 0.0;


         cg_vel[2] = 0.0;  


       


         cg_omega[0]=0.0;  /* x y z rotational axis*/


         cg_omega[1]=0.0;


         cg_omega[2]=omega;


       


      }




       


       

    • AndyHor
      Subscriber

      I have tried several methods, and amended some code, this is what I currently facing, could anyone please help ?


       


      #include "udf.h"


      #define angular_freq 1.0


      DEFINE_CG_MOTION(inneroscillatingwall, dt, cg_vel, cg_omega, time, dtime)


       


      {


      real omega;


       


      omega = sin(angular_freq*time); /*rotional speed about axis*/


       


      cg_vel[0] = 0.0; /*x y z translation*/


      cg_vel[1] = 0.0;


      cg_vel[2] = 0.0;


       


      cg_omega[0]=0.0; /* x y z rotational axis*/


      cg_omega[1]=0.0;


      cg_omega[2]=omega;


       


      }


       


       


       


      /*When I press build button, it gives */


       


      Setting Post Processing and Surfaces information ... Done.


      Copied C:UsersDell T7600DesktopChee Hao AnsysHip Gap_filesdp0FFFFluent/C:UsersDell T7600DesktopChee Hao AnsysHip Gap_filesdp0FFFFluentUDF oscillating.c to libudfsrc


      Creating user_nt.udf file for 3ddp ...


      (system "copy "C:PROGRA~1ANSYSI~1v170fluent"fluent17.0.0srcudfmakefile_nt.udf "libudfwin643ddpmakefile" ")


      1 file(s) copied.


      (chdir "libudf")(chdir "win643ddp")'nmake' is not recognized as an internal or external command,


      operable program or batch file.


       


      Done.


       


       


       


       


       


      /*When I press load button, it gives*/


       


      Opening library "C:UsersDell T7600DesktopChee Hao AnsysHip Gap_filesdp0FFFFluentC:UsersDell T7600DesktopChee Hao AnsysHip Gap_filesdp0FFFFluentlibudf"...RPC RCX_SC_SET_ERR_MSG failed: RPC: Can't encode arguments


       


       


      Error: The UDF library you are trying to load (C:UsersDell T7600DesktopChee Hao AnsysHip Gap_filesdp0FFFFluentlibudf) is not compiled for 3ddp on the current platform (win64).


       


      The system cannot find the file specified.


       


      C:UsersDell T7600DesktopChee Hao AnsysHip Gap_filesdp0FFFFluentC:UsersDell T7600DesktopChee Hao AnsysHip Gap_filesdp0FFFFluentlibudfwin643ddplibudf.dll


       


      Error: The UDF library you are trying to load (C:UsersDell T7600DesktopChee Hao AnsysHip Gap_filesdp0FFFFluentlibudf) is not compiled for 3ddp on the current platform (win64).nnThe system cannot find the file specified.


      nnC:UsersDell T7600DesktopChee Hao AnsysHip Gap_filesdp0FFFFluentC:UsersDell T7600DesktopChee Hao AnsysHip Gap_filesdp0FFFFluentlibudfwin643ddplibudf.dll


      Error Object: #f


       


       


       


       


       


      /*And then I restart Ansys, it somehow have the UDF file, when I load to the boundary, and press ok, it gives */


       


      Error: received a fatal signal (Segmentation fault).


       


      Error: received a fatal signal (Segmentation fault).


      Error Object: #f

Viewing 1 reply thread
  • You must be logged in to reply to this topic.