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

[GeoMechanicsApplication] Implement well constitutive behaviour for line thermal element #12370

Merged
merged 24 commits into from
May 17, 2024

Conversation

mnabideltares
Copy link
Contributor

📝 Description
To enhance our computational model for simulating high capacity heat storage systems, we need to implement a thermal "wel/filter" element on top of the existing thermal line element. The thermal filter element will enable us to model the behavior of heat storage under the ground, accounting for their heat exchange processes. This addition is crucial for achieving realistic simulations of heat storage systems and optimizing their performance.

🆕 Changelog

  • Added constutative model for the filter element
  • Added test cases

Copy link
Contributor

@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 Mohamed, thank you for the new feature. Sorry I have a few comments and a general question why is it called 'ThermalFilter'?

Copy link
Contributor

@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 Mohamed, concerning the Filter, let's keep it until @WPK4FEM has a better suggestion.

Copy link
Contributor

@WPK4FEM WPK4FEM left a comment

Choose a reason for hiding this comment

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

Hi Mohammed,
I have some trouble understanding the test. A Dirichlet condition at the same place will dictate the solution, and as such prevent testing of the constitutive behaviour in the line thermal element.

Also the constitutive law only looks at the conductivity of water, If that is all that is used, much of the given input for the filter element can be removed.

Regards, Wijtze Pieter

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.

Clear PR and nice integration test cases with clear documentation. I think it would be nice to add unit tests for the new class as well. Since it seems not a lot of setup is necessary, this should be doable. Other than that, I only have a few very minor remarks,

@mnabideltares mnabideltares requested a review from rfaasse May 13, 2024 14:07
rfaasse
rfaasse previously approved these changes May 14, 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.

No blocking comments from my side, thanks for making the improvements and adding the tests! I have a few suggestions you may or may not want to take up.

