Custom Cohesion Model in GPU Module

Skip to first unread message

Darwin Mick

Jan 19, 2022, 4:29:17 PMJan 19
to ProjectChrono

I'm working on implementing custom cohesion models for granular particles in the GPU module. Currently, my workflow is to edit ChGpu_SMC.cuh and replace the cohesion definitions in that script with the model I want to use. Then, I rebuild chrono with the modified script to make sure the changes are reflected when I run simulations. Firstly, I want to double check that this workflow makes sense.

Secondly, I had a couple of questions regarding ChGpu_SMC.cuh. Primarily, what is the difference between the functions computeSphereContactForces_matBased() and computeSphereContactForces()? Additionally, in what scenarios would each function be called?

I've also attached the script I'm currently using with an updated cohesion model. Chrono is building effectively, but it's not working well within my sims. 

Thank you!

Darwin Mick

Luning Fang

Jan 20, 2022, 12:16:22 PMJan 20
to ProjectChrono
Hello Darwin,

The workflow makes sense. The major difference between computeSphereContactForces_matBased() and computeSphereContactForce() is that the first one use material-based property in contact force model, namely, youngs modulus, poisson ratio and coefficient of restitution, the second one use user-defined parameters. Take a look at demo_GPU_balldrop.cpp, where UseMaterialBasedModel(true) is used and parameters are set, when you run the simulation, computeSphereContactForces_matBased() is called. The default setting is using user-defined parameters of kn, gn, kt, gt, associated with spring-damper model of contact forces, in which case, computeSphereContactForce() is called. There are other small differences between these two, more details are in this paper equation (3), (4) (18) and (19).

I looked at your changes, when implementing your own force model in GPU, you need to convert the units into simulation units. Because in GPU, integers are used to describe particle positions for fast performance. To maintain the resolution, particles are scaled a lot larger so every integer can be used. Basic units conversion in length, mass and time are pre-calculated and stored, so you can use them freely in your own force model, like gran_params->LENGTH_UNIT.

Take a look at switchToSimUnits() in ChSystemGpu_impl.cpp, it shows how LENGTH_SU2UU, MASS_SU2UU and TIME_SU2UU are computed, where SU2UU stands for "simulation unit to user unit", and the conversion goes: length_uu = length_su * length_su2uu. That part of the code also use basic units to get conversion of other quantities, like acceleration, torque, stiffness, etc. For example, youngs modulus, E_su2uu = mass_su2uu / (length_su2uu * time_su2uu^2). You will have to do this for your interfacial surface energy parameter.

The default output of positions and force handles conversion from SU to UU, but if you want to customize the cohesive force output, you will have to do your own conversion as well.

Thank you,
Reply all
Reply to author
0 new messages