Defining position vector from a particle to its closest point on the facent in the check_solids_dem mod file

Hi everyone,

My computational domain is a cylindrical fluidized bed. In the check_solids_dem mod file, the particle-wall damping coefficient is defined to be a function of recovery coefficient. This function is different from the default formula for those two factors. In this function, the position vector from a particle to its closest point on the facent is needed, which is not given in the original check_solids_dem mod file. I find this position vector is given in the calc_collision_wall file by using CALL ClosestPtPointTriangle(POS_TMP, VERTEX(:,:,NF),CLOSEST_PT(:),point_or_edge_int). How to define the position vector from a particle to its closest point on the facent in the check_solids_dem mod file? Can this position vector be also specified in the check_solids_dem mod file by using CALL ClosestPtPointTriangle(POS_TMP, VERTEX(:,:,NF),CLOSEST_PT(:),point_or_edge_int)? If I can specify the position vector like this, a loop which exists in calc_collision_wall needs to be added.
image
In this loop, facets_at_dg is a public parameter in calc_collision_wall, and how to define it in check_solids_dem mod. Are there some modules need to be used?

Thank you.

I feel maybe it is hard to correlate damping and recovery coefficient in the check_solids_dem_mod file, when the position vector from a particle to its closest point on the facent is needed. A large part of the codes for checking facet in the calc_collision_wall file are not easy to be transplanted to the check_solids_dem_mod file. However, they may be indispensable. Also, some parameters are closely related to some loops or definations that have already been specified in the calc_collision_wall file. In other words, it is more appropriate to define directly a function, correlating damping and recovery coefficient in the calc_collision_wall file if a particle to its closest point on the facent is needed. Some codes for looping the phase index in the check_solids_dem_mod file may be more easier to be transplanted to the calc_collision_wall file. I will have a try.