Grain-based model (GBM), interface with Neper ######################################## .. raw:: html .. role:: red .. role:: blue Grain based modeling for UCS example. The grain-based model is constructed by the Voronoi tessellations fron `Neper `_, ``.geo`` or ``.inp`` files can be directly imported by OpenFDEM and each tessellation will be created into a individual physcial group. The user can regroup those tessellations into different minerals by assigning the area ratio, OpenFDEM will create those mineral groups by random to approach the predesigned mineral distributions. .. figure:: ../../images/User_Guide/grainbasedmodel.png :alt: Geometry of the uniaxial compression test :align: center Figure 1: Mineral distribution in UCS sample ================================== 1 Tutorial Prerequistes ================================== The following files are needed to follow along the tutorial: - `Job-1.inp`_ (click to download from GitHub) .. _Job-1.inp: https://github.com/OpenFDEM-geomechanics/Examples/tree/main/GBM/Job-1.inp ================================== 2 Main Steps ================================== #. Initialize the model. #. Create the geometry and the mesh #. Assign material properties. #. Create the group and assign boundary conditions. #. Set the outputs. ================================== 3 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: ------------------------------------------------------------------- 3.1 Initialize the model ------------------------------------------------------------------- 1. Create a new run and clean up the old memories. .. literalinclude:: examples/GBM/runme.of :lines: 39 2. Turn on GBM module. .. literalinclude:: examples/GBM/runme.of :lines: 40 3. Set up the folder name to save your results. Here the folder name is set to be “result”. .. literalinclude:: examples/GBM/runme.of :lines: 44 4. Set the number of cores to be used for running this model. .. 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/GBM/runme.of :lines: 49 ------------------------------------------------------------------- 3.2 Import the geometry and the mesh ------------------------------------------------------------------- 1. Import the mesh file from ``Neper``. .. literalinclude:: examples/GBM/runme.of :lines: 52 2. Regroup the tessellations to three mineral groups, each group is controlled by the area ratio. .. literalinclude:: examples/GBM/runme.of :lines: 54 3. Create ``object:element`` groups for platens and sample. .. literalinclude:: examples/GBM/runme.of :lines: 55-57 4. Insert cohesive interface in rock sample only. .. literalinclude:: examples/GBM/runme.of :lines: 60 5. Create ``object:cohesive`` groups for the interfaces, those groups will be assigned different material properties. .. literalinclude:: examples/GBM/runme.of :lines: 63-68 ------------------------------------------------------------------- 3.3 Assign Material and Thermal Properties ------------------------------------------------------------------- 1. Set the material properties of minerals and platens. .. literalinclude:: examples/GBM/runme.of :lines: 71-73, 75-76 2. Assign different materials for cohesive interfaces. .. literalinclude:: examples/GBM/runme.of :lines: 79-84 3. Assign different materials for contact. .. literalinclude:: examples/GBM/runme.of :lines: 87-93 ------------------------------------------------------------------- 3.4 Create Groups and Assign Boundary Conditions ------------------------------------------------------------------- 1. Create ``object::node`` groups. .. literalinclude:: examples/GBM/runme.of :lines: 96-97 2. Assign the nodal boundaries. In this model, top, bottom and right boundaries are fixed in both *x* and *y* directions. .. literalinclude:: examples/GBM/runme.of :lines: 101-102 ------------------------------------------------------------------- 3.5 Set the Outputs ------------------------------------------------------------------- 1. Set the output interval to be every 500 steps and output all fields variables and fracture variables. .. literalinclude:: examples/GBM/runme.of :lines: 106-108 2. The program will run 10000000 steps in total. .. literalinclude:: examples/GBM/runme.of :lines: 112 3. Finalize the model and clear all the temporary memories. .. literalinclude:: examples/GBM/runme.of :lines: 114 4. Save the notepad and double click the .of file to run the program. ================================== 4 Run the Program ================================== Wait for updates. ================================== 5 Results ================================== Wait for updates. ================================== 6 Full Script ================================== - `GBM.of`_ (click to download from GitHub) .. _GBM.of: https://github.com/OpenFDEM-geomechanics/Examples/blob/main/GBM/Job-1.inp .. literalinclude:: examples/GBM/runme.of :lines: 37-114 .. raw:: html