Fluids

Fluids

Topics related to Fluent, CFX, Turbogrid and more.

Report the drag/lift force on particles in DPM

    • lec chen
      Subscriber

      Hello, everyone!

      I am working on a project about particle-airflow interaction in a channel in Fluent 2023. I want to find out the magnitude of the drag force and lift force on each particle. 

      I have opened the drag force, saffman lift force in physical models of discrete phase model (DPM). Generally, i can find particle related information at Results-Particle tracks-Particle variables. However, i can not find the drag force, saffman lift force under this option.

      I was told certain particle-related forces such as drag and lift force are not available directly through the standard Particle Tracks Reports interface. These specific forces require customization to view and analyze by UDF. And an example of UDF has been given in the last. However, this UDF did not work in my case and software (the content in this link also not work /forum/forums/topic/how-to-report-the-drag-force-on-particles-in-dpm/ )

      Does anyone know how to report this when the solution is done, or how to write an correct UDF to obtain the forces on particles?

      Thanks!

       {

      #include "udf.h"
       
      /* Define a UDF to track forces on particles */
      DEFINE_DPM_SCALAR_UPDATE(track_forces, cell, thread, initialize, p)
      {
          real drag_force[3];
          real lift_force[3];
          real virtual_mass_force[3];
       
          /* Get the drag force */
          P_DRAG(p, drag_force);
       
          /* Get the lift force */
          P_SAFFMAN_LIFT_FORCE(p, lift_force);
       
          /* Get the virtual mass force */
          P_VIRTUAL_MASS_FORCE(p, virtual_mass_force);
       
          /* Store the forces in user-defined memory (UDM) */
          P_USER_REAL(p, 0) = drag_force[0];
          P_USER_REAL(p, 1) = drag_force[1];
          P_USER_REAL(p, 2) = drag_force[2];
          P_USER_REAL(p, 3) = lift_force[0];
          P_USER_REAL(p, 4) = lift_force[1];
          P_USER_REAL(p, 5) = lift_force[2];
          P_USER_REAL(p, 6) = virtual_mass_force[0];
          P_USER_REAL(p, 7) = virtual_mass_force[1];
          P_USER_REAL(p, 8) = virtual_mass_force[2];
      }

      }

    • Rob
      Forum Moderator

      Please can you elaborate on "didn't work"?  Note, you may want to use the current version of the manual too,  https://ansyshelp.ansys.com/account/Secured?returnurl=/Views/Secured/corp/v241/en/flu_udf/flu_udf_DPMDEFINE.html%23flu_udf_sec_define_dpm_scalar_update

    • lec chen
      Subscriber

      Dear Rob,

      Thank you so much for your kind reply.

      1- When i build the UDF in compiled UDFs, the console has reported

      { scons: warning: No version of Visual Studio compiler found - C/C++ compilers most likely not set correctly. File "F:\05 DPM model\libudf\win64\3ddp_host\SConstruct", line 20, in . 

      scons: warning: No version of Visual Studio compiler found - C/C++ compilers most likely not set correctly. File "F:\05 DPM model\libudf\win64\3ddp_node\SConstruct", line 20, in . Compiler path: xxx. Linker path: xxx.

      scons: warning: No version of Visual Studio compiler found - C/C++ compilers most likely not set correctly. File "F:\05 DPM model\libudf\win64\3ddp_node\SConstruct", line 156, in . C sources: ['track_forces.c']. lld-link: error: undefined symbol: P_DRAG

      >>> referenced by track_forces.obj:(track_forces)

      lld-link: error: undefined symbol: P_SAFFMAN_LIFT_FORCE

      >>> referenced by track_forces.obj:(track_forces)

      lld-link: error: undefined symbol: P_VIRTUAL_MASS_FORCE

      >>> referenced by track_forces.obj:(track_forces)

      scons: *** [libudf.dll] Error 1} 

      2- When i load the library, the console has reported

      {ERROR: The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform (win64). ���������������������

      F:\\05 DPM model\\libudf\\win64\\3ddp_node\\libudf.dll. Error: An error occurred in the previous operation. The details can be found in the text output.

      Error Object: #f }

      3-  Your suggestion to use the current version of the manual is very helpful. However, as I am new to UDF in Fluent, I need to spend more time solving the problem and reporting the drag/lift forces on particles in DPM. 

      Thanks

    • Rob
      Forum Moderator

      Spaces in directory structures are generally not recommended, and starting labels with numbers can cause problems. Fluent was written for UNIX originally and some of the conventions carried over into the current builds. These rarely catch staff out as we either used UNIX when starting out (PCs were no where near powerful enough) or were taught by those who started out with UNIX. 

      Similarly, running on non local discs may not be ideal as data packet delays over the network may cause corruption when writing large files. 

      I don't recognise P_DRAG, P_SAFFMAN_LIFT_FORCE or P_VIRTUAL_MASS_FORCE, so assuming they're in the code make sure you include the appropriate headers. 

    • lec chen
      Subscriber

      Dear Rob

      Thanks for your comments, I may continue to learn this!

Viewing 4 reply threads
  • The topic ‘Report the drag/lift force on particles in DPM’ is closed to new replies.