Skip to content

[GeoMechanicsApplication] Integrate the functionality for UPw interfaces#14266

Open
markelov208 wants to merge 20 commits intomasterfrom
geo/14042-integration-tests-for-UPw-interface
Open

[GeoMechanicsApplication] Integrate the functionality for UPw interfaces#14266
markelov208 wants to merge 20 commits intomasterfrom
geo/14042-integration-tests-for-UPw-interface

Conversation

@markelov208
Copy link
Copy Markdown
Contributor

@markelov208 markelov208 commented Mar 9, 2026

📝 Description
A brief description of the PR.

Created integration tests that perform computations for:

  • column with a horizontal_interface
  • column with a vertical_interface
  • column with a horizontal_interface using diff_order_elements

The obtained solutions (displacement and pressure values) are compared with solutions obtained for

  • column
  • column using diff order elements.

Tests are Quasi-static and displacement, pressure and fluid flux are compared for all time steps.

Added PUCoupling , Permeability and FluidBodyFlow to UPwInterfaceElementContributions .

This requires allows to get proper values of pressure and fluid fluxes for these tests but it breaks two tests:

  • building_pit
  • test_interface_prestress
    They have been fixed by adding "IGNORE_UNDRAINED" : true for interface material properties.

A hydraulic discharge flow field is disconnected at the horizontal interface because UPwInterfaceElement does not calculate the discharge now. Therefore a new issue [GeoMechanicsApplication] Add hydraulic discharge calculation in UPw interface element is created.

Fixed error with fluid_flux calculation in SmallStrainUPwDiffOrderElement::CalculateOnIntegrationPoints. A unit test is added.

@markelov208 markelov208 self-assigned this Mar 9, 2026
@markelov208 markelov208 requested a review from a team as a code owner March 9, 2026 14:06
@markelov208
Copy link
Copy Markdown
Contributor Author

Hi @WPK4FEM , @rfaasse and @avdg81 , I've added Permeability to UPwInterfaceElementContributions then building_pit and test_interface_presstress failed. Adding TRANSVERSAL_PERMEABILITY and DYNAMIC_VISCOSITY to MaterialParameters solves them. Is it acceptable?

@WPK4FEM
Copy link
Copy Markdown
Contributor

WPK4FEM commented Mar 10, 2026

Hi @WPK4FEM , @rfaasse and @avdg81 , I've added Permeability to UPwInterfaceElementContributions then building_pit and test_interface_presstress failed. Adding TRANSVERSAL_PERMEABILITY and DYNAMIC_VISCOSITY to MaterialParameters solves them. Is it acceptable?

Hi @markelov208, Yes I think that that is acceptable. Its what the water part of the U-Pw interface element needs.

@rfaasse
Copy link
Copy Markdown
Contributor

rfaasse commented Mar 10, 2026

Hi @WPK4FEM , @rfaasse and @avdg81 , I've added Permeability to UPwInterfaceElementContributions then building_pit and test_interface_presstress failed. Adding TRANSVERSAL_PERMEABILITY and DYNAMIC_VISCOSITY to MaterialParameters solves them. Is it acceptable?

In principle no problem for me. However, since we use IGNORE_UNDRAINED in most of the model, I would not expect this to be necessary. I think if you'd add IGNORE_UNDRAINED: true to the material parameters of the interface (instead of the transversal permeability and dynamic viscosity), it'll also work (and that might be a bit more intuitive, since the rest of the materials also have IGNORE_UNDRAINED set to true.

Comment on lines +190 to +192
"MINIMUM_RELATIVE_PERMEABILITY" : 0.0001,
"TRANSVERSAL_PERMEABILITY" : 5.0e-4,
"DYNAMIC_VISCOSITY" : 1.0e-3
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.

As mentioned in the other comment, I think this would also work:

Suggested change
"MINIMUM_RELATIVE_PERMEABILITY" : 0.0001,
"TRANSVERSAL_PERMEABILITY" : 5.0e-4,
"DYNAMIC_VISCOSITY" : 1.0e-3
"IGNORE_UNDRAINED" : true,

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.

Because in that case, the contributions for permeability would be ignored by the interface element

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thank you for the suggestion! It works.

Copy link
Copy Markdown
Contributor

@rfaasse rfaasse left a comment

Choose a reason for hiding this comment

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

Hi Gennady, thank you for adding the integration tests for the interface! As mentioned the PR will likely change due to the fluid body flow etc, but these are my intermediate comments!

"WATER_PRESSURE", no_pressure_time, no_pressure_output, [5]
)[0]

