Obtain the drag force in CFD-DEM coupled simulation

In CFD–DEM coupled simulations, it is sometimes necessary to retrieve the drag force value directly within the Aspherix script.

Total drag

variable total_drag_x atom id_dragforce_total[1]
variable total_drag_y atom id_dragforce_total[2]
variable total_drag_z atom id_dragforce_total[3]

Explicit drag

variable explicit_drag_x atom id_dragforce[1]
variable explicit_drag_y atom id_dragforce[2]
variable explicit_drag_z atom id_dragforce[3]

Usage in the input script:

....
enable_cfd_coupling
# compute total explicit dragforce
calculate sum id explDrag quantities { v_explicit_drag_x, v_explicit_drag_y, v_explicit_drag_z }

calculate sum id totalDrag quantities { v_total_drag_x, v_total_drag_y, v_total_drag_z }

# write to file the explicit and total drag forces
write_to_file string &
   "id_time id_explDrag[1] id_explDrag[2] id_explDrag[3] id_totalDrag[1] id_totalDrag[2] id_totalDrag[3]" &
   title "# time explicitDrag(X Y Z) totalDrag(X Y Z)" &
   file ../DEM/post/forces1.txt write_every_time 1.e-4
....

Aspherix also stores the total drag force summed over all particles in the cfd2 variable.

write_to_file string &
   "id_time id_explDrag[1] id_explDrag[2] id_explDrag[3] id_cfd2[1] id_cfd2[2] id_cfd2[3]" &
   title "# time explicitDrag(X Y Z) totalDrag(X Y Z)" &
   file ../DEM/post/forces2.txt write_every_time 1.e-4

See also

CFDEMcouplingTutorial/cfdemSolverPimple/ErgunTest