SUM THE FORCES OF DIFFERENT WALLS

Submitted by zhanshiran on Thu, 04/10/2025 - 11:46

Hi Everyone,

I hope you're doing well. I’m facing a challenge in my simulation and would appreciate some help.

I have added two different walls to my simulation using the following code:
fix 1 all wall/gran model hertz tangential history mesh n_meshes 2 meshes bot_wall top_wall store_force yes

Now, I want to calculate the force on the top wall, but the results from the compute command contain forces from both the top and bottom walls:
compute 1 all wall/gran/local pos force id

This means i can't sum directly by the command :
compute tf all reduce sum c_1[10] c_1[11] c_1[12]

How can I separately obtain the force on the top wall and the bottom wall?

Thank you in advance for your help!

Best regards,
zhanshiran

Tannaz | Thu, 05/01/2025 - 17:41

If you define the walls as follows:
fix top all mesh/surface/stress file meshes/top.stl type 2
fix bottom all mesh/surface/stress file meshes/bottom.stl type 2
fix walls all wall/gran model hertz tangential history mesh n_meshes 2 meshes top bottom

Then, by using:
variable force equal f_top[3]

And finally:
fix printStress all print 1000 "Force: ${force}" file output_force.txt title

You can record the force applied to the top mesh every 1000 timesteps.