PeriDEM 0.2.0
PeriDEM -- Peridynamics-based high-fidelity model for granular media
Loading...
Searching...
No Matches
particle_wall Namespace Reference

Functions

 particle_locations (filename, radius, centers, pp_tag=None)
 

Variables

 parser = argparse.ArgumentParser(description='Setup and run PeriDEM simulation')
 
 default
 
 type
 
 help
 
 args = parser.parse_args()
 
str fpath = './'
 
list center = [0., 0., 0.]
 origin (this center is used to discretize the particle and later discretization is translated and rotated appropriately)
 
list g = [0., -10., 0.]
 gravity
 
float R = 0.001
 radius of p
 
float h = R / 8.
 mesh size (use smaller radius to decide)
 
int horizon = 3. * h
 peridynamics horizon (typically taken as 2 to 4 times the mesh size)
 
list wall_rect = [0., 0., 0., 2.*R, horizon, 0.]
 wall geometry (corner point coordinates)
 
float d = 0.001
 initial distance between particle and wall
 
float delta = d - horizon
 
list v0 = [0, -np.sqrt(2. * np.abs(g[1]) * delta), 0.]
 
float T = 0.1
 final time and time step
 
int N_steps = 2000000
 
float dt = T / N_steps
 
int N_out = N_steps / 100
 
float nu1 = 0.25
 material for zone 1 (in this case zone 1 has just one particle)
 
int rho1 = 1200.
 
float K1 = 2.16e+7
 
 E1 = get_E(K1, nu1)
 
 G1 = get_G(E1, nu1)
 
int Gc1 = 50.
 
float nu2 = 0.25
 
int rho2 = 1200.
 
float K2 = 2.16e+7
 
 E2 = get_E(K2, nu2)
 
 G2 = get_G(E2, nu2)
 
int Gc2 = 50.
 
float R_contact_factor = 0.95
 contact radius is taken as R_contact_factor * h_{min} where h_{min} is the minimum mesh size over all meshes (it is computed at the begining of simulation) we only specify the R_contact_factor
 
int Kn_11 = 18. * get_eff_k(K1, K1) / (np.pi * np.power(horizon, 5))
 define Kn parameter for normal contact force (see PeriDEM paper for more details)
 
int Kn_22 = 18. * get_eff_k(K2, K2) / (np.pi * np.power(horizon, 5))
 
int Kn_12 = 18. * get_eff_k(K1, K2) / (np.pi * np.power(horizon, 5))
 
float beta_n_eps = 0.9
 define beta_n parameter for normal damping
 
int beta_n_factor = 5000.
 
bool damping_active = True
 
float friction_coeff = 0.5
 friction coefficient
 
bool friction_active = False
 
list centers = []
 
 inpf = open(fpath + 'input.yaml','w')
 file below creates .geo file (see util.py)
 
list contain_params = [0., 0., 0., 2.*R, 4.*R, 0.]
 provide model specific details
 
list p_geom = [R, center[0], center[1], center[2]]
 zone info we have two zones
 
str cmd = "gmsh p.geo -2 &> /dev/null"
 Neighbor info at present, this block has no impact in the simulation.
 
 process = subprocess.Popen(cmd.split(), stdout=subprocess.PIPE)
 
 output
 
 error
 

Function Documentation

◆ particle_locations()

particle_wall.particle_locations (   filename,
  radius,
  centers,
  pp_tag = None 
)
Creates .csv file containing the center, radius, orientation, and zone id of each particle in two-particle setup

Parameters
----------
filename : str
  Filename of .csv file to be created
radius: list
  List containing radius of a particle
centers: list
  List containing the centers of a particle
pp_tag: str, optional
  Postfix .geo file with this tag

Definition at line 12 of file particle_wall.py.

