Skip to content

Commit 6a81a1f

Browse files
authored
[GeoMechanicsApplication] Integrate the functionality for UPw interfaces (#14266)
* added integration tests * formatted with black * use small letters for test_UPw_interface.py * renamed class calls * added extra Material parameters * removed code smells * added interface material parameters to building_pit * used IGNORE_UNDRAINED true * processed review comments * fixed error with fluid_flux and added unit test * fixed code smells * added IGNORE_UNDRAINED true * added checks * minor change * reverted checks * clang-format * reverted test_U_Pw_interface_element.cpp * processed 2 batch of the review comments * cleaned mdpa files * formatted project and material files * removed max_line_search_iterations etc * removed non-soil nodes from soil node list * removed empty Tables * moved filename patters to where they used * cleaned a bit test_upw_interface.py * inlined _top_vector_component_differences * corrected README.md
1 parent acd434d commit 6a81a1f

22 files changed

Lines changed: 2514 additions & 13 deletions

File tree

applications/GeoMechanicsApplication/custom_elements/small_strain_U_Pw_diff_order_element.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -636,9 +636,9 @@ void SmallStrainUPwDiffOrderElement::CalculateOnIntegrationPoints(const Variable
636636

637637
// Compute fluid flux vector q [L/T]
638638
rOutput[g_point].clear();
639-
const auto fluid_flux = PORE_PRESSURE_SIGN_FACTOR * Variables.DynamicViscosityInverse *
640-
relative_permeability *
641-
prod(Variables.IntrinsicPermeability, grad_pressure_term);
639+
const Vector fluid_flux = PORE_PRESSURE_SIGN_FACTOR *
640+
Variables.DynamicViscosityInverse * relative_permeability *
641+
prod(Variables.IntrinsicPermeability, grad_pressure_term);
642642
std::copy_n(fluid_flux.begin(), dimension, rOutput[g_point].begin());
643643
}
644644
}

