Skip to content

MPM example in GiD

phfranz edited this page Sep 20, 2022 · 3 revisions

Setting up a MPM example in GiD

1.Introduction

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.

Structural system

2.Set up a Material Point Method problem in GiD

2.1 Load the MPM GUI

The very first step is to open GiD. Then we need to load the Kratos GiD GUI. Therefore click on DataProblem typeKratos in the top toolbar. In the opening window, the Kratos Application Market, select then the MPM application.

Kratos_Application_Market

Kratos application Market

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.

GUI_GiD_wa

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.

2.2 Set up the example geometry

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.

create_object_classic_wa

After clicking on the indicated button a menu opens. To create a rectangle click on the marked rectangle:

create_rectangle_classic_wa

Now follow the instructions given in the command line:

command_window_classic_wa

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:

rectangles_created

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.

solid_1

menu_above_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.

solid_1_new_wa

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.

solid_3_new_wa

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.

2.2 Definition of 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 ConditionsDisplacements.

boundary_conditions_1_new_wa

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.

slip_cond_1_wa

To assign a slip condition on the right side of the background rectangle, click on Loads and other conditionsSlip. 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.

2.3 Application of Loads

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.

3. Meshing

Before we start the meshing of the problem, we save our project by clicking on FilesSave 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 MeshStructuredSurfacesAssign 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.

assign_body_mesh_1

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).

bodymesh_enter_sizes

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.

bodymesh_enter_surrounding_lines_1

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.

bodymesh_enter_surrounding_lines_2

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:

bodymesh_enter_surrounding_lines_3

After confirming the error-message, the following lines should be selected (in case the horizontal lines aren't red anymore, just select them again):

final_lines

Subsequently, press 'ESC' and assign the mesh size 0.05 to the surrounding lines.

size_on_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 MeshGenerate Mesh. Another pop-up window will appear that asks for a mesh size.

generate_mesh_1

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.

refined_mesh

4. Calculation

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 CalculateCalculate, as shown in the image below.

calculation_refined_mesh

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.

5. 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).

drag_and_drop

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:

updated_particles_result

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 FilesMerge and select the file project_name_Grid.post.bin to open.

merge

merge2

Then we can see the particles as well as the background domain.

merged_result_files

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.

right_toolbar_wa

Now we can see the particles within the outer edges of the background mesh:

merged_image_2

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.

choose_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.

deformation_factor_wa new_deformation_factor

Then we can finally see the deformation of the cantilever beam:

deformed_structure

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:

show_video_button

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.

Project information

Getting Started

Tutorials

Developers

Kratos structure

Conventions

Solvers

Debugging, profiling and testing

HOW TOs

Utilities

Kratos API

Kratos Structural Mechanics API

Clone this wiki locally