Building a very simple tensile test (tutorial)

Tutorials

basic
your first simulation
advanced

This page describes how to build a real simulation

Prerequisites

You must follow the previous tutorial steps before starting this tutorial. You need results of previous tutorial steps. These results will be used as input data for this simulation. More precisely, you need this discrete domain a simple discrete domain

Please copy one of this domain in the current folder as it follows

:prompt: cp ./MyDomain/MyFirstDomain.agdd ./

Now, your current directory must look like

├── build
├── build-domain.inp
├── CMakeLists.txt
├── Main.cpp
├── MyDomain
│   └── MyFirstDomain.agdd
├── MyFirstDomain.agdd
├── my-project.inp
├── PlugIn_BuildDomain.cpp
└── PlugIn_BuildDomain.hpp
and the minimal required files are :
├── build
├── CMakeLists.txt
├── Main.cpp
├── MyFirstDomain.agdd
├── Main.py
├── MyDomain
│   └── MyFirstDomain.agdd
├── MyFirstDomain.agdd
├── my-project.inp
├── PlugIn_BuildDomain.py
and the minimal required files are :
├── Main.py
├── MyFirstDomain.agdd

The input file

The goal of this simulation is to clamp the discrete element at the left and load the discrete element at the right. This simulation can be set through input file only. You can create a new input file named tensile.inp with the following input.

<GRANOO Version="3"  OutDir="Tensile-test" Verbose="No" ThreadNumber="1">

  <STEP Label="pre-processing">
    <READ-DOMAIN FileName="MyFirstDomain.agdd"/>
    <CONVERT-ELEMENT-PAIR-TO-BEAM YoungModulus="50e9" RadiusRatio="0.6"/>
    <COMPUTE-OPTIMAL-TIME-STEP Ratio="0.14" />
  </STEP>
   
  <STEP Label="processing" IterNumber="5000">
    <!-- Loadings section -->
    <CLEAR-LOAD />
    <APPLY-FORCE X="if((it<1000),it*1e5,0)" Set="left"/>
    <APPLY-BOND-LOAD />
	<!-- Integration section -->
    <INTEGRATE-ACCELERATION Linear="Yes" Angular="Yes"/>
	<!-- Boundary condition section -->
    <APPLY-DISPLACEMENT Clamp="Yes" Set="right"/>
	<!-- Misc section -->
    <CHECK/>
    <SAVE-DOMAIN EveryIter="100" Type="gdd"/>
  </STEP>
  
</GRANOO>

Step by step description of input file

The following plugin loads a discrete domain file into the simulation

<READ-DOMAIN FileName="MyFirstDomain.agdd"/>

The following plugin converts all the ElementPair (described in a previous tutorial step) into mechanical beams. To get full description of what this beam are, you can consult the scientific bibliography.

<CONVERT-ELEMENT-PAIR-TO-BEAM YoungModulus="50e9" RadiusRatio="0.6"/>

The following plugin computes the optimal time step. It corresponds to the higher time step that ensures stable simulations.

<COMPUTE-OPTIMAL-TIME-STEP Ratio="0.14" />

The following plugin clears all the forces and torques applied to elements and bodies. After this plugin the domain is completely relaxed.

<CLEAR-LOAD />

The following plugin applies a force on all the discrete elements indexed by the left SetOf. Here, only one discrete element is concerned. The X=... corresponds to the value of the force along the X axis. A mathematical formula is given that corresponds to : if the iteration is lower than 1,000, the force is 100,000 times the iteration value or zero instead.

<APPLY-FORCE X="if((it<1000),it*1e5,0)" Set="left"/>

The following plugin computes the mechanical induced by the deformation of beams. The given loads are applied to the connected discrete elements.

<APPLY-BOND-LOAD/>

The following plugin applies the velocity verlet integration scheme that computes linear and angular accelerations, velocities and displacements.

<INTEGRATE-ACCELERATION Linear="Yes" Angular="Yes"/>

The following plugin imposes displacements to a discrete element set. Here the discrete elements are clamped (they can’t move).

<APPLY-DISPLACEMENT Clamp="Yes" Set="right"/>

The following plugin checks if the computation is right.

<CHECK/>

The following plugin saves the current state of the domain all 100 iterations.

<SAVE-DOMAIN EveryIter="100" Type="gdd"/>

Running example and showing results.

Now, check first if your project is compiled with
:prompt: cd build/ && cmake ../ && make && cd ../

Run the example

:prompt: ./build/my-project.exe ./tensile.inp
:prompt: python ./Main.py ./tensile.inp

Show the result

:prompt: granoo3-viewer ./Tensile-test

You should see the granoo3-viewer window. If you press the Read button, you should see an animation where you domain oscillates.