-
Notifications
You must be signed in to change notification settings - Fork 246
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/line piping output #12852
Geo/line piping output #12852
Conversation
…Multiphysics/Kratos into geo/line_piping_output_2D
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 @WPK4FEM , I like how you made this PR because it is very understandable. Just a few comments.
this->GetGeometry().IntegrationPointsNumber(this->GetIntegrationMethod()); | ||
rValues.resize(number_of_integration_points); | ||
auto dynamic_viscosity_inverse = 1.0 / this->GetProperties()[DYNAMIC_VISCOSITY]; | ||
auto constitutive_matrix = FillPermeabilityMatrix(this->GetValue(PIPE_HEIGHT)); |
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.
Is it better to name it as permeability_matrix
?
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.
done.
this->GetGeometry().IntegrationPoints(this->GetIntegrationMethod()); | ||
for (std::size_t i = 0; i < number_of_integration_points; ++i) { | ||
// this should be rotated to the direction of the element for the global fluid flux vector | ||
const auto head_gradient = CalculateHeadGradient(this->GetProperties(), this->GetGeometry()); |
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.
It looks like head_gradient
is calculated for the element. If this is correct, then it can be calculated together with longitudinal_flux
before the for loop.
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.
In the current situation and for the 2 noded element you are very correct here. I did it because on a 3 node ( maybe to be created in fulure ) element it would be varying over the element.
Changed to once per element.
if (rVariable == LOCAL_FLUID_FLUX_VECTOR) { | ||
rValues[i][0] = longitudinal_flux; | ||
rValues[i][1] = 0.0; | ||
rValues[i][2] = 0.0; | ||
} else { | ||
Matrix jacobian; | ||
this->GetGeometry().Jacobian(jacobian, r_integration_points[i]); | ||
const auto tangential_vector = | ||
GeoMechanicsMathUtilities::Normalized(Vector{column(jacobian, 0)}); | ||
rValues[i][0] = longitudinal_flux * tangential_vector[0]; | ||
rValues[i][1] = longitudinal_flux * tangential_vector[1]; | ||
rValues[i][2] = longitudinal_flux * tangential_vector[2]; | ||
} |
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.
Would it be clearer to have the for loop (or std::fill) inside if statements? If longitudinal_flux
is the same for all points, then values are a tangential vector multiplied by the flux. In case of LOCAL_FLUID_FUX_VECTOR, the tangentional_vector is (1,0,0)
@@ -241,7 +318,7 @@ class KRATOS_API(GEO_MECHANICS_APPLICATION) GeoSteadyStatePwPipingElement : publ | |||
return result; | |||
} | |||
|
|||
Matrix FillPermeabilityMatrix(double pipe_height) const | |||
static Matrix FillPermeabilityMatrix(double pipe_height) | |||
{ | |||
return ScalarMatrix{1, 1, std::pow(pipe_height, 3) / 12.0}; |
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.
Just for my knowledge, it should be power of 4 multiplied by a pipe factor, does it mean the factor is dimensional now? Thank you.
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.
Apparently yes, Jon and myself share your questioning.
CreateHorizontalUnitLengthGeoSteadyStatePwPipingElementWithPWDofs(r_model_part, p_properties); | ||
p_element->GetProperties().SetValue(DENSITY_WATER, 1.0E3); | ||
p_element->GetProperties().SetValue(DYNAMIC_VISCOSITY, 1.0E-2); | ||
p_element->GetProperties().SetValue(PIPE_HEIGHT, 1.0E-1); |
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.
Sorry I forgot the difference between GetProperties().SetValue(PIPE_HEIGHT) and SetValue(PIPE_HEIGHT). Should this line be removed?
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.
The first writes to the material properties, the last directly to the element. Only the last is used, so I removed the first. Good catch!
p_element->CalculateOnIntegrationPoints(LOCAL_FLUID_FLUX_VECTOR, fluid_fluxes, dummy_process_info); | ||
|
||
// Assert | ||
KRATOS_EXPECT_DOUBLE_EQ(fluid_fluxes[0](0), 1.E-3 * 0.1 / 12.0); |
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.
Should 1.E-3 and 0.1 have named constants?
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.
A clear and very useful extension of the new piping element. I'm sure some people will be very pleased to have your changes available. All of my suggestions are minor in nature and non-blocking.
applications/GeoMechanicsApplication/custom_elements/geo_steady_state_Pw_piping_element.h
Outdated
Show resolved
Hide resolved
applications/GeoMechanicsApplication/custom_elements/geo_steady_state_Pw_piping_element.h
Outdated
Show resolved
Hide resolved
applications/GeoMechanicsApplication/custom_elements/geo_steady_state_Pw_piping_element.h
Outdated
Show resolved
Hide resolved
applications/GeoMechanicsApplication/custom_elements/geo_steady_state_Pw_piping_element.h
Show resolved
Hide resolved
...echanicsApplication/tests/cpp_tests/custom_elements/test_geo_steady_state_piping_element.cpp
Outdated
Show resolved
Hide resolved
...echanicsApplication/tests/cpp_tests/custom_elements/test_geo_steady_state_piping_element.cpp
Outdated
Show resolved
Hide resolved
...echanicsApplication/tests/cpp_tests/custom_elements/test_geo_steady_state_piping_element.cpp
Show resolved
Hide resolved
...echanicsApplication/tests/cpp_tests/custom_elements/test_geo_steady_state_piping_element.cpp
Outdated
Show resolved
Hide resolved
...echanicsApplication/tests/cpp_tests/custom_elements/test_geo_steady_state_piping_element.cpp
Show resolved
Hide resolved
applications/GeoMechanicsApplication/custom_elements/geo_steady_state_Pw_piping_element.h
Show resolved
Hide resolved
- Restored a variable name that was accidentally reverted. - Check all entries of returned vectors. - Fixed a typo.
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 processing the review comments and replying to the questions. I believe this PR is ready to be merged.
📝 Description
Added