12def particle_locations(filename, radius, centers, pp_tag = None):
13 """
14 Creates .csv file containing the center, radius, orientation, and zone id of each particle in two-particle setup
15
16 Parameters
17 ----------
18 filename : str
19 Filename of .csv file to be created
20 radius: list
21 List containing radius of a particle
22 centers: list
23 List containing the centers of a particle
24 pp_tag: str, optional
25 Postfix .geo file with this tag
26 """
27 pp_tag_str = '_{}'.format(str(pp_tag)) if pp_tag is not None else ''
28 inpf = open(filename + pp_tag_str + '.csv','w')
29 inpf.write('i, x, y, z, r, o\n')
30 for i in range(len(radius)):
31 inpf.write('%d, ' % i)
32 inpf.write(print_list(centers[i], '%Lf'))
33 inpf.write(', %Lf' % radius[i])
34 o = 0. if i == 0 else np.pi * 0.5
35 inpf.write(', %Lf\n' % o)
36 inpf.close()
37

References util.print_list().

Here is the call graph for this function:

Variable Documentation

◆ args

particle_wall.args = parser.parse_args()

Definition at line 45 of file particle_wall.py.

◆ beta_n_eps

float particle_wall.beta_n_eps = 0.9

define beta_n parameter for normal damping

Definition at line 114 of file particle_wall.py.

◆ beta_n_factor

int particle_wall.beta_n_factor = 5000.

Definition at line 116 of file particle_wall.py.

◆ center

list particle_wall.center = [0., 0., 0.]

origin (this center is used to discretize the particle and later discretization is translated and rotated appropriately)

Definition at line 54 of file particle_wall.py.

◆ centers

list particle_wall.centers = []

Definition at line 124 of file particle_wall.py.

◆ cmd

str particle_wall.cmd = "gmsh p.geo -2 &> /dev/null"

Neighbor info at present, this block has no impact in the simulation.

step 2: run peridem

We have it for later extensions of the library.

Material info material properties have to be specified in a zone-specific manner

Force Gravity force is of body force type and all particles and walls experience this force

IC

Displacement

Output info in this block, we take care of simulation output

HPX specific block (I would recommend to not touch this block unless you know what your are doing!!)

close file damn I feel tired already!!

run step 1: run gmsh

Definition at line 382 of file particle_wall.py.

◆ contain_params

list particle_wall.contain_params = [0., 0., 0., 2.*R, 4.*R, 0.]

provide model specific details

not used (I should get rid of this soon)

container info Container is the region in 2d (or in 3d) where you expect all activites to take place. If not sure, you can take a wild guess of bounding box of this simulation.

Definition at line 160 of file particle_wall.py.

◆ d

float particle_wall.d = 0.001

initial distance between particle and wall

Definition at line 72 of file particle_wall.py.

◆ damping_active

bool particle_wall.damping_active = True

Definition at line 117 of file particle_wall.py.

◆ default

particle_wall.default

Definition at line 42 of file particle_wall.py.

◆ delta

float particle_wall.delta = d - horizon

Definition at line 74 of file particle_wall.py.

◆ dt

float particle_wall.dt = T / N_steps

Definition at line 81 of file particle_wall.py.

◆ E1

particle_wall.E1 = get_E(K1, nu1)

Definition at line 90 of file particle_wall.py.

◆ E2

particle_wall.E2 = get_E(K2, nu2)

Definition at line 98 of file particle_wall.py.

◆ error

particle_wall.error

Definition at line 384 of file particle_wall.py.

◆ fpath

str particle_wall.fpath = './'

Definition at line 51 of file particle_wall.py.

◆ friction_active

bool particle_wall.friction_active = False

Definition at line 121 of file particle_wall.py.

◆ friction_coeff

float particle_wall.friction_coeff = 0.5

friction coefficient

Definition at line 120 of file particle_wall.py.

◆ g

list particle_wall.g = [0., -10., 0.]

gravity

Definition at line 57 of file particle_wall.py.

◆ G1

particle_wall.G1 = get_G(E1, nu1)

Definition at line 91 of file particle_wall.py.

◆ G2

particle_wall.G2 = get_G(E2, nu2)

Definition at line 99 of file particle_wall.py.

◆ Gc1

int particle_wall.Gc1 = 50.

Definition at line 92 of file particle_wall.py.