applications/GeoMechanicsApplication/geo_mechanics_application.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,9 @@ namespace Kratos
130130
{
131131

132132
static const auto UPwInterfaceElementContributions =
133-
std::vector{CalculationContribution::Stiffness, CalculationContribution::UPCoupling};
133+
std::vector{CalculationContribution::Stiffness, CalculationContribution::UPCoupling,
134+
CalculationContribution::PUCoupling, CalculationContribution::Permeability,
135+
CalculationContribution::FluidBodyFlow};
134136

135137
///@name Kratos Globals
136138
///@{

applications/GeoMechanicsApplication/python_scripts/run_multiple_stages.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,24 @@
66
import KratosMultiphysics.GeoMechanicsApplication.context_managers as context_managers
77

88

9-
def run_stages(project_path, n_stages):
9+
def run_stages(
10+
project_path,
11+
n_stages,
12+
filename_pattern="ProjectParameters_stage{}.json",
13+
input_path=None,
14+
):
1015
"""
1116
Run all construction stages
1217
"""
1318
model = Kratos.Model()
14-
project_parameters_filenames = [f"ProjectParameters_stage{i + 1}.json" for i in range(n_stages)]
19+
20+
if input_path is None:
21+
input_path = project_path
22+
23+
project_parameters_filenames = [
24+
os.path.join(input_path, filename_pattern.format(i + 1))
25+
for i in range(n_stages)
26+
]
1527

1628
result = []
1729
with context_managers.set_cwd_to(project_path):
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# UPw_interface
2+
3+
This set contains compact 2D column benchmarks for validating line-interface behavior in the GeoMechanics `U_Pw` formulation.
4+
5+
The tests compare:
6+
- a continuous soil column (no explicit interface),
7+
- two stacked soil blocks connected by an explicit horizontal line interface, and
8+
- a continuous soil column that has a fixture to the left boundary via an interface.
9+
10+
Both same-order and diff-order element families are included. The figure below shows the column and constraints. The dashed line shows the position of the horizontal interface case.
11+
12+
![Setup](setup.svg)
13+
14+
## Cases
15+
16+
### Same-order element cases
17+
18+
- `column`
19+
- Soil elements: `UPwSmallStrainElement2D4N` (2 quadrilaterals)
20+
- No interface element
21+
22+
- `column_horizontal_interface`
23+
- Soil elements: `UPwSmallStrainElement2D4N` (2 quadrilaterals with duplicated nodes at the internal boundary)
24+
- Interface element: `Geo_ULineInterfacePlaneStrainElement2Plus2N` (a single line element based on the duplicated nodes)
25+
26+
- `column_vertical_interface`
27+
- Soil elements: `UPwSmallStrainElement2D4N` (2 quadrilaterals)
28+
- Interface elements: `Geo_ULineInterfacePlaneStrainElement2Plus2N` (2 line elements that connect left side nodes of the soil elements with the boundary nodes)
29+
30+
### Different-order element cases
31+
32+
- `column_diff_order_elements`
33+
- Soil elements: `SmallStrainUPwDiffOrderElement2D6N` (4 triangles with midside nodes)
34+
- No interface element
35+
36+
- `column_horizontal_interface_diff_order_elements`
37+
- Soil elements: `SmallStrainUPwDiffOrderElement2D6N` (4 triangles with duplicated nodes at the internal boundary)
38+
- Interface element: `Geo_UPwLineInterfacePlaneStrainDiffOrderElement3Plus3N` (a single line element)
39+
40+
## Geometry and boundary conditions
41+
42+
- Column size: $1 \times 2\ \mathrm{[m]}$
43+
- Bottom: fixed in both directions.
44+
- Left and right sides: fixed in the horizontal direction.
45+
- Stage 1: gravity loading + K0 initialization
46+
- Stage 2:
47+
- prescribed top vertical displacement (table to $-0.01\ \mathrm{[m]}$)
48+
- prescribed top water pressure table (which varies linearly in time from $0$ (at $`t = 0`$) to $1000\ \mathrm{[Pa]}$ (at $`t = 1`$))
49+
50+
## Material models
51+
52+
### Soil (`PorousDomain.Soil`)
53+
54+
- Constitutive law: `GeoLinearElasticPlaneStrain2DLaw`
55+
- $E = 1.0e9\ \mathrm{[Pa]}$,
56+
- $\nu = 0.2$
57+
- $\rho_s = 2000\ \mathrm{[kg/m^3]}$, $\rho_w = 1000\ \mathrm{[kg/m^3]}$
58+
- $n = 0.3$, $K_s = 1.0e12\ \mathrm{[Pa]}$, $K_w = 2.2e9\ \mathrm{[Pa]}$
59+
- $k_{xx}=k_{yy}=4.5e-10\ \mathrm{[m^2]}$,
60+
- $\mu=1.0e-3\ \mathrm{[Pa\cdot s]}$
61+
62+
### Interface (`PorousDomain.Interface`)
63+
64+
- Constitutive law: `GeoIncrementalLinearElasticInterfaceLaw`
65+
- $k_{\mathrm{n}} = 6.4e10\ \mathrm{[N/m^3]}$
66+
- $k_{\mathrm{t}} = 2.6000869565e10\ \mathrm{[N/m^3]}$
67+
- $k_{\perp} = 5.0e-4\ \mathrm{[m^2]}$
68+
- $\mu=1.0e-3\ \mathrm{[Pa\cdot s]}$
69+
70+
## Assertions
71+
72+
Displacement and water pressure values obtained with and without the interface are compared for all nodes. The following pairs are used:
73+
74+
- `column_horizontal_interface` and `column`,
75+
- `column_vertical_interface` and `column`,
76+
- `column_horizontal_interface_diff_order_elements` and `column_diff_order_elements`.
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
Begin Properties 1
2+
End Properties
3+
4+
Begin Nodes
5+
1 0.0 0.0 0.0
6+
2 1.0 0.0 0.0
7+
3 1.0 1.0 0.0
8+
4 0.0 1.0 0.0
9+
5 0.0 2.0 0.0
10+
6 1.0 2.0 0.0
11+
End Nodes
12+
13+
Begin Elements UPwSmallStrainElement2D4N
14+
1 1 1 2 3 4
15+
2 1 4 3 6 5
16+
End Elements
17+
18+
Begin SubModelPart Soil
19+
Begin SubModelPartNodes
20+
1
21+
2
22+
3
23+
4
24+
5
25+
6
26+
End SubModelPartNodes
27+
Begin SubModelPartElements
28+
1
29+
2
30+
End SubModelPartElements
31+
End SubModelPart
32+
33+
Begin SubModelPart Bottom
34+
Begin SubModelPartNodes
35+
1
36+
2
37+
End SubModelPartNodes
38+
End SubModelPart
39+
40+
Begin SubModelPart LeftSide
41+
Begin SubModelPartNodes
42+
1
43+
4
44+
5
45+
End SubModelPartNodes
46+
End SubModelPart
47+
48+
Begin SubModelPart RightSide
49+
Begin SubModelPartNodes
50+
2
51+
3
52+
6
53+
End SubModelPartNodes
54+
End SubModelPart
55+
56+
Begin Table 1 TIME WATER_PRESSURE
57+
0.0000000000 0.0000000000
58+
1.0000000000 10000.000000
59+
End Table
60+
61+
Begin SubModelPart Top
62+
Begin SubModelPartTables
63+
1
64+
End SubModelPartTables
65+
Begin SubModelPartNodes
66+
5
67+
6
68+
End SubModelPartNodes
69+
End SubModelPart
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
Begin Properties 1
2+
End Properties
3+
4+
Begin Nodes
5+
1 0.0 0.0 0.0
6+
2 1.0 0.0 0.0
7+
3 1.0 1.0 0.0
8+
4 0.0 1.0 0.0
9+
5 0.0 2.0 0.0
10+
6 1.0 2.0 0.0
11+
7 0.5 0.0 0.0
12+
8 1.0 0.5 0.0
13+
9 0.5 0.5 0.0
14+
10 0.5 1.0 0.0
15+
11 0.0 0.5 0.0
16+
12 1.0 1.5 0.0
17+
13 0.5 1.5 0.0
18+
14 0.5 2.0 0.0
19+
15 0.0 1.5 0.0
20+
End Nodes
21+
22+
Begin Elements SmallStrainUPwDiffOrderElement2D6N
23+
1 1 1 2 3 7 8 9
24+
2 1 1 3 4 9 10 11
25+
3 1 4 3 6 10 12 13
26+
4 1 4 6 5 13 14 15
27+
End Elements
28+
29+
Begin SubModelPart Soil
30+
Begin SubModelPartNodes
31+
1
32+
2
33+
3
34+
4
35+
5
36+
6
37+
7
38+
8
39+
9
40+
10
41+
11
42+
12
43+
13
44+
14
45+
15
46+
End SubModelPartNodes
47+
Begin SubModelPartElements
48+
1
49+
2
50+
3
51+
4
52+
End SubModelPartElements
53+
End SubModelPart
54+
55+
Begin SubModelPart Bottom
56+
Begin SubModelPartNodes
57+
1
58+
2
59+
7
60+
End SubModelPartNodes
61+
End SubModelPart
62+
63+
Begin SubModelPart LeftSide
64+
Begin SubModelPartNodes
65+
1
66+
4
67+
5
68+
11
69+
15
70+
End SubModelPartNodes
71+
End SubModelPart
72+
73+
Begin SubModelPart RightSide
74+
Begin SubModelPartNodes
75+
2
76+
3
77+
6
78+
8
79+
12
80+
End SubModelPartNodes
81+
End SubModelPart
82+
83+
Begin Table 1 TIME WATER_PRESSURE
84+
0.0000000000 0.0000000000
85+
1.0000000000 10000.000000
86+
End Table
87+
88+
Begin SubModelPart Top
89+
Begin SubModelPartTables
90+
1
91+
End SubModelPartTables
92+
Begin SubModelPartNodes
93+
5
94+
6
95+
14
96+
End SubModelPartNodes
97+
End SubModelPart
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
Begin Properties 1
2+
End Properties
3+
4+
Begin Properties 2
5+
End Properties
6+
7+
Begin Nodes
8+
1 0.0 0.0 0.0
9+
2 1.0 0.0 0.0
10+
3 1.0 1.0 0.0
11+
4 0.0 1.0 0.0
12+
5 0.0 2.0 0.0
13+
6 1.0 2.0 0.0
14+
7 1.0 1.0 0.0
15+
8 0.0 1.0 0.0
16+
End Nodes
17+
18+
Begin Elements UPwSmallStrainElement2D4N
19+
1 1 1 2 3 4
20+
2 1 8 7 6 5
21+
End Elements
22+
23+
Begin Elements Geo_ULineInterfacePlaneStrainElement2Plus2N
24+
3 2 4 3 8 7
25+
End Elements
26+
27+
Begin SubModelPart Soil
28+
Begin SubModelPartNodes
29+
1
30+
2
31+
3
32+
4
33+
5
34+
6
35+
7
36+
8
37+
End SubModelPartNodes
38+
Begin SubModelPartElements
39+
1
40+
2
41+
End SubModelPartElements
42+
End SubModelPart
43+
44+
Begin SubModelPart Interface
45+
Begin SubModelPartNodes
46+
3
47+
4
48+
7
49+
8
50+
End SubModelPartNodes
51+
Begin SubModelPartElements
52+
3
53+
End SubModelPartElements
54+
End SubModelPart
55+
56+
Begin SubModelPart Bottom
57+
Begin SubModelPartNodes
58+
1
59+
2
60+
End SubModelPartNodes
61+
End SubModelPart
62+
63+
Begin SubModelPart LeftSide
64+
Begin SubModelPartNodes
65+
1
66+
4
67+
5
68+
8
69+
End SubModelPartNodes
70+
End SubModelPart
71+
72+
Begin SubModelPart RightSide
73+
Begin SubModelPartNodes
74+
2
75+
3
76+
6
77+
7
78+
End SubModelPartNodes
79+
End SubModelPart
80+
81+
Begin Table 1 TIME WATER_PRESSURE
82+
0.0000000000 0.0000000000
83+
1.0000000000 10000.000000
84+
End Table
85+
86+
Begin SubModelPart Top
87+
Begin SubModelPartTables
88+
1
89+
End SubModelPartTables
90+
Begin SubModelPartNodes
91+
5
92+
6
93+
End SubModelPartNodes
94+
End SubModelPart

0 commit comments

Comments
 (0)