Fragmenting Cylinder

A cylinder fragmenting into many pieces, inspired by the peridigm example.

We use the point cloud created by peridigm for their corresponding example. You can download the file containing the data from this page on their repository.

To start, import the package:

using Peridynamics

First a function is written that can read our .txt-file containing the data of the point cloud and convert it into the position and volume, which we need to define our Body. For this we need the package DelimitedFiles.jl.

using DelimitedFiles
function fragmenting_cylinder_geometry(input_mesh_file::AbstractString)
    input_raw = readdlm(input_mesh_file)
    position = copy(input_raw[:, 1:3]')
    volume = copy(input_raw[:, 5])
    return position, volume
end
fragmenting_cylinder_geometry (generic function with 1 method)

Now we specify the storage path of the file.

input_mesh_file = joinpath(@__DIR__, "..", "assets", "fragmenting_cylinder.txt")
"/home/runner/work/Peridynamics.jl/Peridynamics.jl/docs/build/generated/../assets/fragmenting_cylinder.txt"

To get the information we need, we use our function defined above.

position, volume = fragmenting_cylinder_geometry(input_mesh_file)
([0.0204975586246 0.0214962062602 … 0.0234952312666 0.0244962620135; 0.000455821379461 0.000479517200632 … -0.000523441177609 -0.000546781010314; 0.000499550058637 0.000500353398975 … 0.0995001967495 0.0995008464102], [9.13512757427e-10, 9.5807435535e-10, 1.00263595327e-9, 1.0471975512e-9, 1.09175914912e-9, 9.13512757427e-10, 9.5807435535e-10, 1.00263595327e-9, 1.0471975512e-9, 1.09175914912e-9  …  9.13512757427e-10, 9.5807435535e-10, 1.00263595327e-9, 1.0471975512e-9, 1.09175914912e-9, 9.13512757427e-10, 9.5807435535e-10, 1.00263595327e-9, 1.0471975512e-9, 1.09175914912e-9])

Using this data, we can create a Body which represents the cylinder.

body = Body(BBMaterial(), position, volume)
70500-point Body{BBMaterial{NoCorrection}}:
  1 point set(s):
    70500-point set `all_points`

We specify the material parameters of the cylinder.

material!(body, horizon=0.00417462, rho=7800, E=195e9, epsilon_c=0.02)

Then some initial velocity conditions in x-, y- and z-direction are employed to provoke the fracture of the cylinder.

velocity_ic!(p -> (200-50*((p[3]/0.05)-1)^2)*cos(atan(p[2],p[1])), body, :all_points, :x)
velocity_ic!(p -> (200-50*((p[3]/0.05)-1)^2)*sin(atan(p[2],p[1])), body, :all_points, :y)
velocity_ic!(p -> 100*((p[3]/0.05)-1), body, :all_points, :z)

We employ the Velocity Verlet algorithm for a total time span of 2.5e-4 seconds.

vv = VelocityVerlet(time=2.5e-4)
VelocityVerlet:
  end_time       0.00025
  safety_factor  0.7

Finally the job is created

job = Job(body, vv; path="results/fragmenting_cylinder", freq=10)
Job:
  spatial_setup  70500-point Body{BBMaterial{NoCorrection}}
  time_solver    VelocityVerlet(end_time=0.00025, safety_factor=0.7)
  options        export_allowed=true, freq=10

and subsequently submitted.

submit(job)