Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Geo/check number of tables phreatic multi line #12689

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

WPK4FEM
Copy link
Contributor

@WPK4FEM WPK4FEM commented Sep 20, 2024

📝 Description
To make sure that the number of tables matches the number of points of the multlinear phreatic line input a check has been added.

🆕 Changelog

  • Check added
  • Unit test added
  • Some scrambled and redundant project parameters syntax corrected.

@WPK4FEM WPK4FEM self-assigned this Sep 20, 2024
Copy link
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.

Nice catch and well tested and scoped fix! I have some questions left, mainly about the 'constant' version of the multiline process and the defaults.

Comment on lines +54 to +55
"x_coordinates": [0.0, 1.0],
"y_coordinates": [1.0, 0.5],
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems quite random that the defaults have non-zero values here, but that might be a larger discussion

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The points are chosen such that over a small domain they form a possible phreatic surface. ( if the gravity direction is in the xy plane )

@@ -129,14 +129,15 @@ KRATOS_TEST_CASE_IN_SUITE(ApplyConstantPhreaticMultiLinePressureProcessDoesNotTh
"y_coordinates": [0.0, 1.0],
"z_coordinates": [0.0, 0.0],
"gravity_direction": 1,
"out_of_plane_direction": 2
"out_of_plane_direction": 2,
"table": [0, 0]
Copy link
Contributor

Choose a reason for hiding this comment

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

I would expect the 'constant' process doesn't need a table here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed, reverted the wrong addition.

"specific_weight" : 10000.0,
"pressure_tension_cut_off" : 0.0,
"table" : [0,1]
"table" : [0, 0]
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be possible to have this default only in the table version of this process?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Lets look at that together.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Tried together, but without succes. The constructor of the "constant" process fails when it has no table in its defaults.

Comment on lines 22 to 42
KRATOS_TEST_CASE_IN_SUITE(ApplyPhreaticMultiLinePressureTableProcessThrowsWhenTableLengthDoesNotMatchCoordinates,
KratosGeoMechanicsFastSuiteWithoutKernel)
{
auto model = Model{};
auto& r_model_part = model.CreateModelPart("foo");
auto test_parameters = Parameters{R"(
{
"model_part_name": "foo",
"variable_name": "WATER_PRESSURE",
"x_coordinates": [0.0, 1.0],
"y_coordinates": [0.0, 1.0],
"z_coordinates": [0.0, 0.0],
"gravity_direction": 1,
"out_of_plane_direction": 2,
"table": [1, 2, 3, 4]
} )"};

KRATOS_EXPECT_EXCEPTION_IS_THROWN(
(ApplyPhreaticMultiLinePressureTableProcess{r_model_part, test_parameters}),
"Got 2 coordinates and 4 table references. The number of coordinates and table references should be equal.")
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's also add a test which doesn't throw here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a test that does not throw

} )"};

KRATOS_EXPECT_TRUE(CanCreateInstanceOfApplyConstantPhreaticMultiLinePressureProcessWithoutFailure(
r_model_part, test_parameters))

test_parameters.RemoveValue("x_coordinates");
test_parameters.AddVector("x_coordinates", ScalarVector{5, 1.0});
test_parameters.AddVector("x_coordinates", ScalarVector{2, 1.0});
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this mean that if we create a 'constant' multiline process, with e.g. 2 tables in the parameters, we cannot have 5 x_coordinates (while the tables aren't used)? Please correct me if I'm wrong

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There should be as many entries in the table list as there are points. However a entry in the table list may be 0 to indicate a constant value.

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.

2 participants