Comment on lines 43 to 49
KRATOS_TEST_CASE_IN_SUITE(GetWorkingSpaceDimension_ReturnsFilterDimensionValue, KratosGeoMechanicsFastSuite)
{
constexpr SizeType dimension = 1;
GeoThermalDispersionLaw geo_thermal_filter_law(dimension);

KRATOS_EXPECT_EQ(geo_thermal_filter_law.WorkingSpaceDimension(), dimension);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

We could add a simple test to check that the construction throws when the dimension is wrong by using KRATOS_EXPECT_EXCEPTION_IS_THROWN, see e.g.

KRATOS_TEST_CASE_IN_SUITE(TestVariablesUtilitiesThrowsWhenComponentDoesNotExist, KratosGeoMechanicsFastSuite)
{
KRATOS_EXPECT_EXCEPTION_IS_THROWN(
VariablesUtilities::GetComponentFromVectorVariable(ACCELERATION.Name(), "?"),
"Error: The component \"ACCELERATION_?\" is not registered!")
}

I don't consider this blocking, but it might be a nice test to add.

… and Filter laws changed inheritance to GeoThermalLaw

Test cases are modified, as the constutative law for heat is removed, and replaced by thermal law
@mnabideltares mnabideltares requested a review from rfaasse May 15, 2024 19:00
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.

Thank you for your hard work on this Mohamed! It's great to see we can read it from json in this way.

I have a few minor comments left, but nothing blocking. However, since I was quite involved in some of the ideas, I will not approve the PR and prefer for someone else to do this in the end (since I'm of course a bit biased).

Copy link
Contributor

@avdg81 avdg81 left a comment

Choose a reason for hiding this comment

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

This is a very nice extension to the work that you have done for geothermal analysis. Although the basis of your extension is good, I still have a few suggestions that would make the extension even simpler and cleaner. Hope you find my feedback useful.

@@ -25,7 +22,8 @@
"ALPHA_COEFFICIENT" : 1.900000e-01,
"QF_COEFFICIENT" : 0.000000e+00,
"SMIN_COEFFICIENT" : 0.000000e+00,
"SMAX_COEFFICIENT" : 4.800000e-04
"SMAX_COEFFICIENT" : 4.800000e-04,
"THERMAL_LAW" : "GeoThermalDispersionLaw"
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this input parameter determines which other parameters are needed, I would put this as the very first one in the list.

@mnabideltares mnabideltares requested review from avdg81 May 16, 2024 15:13
avdg81
avdg81 previously approved these changes May 17, 2024
Copy link
Contributor

@avdg81 avdg81 left a comment

Choose a reason for hiding this comment

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

After your latest changes I'm very satisfied about this PR. Note that I have only a few minor remarks left. Please, also have a look at the code smells reported by SonarQube (there are 3 left, which are quite easy to fix). Thank you.

P.S.: You may want to wait with merging until @WPK4FEM has had another look.

Comment on lines 31 to 33
void save(Serializer&) const override {}

void load(Serializer&) override {}
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add comments to these function bodies which explain why they are empty. For instance, "Nothing to serialize, since there are no data members, and its base class is abstract". This will resolve two code smells found by SonarQube.

**Source files:** [Thermal filter element with fixed temperature](https://github.com/KratosMultiphysics/Kratos/tree/master/applications/GeoMechanicsApplication/tests/test_thermal_element/test_thermal_filter_element)

## Case Specification
In this thermal test case, a $2 \mathrm{[m]} \times 1 \mathrm{[m]}$ soil block is considered, with everywhere set to 0 $\mathrm{[^\circ C]}$. A well/filter passes vertically through middle of the domain. Heat fluxes are set at the top and bottom of the filter, with values of 100 $\mathrm{[W/m^2]}$. Dirichlet boundary donditions of temperature are set at the left and right of the soil domain, both with a value of 0 $\mathrm{[^\circ C]}$. The simulation spans 100 days to allow for a transition from the initial to a linear temperature profile. This test is conducted for various configurations, including 2D3N and 2D6N soil elements (with corresponding 2D2N and 2D3N filter elements). The temperature distribution is then evaluated with its own results. The boundary conditions are shown below:
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo: "donditions" => "conditions"

Copy link
Contributor

Choose a reason for hiding this comment

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

Like m and \circ C, days indicates a unit and should have [ ].

@@ -17,7 +15,7 @@
"THERMAL_CONDUCTIVITY_SOLID_XX" : 1.50,
"THERMAL_CONDUCTIVITY_SOLID_YY" : 1.50,
"THERMAL_CONDUCTIVITY_SOLID_XY" : 0.0,
"THERMAL_CONDUCTIVITY_WATER" : 0.48
"THERMAL_CONDUCTIVITY_WATER" : 0.48
Copy link
Contributor

Choose a reason for hiding this comment

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

This trailing spaces were probably inserted accidentally.

WPK4FEM
WPK4FEM previously approved these changes May 17, 2024
Copy link
Contributor

@WPK4FEM WPK4FEM left a comment

Choose a reason for hiding this comment

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

Thank you for the tedious work, this looks good.

**Source files:** [Thermal filter element with fixed temperature](https://github.com/KratosMultiphysics/Kratos/tree/master/applications/GeoMechanicsApplication/tests/test_thermal_element/test_thermal_filter_element)

## Case Specification
In this thermal test case, a $2 \mathrm{[m]} \times 1 \mathrm{[m]}$ soil block is considered, with everywhere set to 0 $\mathrm{[^\circ C]}$. A well/filter passes vertically through middle of the domain. Heat fluxes are set at the top and bottom of the filter, with values of 100 $\mathrm{[W/m^2]}$. Dirichlet boundary donditions of temperature are set at the left and right of the soil domain, both with a value of 0 $\mathrm{[^\circ C]}$. The simulation spans 100 days to allow for a transition from the initial to a linear temperature profile. This test is conducted for various configurations, including 2D3N and 2D6N soil elements (with corresponding 2D2N and 2D3N filter elements). The temperature distribution is then evaluated with its own results. The boundary conditions are shown below:
Copy link
Contributor

Choose a reason for hiding this comment

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

Like m and \circ C, days indicates a unit and should have [ ].

@mnabideltares mnabideltares dismissed stale reviews from WPK4FEM and avdg81 via 0a76620 May 17, 2024 10:27
Copy link
Contributor

@avdg81 avdg81 left a comment

Choose a reason for hiding this comment

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

I believe this is good to go. Thanks for the work done Mohamed!

@mnabideltares mnabideltares merged commit ecd736a into master May 17, 2024
11 checks passed
@mnabideltares mnabideltares deleted the geo/12322-implement-well-element branch May 17, 2024 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

[GeoMechanicsApplication] Implement well constitutive behaviour for line thermal element
5 participants