Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ tests/test_constant_strip_load_2d/MaterialParameters_stage_1.json
tests/test_constant_strip_load_2d/ProjectParameters.json
tests/test_darcy_law.gid/MaterialParameters.json
tests/test_darcy_law.gid/ProjectParameters.json
tests/test_element_lab/test_triaxial/MaterialParameters.json
tests/test_inclinded_phreatic_line_smaller_line.gid/MaterialParameters.json
tests/test_inclinded_phreatic_line_smaller_line.gid/ProjectParameters.json
tests/test_inclinded_phreatic_surface.gid/MaterialParameters.json
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"materials_filename": "MaterialParameters_abc.json"
},
"time_stepping": {
"time_step": 8.640000000000002e+03,
"time_step": 8.64e+03,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a change ( and the other dsettlement project parameters file too ) unrelated to the purpose of the pull request. Still, it is an improvement.

"max_delta_time_factor": 8.64e+07
},
"buffer_size": 2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"materials_filename": "MaterialParameters_abc.json"
},
"time_stepping": {
"time_step": 8.640000000000002e+03,
"time_step": 8.64e+03,
"max_delta_time_factor": 8.64e+07
},
"buffer_size": 2,
Expand Down
40 changes: 40 additions & 0 deletions applications/GeoMechanicsApplication/tests/test_element_lab.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,46 @@ class KratosGeoMechanicsLabElementTests(KratosUnittest.TestCase):
"""
This class contains some element tests, such as triaxial and oedometer tests
"""
def test_triaxial(self):
"""
Regression test for the triaxial experiment.
"""
test_name = 'test_triaxial'
file_path = test_helper.get_file_path(os.path.join('test_element_lab', test_name))
simulation = test_helper.run_kratos(file_path)

# read the output files from the simulation for comparison
reader = GiDOutputFileReader()
result = reader.read_output_from(os.path.join(file_path, 'triaxial_test_output.post.res'))

number_of_elements = 2
number_of_nodes = 9

# Assert the displacement in all nodes in all directions
expected_disp = [[0.0, -0.2, 0.0], [0.0527776, -0.2, 0.0], [0.0, -0.100033, 0.0], [0.0524025, -0.0996931, 0.0], [0.0, 0.0, 0.0], [0.105197, -0.2, 0.0], [0.105114, -0.100049, 0.0], [0.0524406, 0.0, 0.0], [0.104632, 0.0, 0.0]]
for node in range(number_of_nodes):
node_displacement = reader.nodal_values_at_time("DISPLACEMENT", 1, result, [node+1])[0]
for direction in range(3):
self.assertAlmostEqual(node_displacement[direction], expected_disp[node][direction], 4)

# Assert the normal stress for both elements in the first integration point
expected_stress = [[-99.9808, -252.622, -99.9806, 0.193199, 0.0, 0.0], [-99.9991, -252.668, -99.9991, 0.00846584, 0, 0]]
for element in range(number_of_elements):
stress = reader.element_integration_point_values_at_time("CAUCHY_STRESS_TENSOR", 1, result, [element+1], [0])[0]
for stress_vector in stress:
self.assertAlmostEqual(expected_stress[element][0], stress_vector[0], 4) # sigma_xx
self.assertAlmostEqual(expected_stress[element][1], stress_vector[1], 4) # sigma_yy
self.assertAlmostEqual(expected_stress[element][2], stress_vector[2], 4) # sigma_zz

# Assert the engineering strain for both elements in the first integration point
expected_strain = [[0.104863, -0.19973, 0.104946, 0.000440186, 0.0, 0.0], [0.1055, -0.200303, 0.104922, 3.84218e-05, 0, 0]]
for element in range(number_of_elements):
strain = reader.element_integration_point_values_at_time("ENGINEERING_STRAIN_TENSOR", 1, result, [element+1], [0])[0]
for strain_component in strain:
self.assertAlmostEqual(expected_strain[element][0], strain_component[0], 4) # eps_xx
self.assertAlmostEqual(expected_strain[element][1], strain_component[1], 4) # eps_yy
self.assertAlmostEqual(expected_strain[element][2], strain_component[2], 4) # eps_zz

