[GeoMechanicsApplication] Integrate the functionality for UPw interfaces#14266
[GeoMechanicsApplication] Integrate the functionality for UPw interfaces#14266markelov208 wants to merge 20 commits intomasterfrom
Conversation
Hi @markelov208, Yes I think that that is acceptable. Its what the water part of the U-Pw interface element needs. |
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. |
| "MINIMUM_RELATIVE_PERMEABILITY" : 0.0001, | ||
| "TRANSVERSAL_PERMEABILITY" : 5.0e-4, | ||
| "DYNAMIC_VISCOSITY" : 1.0e-3 |
There was a problem hiding this comment.
As mentioned in the other comment, I think this would also work:
| "MINIMUM_RELATIVE_PERMEABILITY" : 0.0001, | |
| "TRANSVERSAL_PERMEABILITY" : 5.0e-4, | |
| "DYNAMIC_VISCOSITY" : 1.0e-3 | |
| "IGNORE_UNDRAINED" : true, |
There was a problem hiding this comment.
Because in that case, the contributions for permeability would be ignored by the interface element
There was a problem hiding this comment.
Thank you for the suggestion! It works.
rfaasse
left a comment
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
What is the reason we use an assertGreater instead of assertAlmostEqual here?
There was a problem hiding this comment.
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.
| 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`. |
There was a problem hiding this comment.
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)?
There was a problem hiding this comment.
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.
| Begin Table 1 X LINE_LOAD_Y | ||
| 0.0000000000 -2000000.0000000000 | ||
| 1.0000000000 -2000000.0000000000 | ||
| End Table |
There was a problem hiding this comment.
I might be mistaken, but I don't see where this table is used in the parameters
There was a problem hiding this comment.
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. | ||
|
|
||
|  |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
I think Wijtze Pieter already mentioned this, but the FluidBodyFlow is still missing here.
There was a problem hiding this comment.
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.
| "TRANSVERSAL_PERMEABILITY" : 5.0e-4, | ||
| "DYNAMIC_VISCOSITY" : 1.0e-3 |
There was a problem hiding this comment.
Next to these two parameters, I think we also need info on the retention law, for example:
| "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
There was a problem hiding this comment.
adding these parameters affects the solutions. I think by default all tests use SaturatedLaw retention law.
| Begin Table 2 TIME WATER_PRESSURE | ||
| 0.0000000000 0.0000000000 | ||
| 1.0000000000 1000.0000000000 | ||
| End Table |
There was a problem hiding this comment.
Since the water pressure is time dependent, does it make sense to add asserts for more time steps than just the latest ones?
There was a problem hiding this comment.
Correct, now tests check parameters for all times steps.
| "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, |
There was a problem hiding this comment.
I don't think these params are needed, since we don't use line search
| "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, |
| "kratos_module": "KratosMultiphysics.GeoMechanicsApplication", | ||
| "process_name": "ApplyK0ProcedureProcess", | ||
| "Parameters": { | ||
| "model_part_name": "PorousDomain.settlement_computational_model_part" |
There was a problem hiding this comment.
Just to validate my understanding, this means it's the intention that K0 is done for the interfaces as well, right?
There was a problem hiding this comment.
removed. Initially, the test was falling with Soil. Tried to find the reason.
|
|
||
| Begin SubModelPart Top | ||
| Begin SubModelPartTables | ||
| 1 |
There was a problem hiding this comment.
Is the line load actually used? I don't see it in the project params, but I might have missed it
markelov208
left a comment
There was a problem hiding this comment.
Hi Richard, many thanks for the review. It helped me to improve these tests and to learn better integration tests in general.
| Begin Table 1 X LINE_LOAD_Y | ||
| 0.0000000000 -2000000.0000000000 | ||
| 1.0000000000 -2000000.0000000000 | ||
| End Table |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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. | ||
|
|
||
|  |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
removed. Initially, the test was falling with Soil. Tried to find the reason.
| 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")) |
There was a problem hiding this comment.
Yes, these tests just run. Now removed them because these computations are also done in other tests.
| if pair not in seen_pairs: | ||
| seen_pairs.add(pair) | ||
| node_id_pairs.append(pair) | ||
|
|
||
| return node_id_pairs |
There was a problem hiding this comment.
a vertical interface consists of two elements and repeated pairs of nodes exist.
| ) | ||
| ) | ||
|
|
||
| interface_nodes = self._read_mdpa_nodes(interface_mdpa_file_path) |
There was a problem hiding this comment.
corrected as well nodes_of_soil_model
| Begin Table 2 TIME WATER_PRESSURE | ||
| 0.0000000000 0.0000000000 | ||
| 1.0000000000 1000.0000000000 | ||
| End Table |
There was a problem hiding this comment.
Correct, now tests check parameters for all times steps.
📝 Description
A brief description of the PR.
Created integration tests that perform computations for:
The obtained solutions (displacement and pressure values) are compared with solutions obtained for
Tests are Quasi-static and displacement, pressure and fluid flux are compared for all time steps.
Added
PUCoupling,PermeabilityandFluidBodyFlowtoUPwInterfaceElementContributions.This requires allows to get proper values of pressure and fluid fluxes for these tests but it breaks two tests:
They have been fixed by adding
"IGNORE_UNDRAINED" : truefor interface material properties.A hydraulic discharge flow field is disconnected at the horizontal interface because
UPwInterfaceElementdoes not calculate the discharge now. Therefore a new issue [GeoMechanicsApplication] Add hydraulic discharge calculation in UPw interface element is created.Fixed error with
fluid_fluxcalculation inSmallStrainUPwDiffOrderElement::CalculateOnIntegrationPoints.A unit test is added.