Quick start with uniaxial compression test ############################################################ Uniaxial compression test (UCS) is one of the oldest and simplest rock mechanical test used to determine the Young's modulus and unconfined compressive strength. It is also used as the most common simulation to calibrate the material properties in FDEM or DEM. In this model, the sample is compressed by two rigid platens and the force interaction between platens and rock sample is realized by contacts. Barrel-shape failure mode is expected by theory. .. figure:: ../../images/Desmos/UCS.png :alt: Geometry of the uniaxial compression test :align: center Figure 1: Geometry of the uniaxial compression strength test ================================== 1 Main Steps ================================== #. Initialize the model. #. Create geometry and mesh #. Assign material properties. #. Create groups and assign boundary condition. #. Set the outputs. #. Run ================================== 2 Codes ================================== .. warning:: Please note that, all the setting in the example is based on the developer's computer. You may need to change these details based on your own environment. To start with programming, create a new empty input file or copy it from the existing examples (later add the ``.of`` extension). Begin writing the following commands: ------------------------------------------------------------------- 2.1 Initialize the model ------------------------------------------------------------------- 1. Create a new run and clean up the dirty memories in heap, it is not mandatory but strongly recommended. .. literalinclude:: examples/CreateUniaxialCompressionTest/runme.of :lines: 39 2. Set up the path to save your results. Here the path is set to be “`currentPath`/result”. .. note:: By default, the field results (``VTK``, ``VTP``) will be saved in "MyResult" folder in the same path with ``.of`` file. OpenFDEM kernel will automatically create the folder if it is absent. .. literalinclude:: examples/CreateUniaxialCompressionTest/runme.of :lines: 43 3. Set the interval of logging in the ``.log`` file. This example uses the default interval 2000 steps. ``.log`` file will be useful to help user figure out the running error, and can be used as a tool to debug. .. literalinclude:: examples/CreateUniaxialCompressionTest/runme.of :lines: 46 4. Set the CPU parallelization to boost your runs. .. warning:: In the default example, 15 cores will be used for running. To prevent the heavy burden of your computer, please check your computer to change core number you want to use. To check the configuration of your computer, you can go Windows: Task Manager > Performance > CPU > Cores Linux: lscpu lscpu | egrep 'Model name|Socket|Thread|NUMA|CPU\(s\)' lscpu -p The cores will be printed on the console when you start a new run, you can also check the information from OpenFDEM kernel itself. If nothing is set here, serial computing will be used by default. .. literalinclude:: examples/CreateUniaxialCompressionTest/runme.of :lines: 51 ------------------------------------------------------------------- 2.2 Create the geometry and the mesh ------------------------------------------------------------------- 1. See Figure 1 for the UCS model and create the geometries. This model can be assembeld by three retangulars, the implemented objects OpenFDEM can create include square(rectangular), circle, ellipse, polygon(arbitary shape), Voronoi tessellations, line, etc. .. note:: The following three methods can be used to create the geometry: 1. xmin x_minvalue xmax x_maxvalue ymin y_minvalue ymax y_maxvalue 2. x [minvalue, maxvalue] y [minvalue, maxvalue] 3. [x_minvalue, x_maxvalue, y_minvalue, y_maxvalue] (brackets are indispensable) This example used three methods to creat a entity. Users may choose any format to create geometris. .. literalinclude:: examples/CreateUniaxialCompressionTest/runme.of :lines: 56, 58, 60 2. Define the mesh size geometry and insert cohesive interfaces. You can define a global size on the points in your geometry, it is able to refine some specific parts, assign a smaller mesh size on the point groups you want to refine after your assign the global mesh size. .. seealso:: OpenFDEM is flexible to insert cohesive interfaces only in the objects you want to. For the example at here, the platens are regarded as elastic or rigid in which the breakage will not happen. You can insert cohesive interfaces only in `rock` physical group to boost the calculation speed to some extent. .. literalinclude:: examples/CreateUniaxialCompressionTest/runme.of :lines: 62, 66, 69 ------------------------------------------------------------------- 2.3 Assign Material Properties ------------------------------------------------------------------- The material properties of the rock is shown as the table below: +---------------------------------------------+------------------------+ |Parameter |Value | +=============================================+========================+ | **Continuum Triangular Elements** | | +---------------------------------------------+------------------------+ | model | elastic | +---------------------------------------------+------------------------+ | density (:math:`kg/m^3`) | 2700 | +---------------------------------------------+------------------------+ | E (Pa) | 30e9 | +---------------------------------------------+------------------------+ | :math:`\nu` | 0.3 | +---------------------------------------------+------------------------+ | damp | 1.0 | +---------------------------------------------+------------------------+ | | | +---------------------------------------------+------------------------+ | **Cohesive Material Properties** | | +---------------------------------------------+------------------------+ | model | EM | +---------------------------------------------+------------------------+ | tension (Pa) | 1e6 | +---------------------------------------------+------------------------+ | cohesion (Pa) | 3e6 | +---------------------------------------------+------------------------+ | friction | 0.3 | +---------------------------------------------+------------------------+ | GI (:math:`J/m^2`) | 10 | +---------------------------------------------+------------------------+ | GII (:math:`J/m^2`) | 50 | +---------------------------------------------+------------------------+ | | | +---------------------------------------------+------------------------+ | **Contact Material Properties** | | +---------------------------------------------+------------------------+ | model | MC | +---------------------------------------------+------------------------+ | friction | 0.3 | +---------------------------------------------+------------------------+ .. seealso:: Check :doc:`element materal<../rst_user_guide/Material/of.mat.element>`, :doc:`cohesive materal<../rst_user_guide/Material/of.mat.cohesive>`, :doc:`contact materal<../rst_user_guide/Material/of.mat.contact>` to see more materials. 1. Assign material properties. In this example, elastic material is assigned for the matrix element and Evans_Marathe cohesive law is for CZM, the contact uses Mohr-Coulomb slip by default. .. warning:: The tag *default* is a default keyword implemented in the OpenFDEM kernel, it means the whole physical objects in this model. It will be illegal to use this tag as the name of user-defined physical group. .. literalinclude:: examples/CreateUniaxialCompressionTest/runme.of :lines: 73, 75, 77 ------------------------------------------------------------------- 2.4 Create Groups and Assign Boundary Conditions ------------------------------------------------------------------- 1. Group the nodes. .. literalinclude:: examples/CreateUniaxialCompressionTest/runme.of :lines: 82-83 2. Assign the nodal boundaries. In this example, top and bottom platens are moving toward to compress the sample, platens are fixed in the `x` direction and moving with 0.05 m/s in the `y` direction. .. literalinclude:: examples/CreateUniaxialCompressionTest/runme.of :lines: 87-88 ------------------------------------------------------------------- 2.5 Set the Outputs ------------------------------------------------------------------- 1. Set the result writting interval and the field variables you want to dumper. `default` means the all variables during the calculation will be exported, that will result in huge size for the storage and at the cost of computation efficiency. Control the output interval to a reasonable size could shorten the computation time. .. literalinclude:: examples/CreateUniaxialCompressionTest/runme.of :lines: 92, 94-95 2. Timestep can be fixed to 5e-9 in this example to accelerate the calculation in this example, but the default time step is recommended to use. Mass scaling can save you a lot time to some extent, but check the stability of the calculation is always a necessary for the explict integration. User-defined timestep is allowable only if you are rather familiar with the method you are using. .. literalinclude:: examples/CreateUniaxialCompressionTest/runme.of :lines: 101 ------------------------------------------------------------------- 2.6 Run ------------------------------------------------------------------- 1. The program will run 500000 steps in total. In other words, it will output 10 files for reference. .. literalinclude:: examples/CreateUniaxialCompressionTest/runme.of :lines: 103 2. Finalize the model and clear all the temporary memories. .. literalinclude:: examples/CreateUniaxialCompressionTest/runme.of :lines: 105 3. Save the notepad and double click the .of file to run the program. ================================== 3 Run the Program ================================== When you run the program, you can first check the mesh that was created by Gmsh as shown in Figure 2. If the mesh has a good quality, you can close the window to continue run the program. .. figure:: ../../images/Gmsh/UCS_test.png :alt: Mesh of the sample :align: center Figure 2: Mesh created by Gmsh The mesh is using triangle elements. .. figure:: ../../images/Command/UCS_T3.png :alt: Triangle elements :align: center Figure 3: Check the mesh setting from command window Material properties you set on step 2.3 will be shown on the screen. You can confirm it while the program just starts to run. .. figure:: ../../images/Command/UCS_Material.png :alt: Material assignment :align: center Figure 4: Check the material assignment from command window Furthermore, node boundaries are shown at the header of the program. .. figure:: ../../images/Command/UCS_bondaries.PNG :alt: Boundary information :align: center Figure 5: Check the boundary information from command window Global timestep is shown here. .. figure:: ../../images/Command/UCS_timesteps.png :alt: Timesteps :align: center Figure 6: Check the timesteps from command window Start to run the program. Results are logged for every 2000 steps. .. figure:: ../../images/Command/UCS_run.png :alt: Start to run the program :align: center Figure 7: Start to run the program ================================== 4 Results ================================== Stress YY results. .. figure:: ../../images/Result/UCS_StressYY_Viridis.gif :alt: UCS Stress YY :align: center Figure 8: UCS Stress YY Displacement YY results. .. figure:: ../../images/Result/UCS_DispYY_Viridis.gif :alt: UCS Displacement YY :align: center Figure 9: UCS Displacement YY ================================== 5 Full Script ================================== - `UCS_test.of`_ (click to download from GitHub) .. _UCS_test.of: https://github.com/OpenFDEM-geomechanics/Examples/blob/main/CreateUniaxialCompressionTest/runme.of .. literalinclude:: examples/CreateUniaxialCompressionTest/runme.of :lines: 37-105 .. raw:: html