def test_triaxial_comp_6n(self):
"""
Drained compression triaxial test on Mohr-Coulomb model with axisymmetric 2D6N elements
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"properties": [
{
"model_part_name": "PorousDomain.Soil",
"properties_id": 1,
"Material": {
"constitutive_law": {
"name": "GeoMohrCoulombWithTensionCutOff2D"
},
"Variables": {
"IGNORE_UNDRAINED": true,
"DENSITY_SOLID": 2.65,
"DENSITY_WATER": 1.0,
"POROSITY": 0.3,
"BULK_MODULUS_SOLID": 1.0e+09,
"BULK_MODULUS_FLUID": 2.0e-30,
"PERMEABILITY_XX": 4.5e-30,
"PERMEABILITY_YY": 4.5e-30,
"PERMEABILITY_XY": 0.0,
"DYNAMIC_VISCOSITY": 8.9e-07,
"BIOT_COEFFICIENT": 1.0,
"RETENTION_LAW": "SaturatedLaw",
"SATURATED_SATURATION": 0.0,
"YOUNG_MODULUS": 2.0e+04,
"POISSON_RATIO": 0.25,
"GEO_COHESION": 2.0,
"GEO_FRICTION_ANGLE": 25.0,
"GEO_TENSILE_STRENGTH": 0.0,
"GEO_DILATANCY_ANGLE": 2.0
}
}
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
{
"problem_data": {
"problem_name": "triaxial",
"parallel_type": "OpenMP",
"echo_level": 1,
"start_time": -1.0e-02,
"end_time": 1.0
},
"solver_settings": {
"time_stepping": {
"time_step": 1.0e-02,
"max_delta_time_factor": 1.0
},
"solver_type": "U_Pw",
"solution_type": "Quasi-Static",
"strategy_type": "line_search",
"scheme_type": "Backward_Euler",
"model_part_name": "PorousDomain",
"domain_size": 2,
"echo_level": 1,
"model_import_settings": {
"input_type": "mdpa",
"input_filename": "mesh"
},
"material_import_settings": {
"materials_filename": "MaterialParameters.json"
},
"buffer_size": 2,
"clear_storage": false,
"compute_reactions": true,
"move_mesh_flag": false,
"reform_dofs_at_each_step": false,
"block_builder": true,
"reset_displacements": true,
"convergence_criterion": "residual_criterion",
"residual_relative_tolerance": 1.0e-03,
"residual_absolute_tolerance": 1.0e-09,
"min_iterations": 6,
"max_iterations": 50,
"number_cycles": 1,
"reduction_factor": 0.5,
"increase_factor": 2.0,
"desired_iterations": 4,
"calculate_reactions": true,
"max_line_search_iterations": 5,
"first_alpha_value": 0.5,
"second_alpha_value": 1.0,
"min_alpha": 0.1,
"max_alpha": 2.0,
"line_search_tolerance": 0.5,
"rotation_dofs": false,
"problem_domain_sub_model_part_list": ["Soil"],
"processes_sub_model_part_list": [
"Fixed_base",
"Fixed_side",
"Lateral_load",
"Top_displacement",
"Soil"
],
"body_domain_sub_model_part_list": ["Soil"],
"linear_solver_settings": {
"solver_type": "LinearSolversApplication.sparse_lu",
"scaling": true
}
},
"processes": {
"constraints_process_list": [
{
"python_module": "apply_vector_constraint_table_process",
"kratos_module": "KratosMultiphysics.GeoMechanicsApplication",
"process_name": "ApplyVectorConstraintTableProcess",
"Parameters": {
"model_part_name": "PorousDomain.Fixed_base",
"variable_name": "DISPLACEMENT",
"active": [false, true, false],
"is_fixed": [false, true, false],
"value": [0.0, 0.0, 0.0],
"table": [0, 0, 0]
}
},
{
"python_module": "apply_vector_constraint_table_process",
"kratos_module": "KratosMultiphysics.GeoMechanicsApplication",
"process_name": "ApplyVectorConstraintTableProcess",
"Parameters": {
"model_part_name": "PorousDomain.Fixed_side",
"variable_name": "DISPLACEMENT",
"active": [true, false, false],
"is_fixed": [true, false, false],
"value": [0.0, 0.0, 0.0],
"table": [0, 0, 0]
}
},
{
"python_module": "apply_scalar_constraint_table_process",
"kratos_module": "KratosMultiphysics.GeoMechanicsApplication",
"process_name": "ApplyScalarConstraintTableProcess",
"Parameters": {
"model_part_name": "PorousDomain.Soil",
"variable_name": "WATER_PRESSURE",
"is_fixed": true,
"fluid_pressure_type": "Uniform",
"value": 0.0,
"table": 0
}
}
],
"loads_process_list": [
{
"python_module": "apply_normal_load_table_process",
"kratos_module": "KratosMultiphysics.GeoMechanicsApplication",
"process_name": "apply_normal_load_table_process",
"Parameters": {
"model_part_name": "PorousDomain.Lateral_load",
"variable_name": "NORMAL_CONTACT_STRESS",
"active": [true, false],
"value": [0.0, 0.0],
"fluid_pressure_type": "Uniform",
"table": [1, 0]
}
},
{
"python_module": "apply_vector_constraint_table_process",
"kratos_module": "KratosMultiphysics.GeoMechanicsApplication",
"process_name": "ApplyVectorConstraintTableProcess",
"Parameters": {
"model_part_name": "PorousDomain.Top_displacement",
"variable_name": "DISPLACEMENT",
"active": [false, true, false],
"is_fixed": [false, true, false],
"value": [0.0, 0.0, 0.0],
"table": [0, 2, 0]
}
},
{
"python_module": "apply_initial_uniform_stress_field",
"kratos_module": "KratosMultiphysics.GeoMechanicsApplication",
"process_name": "ApplyInitialUniformStressField",
"Parameters": {
"model_part_name": "PorousDomain.Soil",
"value": [-100.0, -100.0, -100.0, 0.0]
}
}
]
},
"output_processes": {
"gid_output": [
{
"python_module": "gid_output_process",
"kratos_module": "KratosMultiphysics",
"process_name": "GiDOutputProcess",
"Parameters": {
"model_part_name": "PorousDomain.porous_computational_model_part",
"postprocess_parameters": {
"result_file_configuration": {
"gidpost_flags": {
"GiDPostMode": "GiD_PostAscii",
"WriteDeformedMeshFlag": "WriteDeformed",
"WriteConditionsFlag": "WriteElementsOnly",
"MultiFileFlag": "SingleFile"
},
"file_label": "step",
"output_control_type": "step",
"output_interval": 1,
"body_output": true,
"node_output": false,
"skin_output": false,
"nodal_results": ["DISPLACEMENT"],
"gauss_point_results": [
"CAUCHY_STRESS_TENSOR",
"ENGINEERING_STRAIN_TENSOR"
]
}
},
"output_name": "triaxial_test_output"
}
}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Triaxial test (simple, single stage)

This test is a triaxial test with a prescribed displacement on a Mohr-Coulomb model. It mimics a lab test, where soil properties such as the cohesion ($c$) and the friction angle ($ϕ$) are determined.
In the lab this is performed on a cylindric volume of soil, where an increasing pressure is applied on the top of the cylinder. In the model test, the cylinder is emulated by two 2 axisymmetric elements that are symmetric around the left side.

A schematic overview of the model is displayed in the figure below:

![MeshStructure](schematic.svg)

## Setup

The test is performed with the following conditions:

- Constraints:
- The displacement in the bottom nodes (5, 8, 9) is fixed in the Y direction.
- The displacement in the symmetry axis (i.e. the left nodes 1, 3, 5) is fixed in the X direction.
- The displacement of the top nodes (1, 2, 6) is prescribed and moves linearly from y = 0 at t = 0 to y = -0.2 at t = 1.
- Material:
- The material is described by the Mohr-Coulomb model with the following parameters:
- Poisson ratio = 0.25,
- Young's modulus = 20000 $kN/m^2$,
- Cohesion = 2.0 $kN/m^2$,
- Friction angle = 25.0 $\degree$,
- Dilatancy angle = 2.0 $\degree$.
- Conditions:
- An initial uniform stress field (at t = 0) is applied with a value of -100 $kN/m^2$ in all directions.
- A lateral load is applied with a value of 100 $kN/m^2$ to the right side, mimicing the constant cell pressure.

## Assertions
For this regression test, the outcomes of the simulation for the displacement, the normal stresses and the engineering strain at t = 1 are asserted.
Loading
Loading