self.assertGreater(baseline_top_pressure - no_pressure_top_pressure, 900.0)
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.

What is the reason we use an assertGreater instead of assertAlmostEqual here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The test has been generated by AI and I kept it just in case. Right now I removed it because it checks the imposed pressure. It should be somewhere for the tables/boundaries.

Comment on lines +72 to +76
Displacement and water pressure values obtained with and without the interface are compared for all nodes. The following pairs are used:

- `column_horizontal_interface` and `column`,
- `column_vertical_interface` and `column`,
- `column_horizontal_interface_diff_order_elements` and `column_diff_order_elements`.
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.

If I understand correctly, this means we check that adding the interface does not have an effect on the results. That probably means we have high stiffnesses, such that the interfaces stay closed (correct me if I'm wrong).

I'm not sure, just asking, but would there be a benefit in having at least 1 test which does have an open interface (i.e. would it increase the covered paths within the element)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

You are right these tests show that the solution is the same with/without an interface and the interface stays rather thin. If stiffness values are lower then the interface gets thicker and a solution changes. It is not clear what to check in this case.

Comment on lines +63 to +66
Begin Table 1 X LINE_LOAD_Y
0.0000000000 -2000000.0000000000
1.0000000000 -2000000.0000000000
End Table
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.

I might be mistaken, but I don't see where this table is used in the parameters

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Correct, one of many attempts to affect a solution. Removed.


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.

![Setup](setup.svg)
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.

In the picture, it seems there is a line load at the top of the model. However, I don't see any line loads in the project params (only gravity loading). Is the picture correct?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The picture is corrected. Now there is a single arrow with P.


static const auto UPwInterfaceElementContributions =
std::vector{CalculationContribution::Stiffness, CalculationContribution::UPCoupling};
std::vector{CalculationContribution::Stiffness, CalculationContribution::UPCoupling,
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.

I think Wijtze Pieter already mentioned this, but the FluidBodyFlow is still missing here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, FluidBodyFlow is added now and permeability and pressure acting on the top have been increased to have non-zero fluxes. the python script compares fluxes now.

Comment on lines +37 to +38
"TRANSVERSAL_PERMEABILITY" : 5.0e-4,
"DYNAMIC_VISCOSITY" : 1.0e-3
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.

Next to these two parameters, I think we also need info on the retention law, for example:

Suggested change
"TRANSVERSAL_PERMEABILITY" : 5.0e-4,
"DYNAMIC_VISCOSITY" : 1.0e-3
"TRANSVERSAL_PERMEABILITY" : 5.0e-4,
"DYNAMIC_VISCOSITY" : 1.0e-3
"RETENTION_LAW" : "SaturatedBelowPhreaticLevelLaw",
"SATURATED_SATURATION" : 1.0,
"RESIDUAL_SATURATION" : 1e-10,
"MINIMUM_RELATIVE_PERMEABILITY" : 0.0001,

See for example the building pit model: https://github.com/KratosMultiphysics/Kratos/blob/master/applications/GeoMechanicsApplication/tests/building_pit/linear_elastic/MaterialParameters.json#L268-L277

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

adding these parameters affects the solutions. I think by default all tests use SaturatedLaw retention law.

Comment on lines +97 to +100
Begin Table 2 TIME WATER_PRESSURE
0.0000000000 0.0000000000
1.0000000000 1000.0000000000
End Table
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.

Since the water pressure is time dependent, does it make sense to add asserts for more time steps than just the latest ones?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Correct, now tests check parameters for all times steps.

Comment on lines +42 to +47
"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,
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.

I don't think these params are needed, since we don't use line search

Suggested change
"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,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

removed

"kratos_module": "KratosMultiphysics.GeoMechanicsApplication",
"process_name": "ApplyK0ProcedureProcess",
"Parameters": {
"model_part_name": "PorousDomain.settlement_computational_model_part"
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.

Just to validate my understanding, this means it's the intention that K0 is done for the interfaces as well, right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

removed. Initially, the test was falling with Soil. Tried to find the reason.


Begin SubModelPart Top
Begin SubModelPartTables
1
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.

Is the line load actually used? I don't see it in the project params, but I might have missed it

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

no, removed

Copy link
Copy Markdown
Contributor Author

@markelov208 markelov208 left a comment

Choose a reason for hiding this comment

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

Hi Richard, many thanks for the review. It helped me to improve these tests and to learn better integration tests in general.

Comment on lines +63 to +66
Begin Table 1 X LINE_LOAD_Y
0.0000000000 -2000000.0000000000
1.0000000000 -2000000.0000000000
End Table
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Correct, one of many attempts to affect a solution. Removed.

"WATER_PRESSURE", no_pressure_time, no_pressure_output, [5]
)[0]

self.assertGreater(baseline_top_pressure - no_pressure_top_pressure, 900.0)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The test has been generated by AI and I kept it just in case. Right now I removed it because it checks the imposed pressure. It should be somewhere for the tables/boundaries.


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.

![Setup](setup.svg)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The picture is corrected. Now there is a single arrow with P.


static const auto UPwInterfaceElementContributions =
std::vector{CalculationContribution::Stiffness, CalculationContribution::UPCoupling};
std::vector{CalculationContribution::Stiffness, CalculationContribution::UPCoupling,
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, FluidBodyFlow is added now and permeability and pressure acting on the top have been increased to have non-zero fluxes. the python script compares fluxes now.

project_parameters_filenames = (
project_parameters_filenames or self.project_parameters_filenames
)
status = run_geo_settlement.run_stages(case_path, project_parameters_filenames)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Frankly speaking, I just grabbed something that I met first.

"kratos_module": "KratosMultiphysics.GeoMechanicsApplication",
"process_name": "ApplyK0ProcedureProcess",
"Parameters": {
"model_part_name": "PorousDomain.settlement_computational_model_part"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

removed. Initially, the test was falling with Soil. Tried to find the reason.

Comment on lines +329 to +346
def test_horizontal_interface(self):
file_path = test_helper.get_file_path(os.path.join("UPw_interface", "column"))
output_data = self._run_two_stage_soil_case(file_path)
self.assertTrue(output_data.get("results"))

def test_horizontal_interface_diff_order(self):
file_path = test_helper.get_file_path(
os.path.join("UPw_interface", "column_diff_order_elements")
)
output_data = self._run_two_stage_soil_case(file_path)
self.assertTrue(output_data.get("results"))

def test_vertical_interface(self):
file_path = test_helper.get_file_path(
os.path.join("UPw_interface", "column_vertical_interface")
)
output_data = self._run_two_stage_interface_case(file_path)
self.assertTrue(output_data.get("results"))
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, these tests just run. Now removed them because these computations are also done in other tests.

Comment on lines +179 to +183
if pair not in seen_pairs:
seen_pairs.add(pair)
node_id_pairs.append(pair)

return node_id_pairs
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

a vertical interface consists of two elements and repeated pairs of nodes exist.

)
)

interface_nodes = self._read_mdpa_nodes(interface_mdpa_file_path)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

corrected as well nodes_of_soil_model

Comment on lines +97 to +100
Begin Table 2 TIME WATER_PRESSURE
0.0000000000 0.0000000000
1.0000000000 1000.0000000000
End Table
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Correct, now tests check parameters for all times steps.

@markelov208 markelov208 requested a review from rfaasse March 13, 2026 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[GeoMechanicsApplication] Integrate the functionality for UPw interfaces

3 participants