How to use higher-order element#

By default, triangle elements will be used in the mesh and model. However, OpenFDEM also supports the quadratic triangle, quadrangle elements, quadratic quadrangle element and reduced quadrangle element, etc.

1 Code#

To run the model with quadrangle elements, users only need to add the following line after setting up the mesh size and before creating the mesh.

of.geometry.recombine 'rock'

2 Run the Program#

When the program runs, the mesh of the model will look like this.

Uniaxial Compression Test Mesh with Quadrangle Elements

Figure 1: Uniaxial Compression Test Mesh with Quadrangle Elements#

The program will also show the mesh has quadrilateral elements.

Uniaxial Compression Test Mesh with Quadrangle Elements

Figure 2: Uniaxial Compression Test Mesh with Quadrangle Elements#

3 Full Script#

# initialization, this command is to clear the memory in your last run, it is not 
# mandatory but strongly recommend.
of.new

# Set the path folder of your output results, //result// in the same path of your input 
# file will be created by default
of.set.result "result"

# Set the interval of logging in the log file, 2000 is by default, not mandatory
of.log.interval 2000

# Set the number of cores you want to use, the parallization will be automatically turned 
# on when you use the following command, otherwise the serilization will be used by 
# default
of.set.omp 15

###################################### create mesh #######################################
# Create a box having the group tag 'rock', the box is defined by the minimum and maximum 
# coordinations of each edge.
of.geometry.square 'rock' xmin -25e-3 xmax 25e-3  ymin -50e-3 ymax 50e-3 
# Create the upper platen
of.geometry.square 'up' x [-35e-3, 35e-3] y [50e-3, 55e-3]
# Create the down platen.
of.geometry.square 'down' [-35e-3  35e-3  -55e-3 -50e-3] 
# Assign the mesh size
of.geometry.mesh.size 'default' 0.8e-3
# combine the delaunay to quadrangle element types
of.geometry.recombine 'rock' 
# to execute the kernel for meshing, the kernel will automatically export a mesh file named 
# "mess.msh" in the input folder. Users can of.import "mesh.msh" to run the model again 
# without recreating the mesh
of.geometry.mesh delaunay 

# Insert the cohesive elements.
of.mesh.insert 'rock'

################################# assign material parameters ##############################
# Assign material for matrix.
of.mat.element 'default' elastic den 2700 E 30e9 v 0.3 damp 2.0
# Assign rigid material to the two plattens
of.mat.element 'up' rigid den 2700 
of.mat.element 'down' rigid den 2700
# assign material for CZM
of.mat.cohesive 'default' EM ten 1e6 coh 3e6 fric 0.3 GI 10 GII 50 
# assign materials for contacts
of.mat.contact 'default' MC fric 0.3

##################################### create groups #######################################
# OpenFDEM can manually group the nodes, elements, cohesive elements and edges by using the 
# region of box, circle and plane.
of.group.nodal.from.element 'up' 'up'
of.group.nodal.from.element 'down' 'down'

################################### assign boundaries #####################################
# boundaries can be assigned after you define the groups
of.boundary.nodal.velocity  'up' x 0.0 y -0.05 r 0.0
of.boundary.nodal.velocity  'down' x 0.0 y 0.05 r 0.0

####################################### set output ########################################
# Set the interval of writing ParaView results.
of.history.pv.interval 5000
# Output all results by default.
of.history.pv.field default
of.history.pv.fracture default

##################################### execute model #######################################
# Manually set the timestep to overwirte the default timestep suggested by the program.
# It is not recommended to manually increase the size of timesteps unless the user has 
# enough understanding of the calculation process.
of.timestep fix 5e-9
# to excuate the model
of.step 500000
# finalize the model and clear the memory
of.finalize