-
Notifications
You must be signed in to change notification settings - Fork 248
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
Conversation
There was a problem hiding this 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'?
applications/GeoMechanicsApplication/custom_constitutive/thermal_filter_law.cpp
Outdated
Show resolved
Hide resolved
applications/GeoMechanicsApplication/custom_constitutive/thermal_filter_law.cpp
Outdated
Show resolved
Hide resolved
...ons/GeoMechanicsApplication/tests/test_thermal_element/test_thermal_filter_element/README.md
Outdated
Show resolved
Hide resolved
applications/GeoMechanicsApplication/tests/test_transient_thermal.py
Outdated
Show resolved
Hide resolved
applications/GeoMechanicsApplication/custom_constitutive/thermal_filter_law.h
Outdated
Show resolved
Hide resolved
applications/GeoMechanicsApplication/geo_mechanics_application.h
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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.
applications/GeoMechanicsApplication/custom_constitutive/thermal_filter_law.cpp
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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
applications/GeoMechanicsApplication/custom_constitutive/thermal_filter_law.cpp
Outdated
Show resolved
Hide resolved
applications/GeoMechanicsApplication/custom_constitutive/thermal_filter_law.cpp
Outdated
Show resolved
Hide resolved
applications/GeoMechanicsApplication/custom_constitutive/thermal_filter_law.h
Outdated
Show resolved
Hide resolved
applications/GeoMechanicsApplication/custom_constitutive/thermal_filter_law.h
Outdated
Show resolved
Hide resolved
...icsApplication/tests/test_thermal_element/documentation_data/test_thermal_filter_element.svg
Outdated
Show resolved
Hide resolved
...cation/tests/test_thermal_element/test_thermal_filter_element/Common/MaterialParameters.json
Show resolved
Hide resolved
...ons/GeoMechanicsApplication/tests/test_thermal_element/test_thermal_filter_element/README.md
Outdated
Show resolved
Hide resolved
...hermal_filter_element/test_thermal_filter_element_2D2N/test_thermal_filter_element_2D2N.mdpa
Outdated
Show resolved
Hide resolved
...hermal_filter_element/test_thermal_filter_element_2D3N/test_thermal_filter_element_2D3N.mdpa
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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,
applications/GeoMechanicsApplication/custom_constitutive/thermal_filter_law.cpp
Outdated
Show resolved
Hide resolved
...on/tests/test_thermal_element/documentation_data/test_thermal_filter_element_2D3N_result.png
Outdated
Show resolved
Hide resolved
applications/GeoMechanicsApplication/custom_constitutive/thermal_filter_law.cpp
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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.
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); | ||
} |
There was a problem hiding this comment.
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/applications/GeoMechanicsApplication/tests/cpp_tests/test_variables_utilities.cpp
Lines 26 to 31 in 1166a00
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.
applications/GeoMechanicsApplication/tests/cpp_tests/test_thermal_filter_law.cpp
Show resolved
Hide resolved
applications/GeoMechanicsApplication/tests/cpp_tests/test_thermal_filter_law.cpp
Outdated
Show resolved
Hide resolved
applications/GeoMechanicsApplication/geo_mechanics_application.h
Outdated
Show resolved
Hide resolved
… and Filter laws changed inheritance to GeoThermalLaw Test cases are modified, as the constutative law for heat is removed, and replaced by thermal law
There was a problem hiding this 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).
applications/GeoMechanicsApplication/custom_elements/transient_thermal_element.h
Outdated
Show resolved
Hide resolved
applications/GeoMechanicsApplication/custom_constitutive/thermal_law.h
Outdated
Show resolved
Hide resolved
applications/GeoMechanicsApplication/custom_constitutive/thermal_dispersion_law.h
Show resolved
Hide resolved
There was a problem hiding this 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.
applications/GeoMechanicsApplication/custom_constitutive/thermal_dispersion_law.h
Outdated
Show resolved
Hide resolved
applications/GeoMechanicsApplication/custom_constitutive/thermal_dispersion_law.h
Show resolved
Hide resolved
applications/GeoMechanicsApplication/custom_constitutive/thermal_law.h
Outdated
Show resolved
Hide resolved
applications/GeoMechanicsApplication/custom_constitutive/thermal_filter_law.h
Outdated
Show resolved
Hide resolved
applications/GeoMechanicsApplication/custom_constitutive/thermal_law.h
Outdated
Show resolved
Hide resolved
applications/GeoMechanicsApplication/tests/cpp_tests/test_thermal_filter_law.cpp
Outdated
Show resolved
Hide resolved
applications/GeoMechanicsApplication/tests/cpp_tests/test_thermal_filter_law.cpp
Outdated
Show resolved
Hide resolved
applications/GeoMechanicsApplication/tests/cpp_tests/test_thermal_filter_law.cpp
Outdated
Show resolved
Hide resolved
applications/GeoMechanicsApplication/tests/cpp_tests/test_thermal_filter_law.cpp
Outdated
Show resolved
Hide resolved
@@ -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" |
There was a problem hiding this comment.
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.
There was a problem hiding this 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.
void save(Serializer&) const override {} | ||
|
||
void load(Serializer&) override {} |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: "donditions" => "conditions"
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this 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: |
There was a problem hiding this comment.
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 [ ].
There was a problem hiding this 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!
📝 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