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/line piping output #12852

Merged
merged 16 commits into from
Nov 19, 2024
Merged

Geo/line piping output #12852

merged 16 commits into from
Nov 19, 2024

Conversation

WPK4FEM
Copy link
Contributor

@WPK4FEM WPK4FEM commented Nov 15, 2024

📝 Description
Added

  • output items PIPE_ACTIVE, PIPE_HEIGHT, FLUID_FLUX_VECTOR, LOCAL_FLUID_FLUX_VECTOR, PERMEABILITY_MATRIX, LOCAL_PERMEABILITY_MATRIX for the line piping element
  • unit tests for those output items.

@WPK4FEM WPK4FEM self-assigned this Nov 15, 2024
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 @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));
Copy link
Contributor

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?

Copy link
Contributor Author

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());
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Comment on lines 187 to 199
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];
}
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 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};
Copy link
Contributor

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.

Copy link
Contributor Author

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);
Copy link
Contributor

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?

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 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);
Copy link
Contributor

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?

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.

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.

WPK4FEM and others added 4 commits November 18, 2024 14:29
@WPK4FEM WPK4FEM requested a review from avdg81 November 19, 2024 08:04
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.

Thank you for processing the review comments and replying to the questions. I believe this PR is ready to be merged.

@WPK4FEM WPK4FEM merged commit f9fcc60 into master Nov 19, 2024
11 checks passed
@WPK4FEM WPK4FEM deleted the geo/line_piping_output_2D branch November 19, 2024 09:35
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.

3 participants