◆ Gc2

int particle_wall.Gc2 = 50.

Definition at line 100 of file particle_wall.py.

◆ h

float particle_wall.h = R / 8.

mesh size (use smaller radius to decide)

Definition at line 63 of file particle_wall.py.

◆ help

particle_wall.help

Definition at line 44 of file particle_wall.py.

◆ horizon

int particle_wall.horizon = 3. * h

peridynamics horizon (typically taken as 2 to 4 times the mesh size)

Definition at line 66 of file particle_wall.py.

◆ inpf

particle_wall.inpf = open(fpath + 'input.yaml','w')

file below creates .geo file (see util.py)

open a input file (we choose pretty obvious name input.yaml)

Definition at line 134 of file particle_wall.py.

◆ K1

float particle_wall.K1 = 2.16e+7

Definition at line 89 of file particle_wall.py.

◆ K2

float particle_wall.K2 = 2.16e+7

Definition at line 97 of file particle_wall.py.

◆ Kn_11

int particle_wall.Kn_11 = 18. * get_eff_k(K1, K1) / (np.pi * np.power(horizon, 5))

define Kn parameter for normal contact force (see PeriDEM paper for more details)

Definition at line 109 of file particle_wall.py.

◆ Kn_12

int particle_wall.Kn_12 = 18. * get_eff_k(K1, K2) / (np.pi * np.power(horizon, 5))

Definition at line 111 of file particle_wall.py.

◆ Kn_22

int particle_wall.Kn_22 = 18. * get_eff_k(K2, K2) / (np.pi * np.power(horizon, 5))

Definition at line 110 of file particle_wall.py.

◆ N_out

int particle_wall.N_out = N_steps / 100

Definition at line 83 of file particle_wall.py.

◆ N_steps

int particle_wall.N_steps = 2000000

Definition at line 79 of file particle_wall.py.

◆ nu1

float particle_wall.nu1 = 0.25

material for zone 1 (in this case zone 1 has just one particle)

Definition at line 87 of file particle_wall.py.

◆ nu2

float particle_wall.nu2 = 0.25

Definition at line 95 of file particle_wall.py.

◆ output

particle_wall.output

Definition at line 384 of file particle_wall.py.

◆ p_geom

list particle_wall.p_geom = [R, center[0], center[1], center[2]]

zone info we have two zones

zone 1 (particle)

zone 2 (wall)

particle info as we said earlier, the properites are specific in a zone-specific manner what I really mean by zone-specific will be clear now

Definition at line 190 of file particle_wall.py.

◆ parser

particle_wall.parser = argparse.ArgumentParser(description='Setup and run PeriDEM simulation')

Definition at line 40 of file particle_wall.py.

◆ process

particle_wall.process = subprocess.Popen(cmd.split(), stdout=subprocess.PIPE)

Definition at line 383 of file particle_wall.py.

◆ R

float particle_wall.R = 0.001

radius of p

Definition at line 60 of file particle_wall.py.

◆ R_contact_factor

float particle_wall.R_contact_factor = 0.95

contact radius is taken as R_contact_factor * h_{min} where h_{min} is the minimum mesh size over all meshes (it is computed at the begining of simulation) we only specify the R_contact_factor

Definition at line 106 of file particle_wall.py.

◆ rho1

int particle_wall.rho1 = 1200.

Definition at line 88 of file particle_wall.py.

◆ rho2

int particle_wall.rho2 = 1200.

Definition at line 96 of file particle_wall.py.

◆ T

float particle_wall.T = 0.1

final time and time step

Definition at line 78 of file particle_wall.py.

◆ type

particle_wall.type

Definition at line 43 of file particle_wall.py.

◆ v0

list particle_wall.v0 = [0, -np.sqrt(2. * np.abs(g[1]) * delta), 0.]

Definition at line 75 of file particle_wall.py.

◆ wall_rect

list particle_wall.wall_rect = [0., 0., 0., 2.*R, horizon, 0.]

wall geometry (corner point coordinates)

Definition at line 69 of file particle_wall.py.