-
Notifications
You must be signed in to change notification settings - Fork 247
MPM example in GiD
This tutorial is intended to give an overview on how to pre- and post-process a problem with the material point method (MPM) in GiD. The general procedure how to set up a problem geometry, specify the boundary conditions, generate the mesh, calculate the solution and display the results, is explained subsequently by going through an example. For this purpose a cantilever beam under dead load is regarded. The corresponding geometric and cross-sectional properties are displayed in the picture below. For the calculation of the problem KRATOS Multiphysics is called internally from GiD.
The very first step is to open GiD. Then we need to load the Kratos GiD GUI. Therefore click on Data
→ Problem type
→ Kratos
in the top toolbar. In the opening window, the Kratos Application Market, select then the MPM application.
Following this, another window is going to appear where one has to choose the dimensions of the MPM problem that is to be modelled. For this example we choose 2D by clicking on the left field.
In the sidebar with the title 'Particle mechanics' on the left, we can adjust different parameters for the solution of the problem. The most important are:
- Solver Type: Since the regarded problem is static, we select the corresponding solver type.
- Parts: Within 'parts' the domains for the body mesh (particles) and the background grid are chosen and important parameters are defined. Solid contains the data for the body mesh; Grid the data for the background mesh.
- Boundary conditions: Here we can assign Dirichlet boundary conditions to the problem domain.
- Loads and other conditions: In this section different types of loads and slip conditions can be defined.
In our example we will regard a cantilever beam under gravity forces. As already mentioned above, we choose therefore the solver type static.
To set up the geometry of the problem, two domains have to be defined: one for the background grid and one for the body domain. For that purpose we define at first the background domain. By clicking on the create object-icon and choosing a rectangle, we define the background domain. In the next step we define another, smaller rectangle that represents the cantilever.
After clicking on the indicated button a menu opens. To create a rectangle click on the marked rectangle:
Now follow the instructions given in the command line:
We create two rectangles by entering the coordinates of the left lower and the right upper corner point in the command line. We enter the coordinates in the format shown in the image above and confirm them by pressing Enter
. The first rectangle that is going to represent the background domain has its corner points at (0,0) and (5,2). The second one that represents the cantilever has its corner points at (0, 0.5) and (5,1.5). Now the geometry should be
displayed in GiD's main window as in the picture below:
Subsequently, we assign the geometries to the different domains, choose element formulations and specify the material parameters of the structures. We start with the body structure. Click on Solid
, then a menu opens above the command line.
Here we enter the material parameters. The cantilever in our problem is made of steel, so we enter the corresponding material parameters.
Then we have to assign the data that we just entered to a domain of our problem. This step is very important and error prone. To assign our entered data to the rectangle that represents the cantilever beam click on Select
.
With the mouse that has now a different cursor, a little quadrat with a smaller quadrat inside, click on the purple rectangle that lies within the area of the 'cantilever-rectangle'. After clicking on it, this inner purple line should change its color to red, as indicated in the image below.
Then leave the selection of areas by clicking ESC
and confirm your choice by clicking OK
. The same procedure we repeat with the 'background rectangle'. We start by clicking on Grid
. In the opening menu we click on Select
and choose now the inner purple rectangle of the 'background rectangle'. Then we hit ESC
and confirm our choice by clicking OK
. Now we assigned element formulations, material parameters and the domains to our problem geometry. In the next step we will deal with the boundary conditions.
The cantilever has a fixed support on the left. So we set there all displacements permanently to 0. On the right side, the cantilever can deflect freely, so we assign there a slip condition. To impose the Dirichlet boundary condition on the left side, we click on Boundary Conditions
→ Displacements
.
Afterwards, a new menu opens above the command line. Here we choose, as already indicated in the picture, line conditions. We click again on Select
and choose the left edge of the large rectangle. This edge changes its color from blue to red, then we end the selection by hitting ESC
and clicking OK
.
To assign a slip condition on the right side of the background rectangle, click on Loads and other conditions
→Slip
. Then select the right edge of the background rectangle in the same way as we selected the left edge. Now we imposed all the necessary boundary conditions on the example problem. Note, that the boundary conditions were imposed in this case on the background mesh. In MPM it is also possible to impose boundary conditions on the body mesh.
The next step is to add loads to the model. As we regard the cantilever beam under dead load in our example, we don't have to apply additional loads on the structure. GiD resp. KRATOS takes the dead load automatically into account.
Before we start the meshing of the problem, we save our project by clicking on Files
→Save
in the top toolbar.
For the Meshing we click on Mesh
in the upper toolbar. Then a dropdown menu opens with different meshing options. In MPM the background grid and the body have different meshes, so two meshes are to be defined. For the body mesh we choose a structured mesh of quadrilaterals with a mesh size of 0.05. To assign it to the body, one clicks on Mesh
→Structured
→Surfaces
→Assign sizes
. Subsequently, select the area of the cantilever by clicking on the purple rectangle within it. The inner rectangle of the cantilever changes its color from purple to red once it is selected. This can be seen in the picture below.
Then a pop-up window appears where we have to enter the mesh size of lines. Here we enter 0.05, too (the mesh size of the assigned lines creates the mesh size of the area).
To assign a structured mesh to the area of the cantilever, we have to specify the edges of the area. Therefore, we click firstly on one of the horizontal (blue) lines of the area of the cantilever.
To select the vertical lines of the cantilever, draw a rectangle (click into the drawing plane, hold the left button of the mouse and move the pointer), as indicated in the picture below, over the area of the cantilever.
As the vertical edges of the larger and the smaller rectangle (boundaries of the background- and body-domain) lie above each other, both of them are selected by the created rectangle. However, since only the edges of the smaller one belong to the inner surface, an error-message appears:
After confirming the error-message, the following lines should be selected (in case the horizontal lines aren't red anymore, just select them again):
Subsequently, press 'ESC' and assign the mesh size 0.05 to the surrounding lines.
The background grid is created in an analogous manner. Instead of selecting the area of the cantilever, select now the area of the background domain (large purple rectangle). Assign a mesh size of 0.2 to the area and the surrounding edges of the background domain.
Note: It is generally recommended to choose the size of the body mesh smaller than half the size of the background mesh. This leads to more meaningful results and enhances the stability of the calculation process.
After adjusting the meshing parameters, create the mesh by clicking on Mesh
→Generate Mesh
. Another pop-up window will appear that asks for a mesh size.
The meshing parameters, which were defined in the previous step, override the size that is displayed in the pop-up window. So simply click Ok
. A further pop-up window shows the number of nodes, elements, etc. that were generated. Finally, the meshed geometry is displayed.
By now, the setup of the model of the cantilever is complete. To calculate the displacement of the cantilever, click in the top toolbar on Calculate
→Calculate
, as shown in the image below.
Then the calculation of the problem is carried out. As already mentioned in the first paragraph, the calculation is done within the KRATOS Multiphysics framework. More information on the material point method and its implementation within KRATOS is available under ParticleMechanicsApplication.
After the calculation, one can find in the project folder the following files (among others):
-
MainKratos.py
-
ProjectParamters.json
-
ParticleMaterials.json
-
project_name_Body.mdpa
-
project_name_Grid.mdpa
-
project_name_Body.post.res
-
project_name_Grid.post.bin
The files MainKratos.py, ProjectParamters.json, ParticleMaterials.json, project_name_Body.mdpa and project_name_Grid.mdpa contain the data that is required for the calculation of the problem with KRATOS.
The last two files project_name_Body.post.res and project_name_Grid.post.bin contain essential results of the calculation and are used in the post-processing.
When the calculation finished, examine the results in the post-processing mode of GiD. For this purpose, navigate in windows explorer to the folder that contains your project files. Then select the file project_name_Body.post.res and hand it via Drag and Drop over to GiD (drop it over the main window of GiD, e.g. over the meshed problem).
Then GiD automatically switches to its post-processing surface and loads the results file. Now, we can see the particles that we assigned to the domain of the cantilever in a previous step:
Often it is useful to compare the behaviour of the particles with the geometry of the background mesh. To add the background mesh to the post-processing, click on Files
→Merge
and select the file project_name_Grid.post.bin to open.
Then we can see the particles as well as the background domain.
To adapt the depiction of the background mesh, we click in the right toolbar in the line of the backgroundmesh on the yellow quadrat that contains a black cross. Subsequently, another dropdown menu opens and we click on the first entry, as depicted in the image below.
Now we can see the particles within the outer edges of the background mesh:
To see the deformation of the particles due to the dead load of the structure, one has to select the depiction of the displacement of the
material points (particles). This is done by clicking on the following symbol and selecting MP Displacement
.
Subsequently, another pop-up window opens where we have to specify the deformation (scaling) factor. In this example, the real deformation is so small that it cannot be seen with a scaling of 1. Therefore we choose a deformation factor of 100. To do this, we click on 1x
and enter in the next pop-up window a scaling factor of 100.
Then we can finally see the deformation of the cantilever beam:
In some cases it may be useful to see the change of the deformation over the time (e.g. for a dynamic problem). To see the change of deformation over time, click on the play button in the upper toolbar, as shown in the following picture:
Note: Since we calculated here a static example, only the initial state of the system and the final displacement are depicted within the deformation over time depiction.
- Getting Kratos (Last compiled Release)
- Compiling Kratos
- Running an example from GiD
- Kratos input files and I/O
- Data management
- Solving strategies
- Manipulating solution values
- Multiphysics
- Video tutorials
- Style Guide
- Authorship of Kratos files
- Configure .gitignore
- How to configure clang-format
- How to use smart pointer in Kratos
- How to define adjoint elements and response functions
- Visibility and Exposure
- Namespaces and Static Classes
Kratos structure
Conventions
Solvers
Debugging, profiling and testing
- Compiling Kratos in debug mode
- Debugging Kratos using GDB
- Cross-debugging Kratos under Windows
- Debugging Kratos C++ under Windows
- Checking memory usage with Valgind
- Profiling Kratos with MAQAO
- Creating unitary tests
- Using ThreadSanitizer to detect OMP data race bugs
- Debugging Memory with ASAN
HOW TOs
- How to create applications
- Python Tutorials
- Kratos For Dummies (I)
- List of classes and variables accessible via python
- How to use Logger
- How to Create a New Application using cmake
- How to write a JSON configuration file
- How to Access DataBase
- How to use quaternions in Kratos
- How to do Mapping between nonmatching meshes
- How to use Clang-Tidy to automatically correct code
- How to use the Constitutive Law class
- How to use Serialization
- How to use GlobalPointerCommunicator
- How to use PointerMapCommunicator
- How to use the Geometry
- How to use processes for BCs
- How to use Parallel Utilities in futureproofing the code
- Porting to Pybind11 (LEGACY CODE)
- Porting to AMatrix
- How to use Cotire
- Applications: Python-modules
- How to run multiple cases using PyCOMPSs
- How to apply a function to a list of variables
- How to use Kratos Native sparse linear algebra
Utilities
Kratos API
Kratos Structural Mechanics API