-
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 pressure element #12997
Open
mnabideltares
wants to merge
20
commits into
master
Choose a base branch
from
geo/12323-implement-pw-well-element-2
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+905
−32
Open
Changes from 18 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
399a931
test cases for pressure filter are added
mnabideltares f5e113b
Added the projected gravity to the body forve vector.
mnabideltares 6ff43bf
Added a new compressibility calculator for filter calculations, which…
rfaasse 4d27652
Documentation is added
mnabideltares 5be7ec0
fix
mnabideltares 55c094e
Modifications based on review
mnabideltares 0b630c8
clang format
mnabideltares af1d84d
Fix
mnabideltares e9ffca6
Fixes based on review
mnabideltares 007bf56
Fixes based on review
mnabideltares f2d2ab7
Fixes based on review
mnabideltares 5448435
fixes in test cases
mnabideltares 1f59195
Documentation for Pw filter element is added
mnabideltares d8fdbf9
fixes in documentation
mnabideltares ee012e8
fix
mnabideltares b3781a2
fix
mnabideltares 0e51c44
fixes in documentation
mnabideltares e2025ac
changes bases on review
mnabideltares 3df9612
A small fix
mnabideltares e2e3501
Added documentation for Pw element
mnabideltares File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
105 changes: 105 additions & 0 deletions
105
applications/GeoMechanicsApplication/custom_elements/filter_compressibility_calculator.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
// KRATOS___ | ||
// // ) ) | ||
// // ___ ___ | ||
// // ____ //___) ) // ) ) | ||
// // / / // // / / | ||
// ((____/ / ((____ ((___/ / MECHANICS | ||
// | ||
// License: geo_mechanics_application/license.txt | ||
// | ||
// Main authors: Mohamed Nabi | ||
// Richard Faasse | ||
// | ||
#include "filter_compressibility_calculator.h" | ||
#include "custom_utilities/transport_equation_utilities.hpp" | ||
#include "geo_mechanics_application_variables.h" | ||
|
||
namespace Kratos | ||
{ | ||
|
||
FilterCompressibilityCalculator::FilterCompressibilityCalculator(InputProvider AnInputProvider) | ||
: mInputProvider(std::move(AnInputProvider)) | ||
{ | ||
} | ||
|
||
Matrix FilterCompressibilityCalculator::LHSContribution() | ||
{ | ||
return LHSContribution(CalculateCompressibilityMatrix()); | ||
} | ||
|
||
Vector FilterCompressibilityCalculator::RHSContribution() | ||
{ | ||
return RHSContribution(CalculateCompressibilityMatrix()); | ||
} | ||
|
||
Vector FilterCompressibilityCalculator::RHSContribution(const Matrix& rCompressibilityMatrix) const | ||
{ | ||
return -prod(rCompressibilityMatrix, mInputProvider.GetNodalValues(DT_WATER_PRESSURE)); | ||
} | ||
|
||
Matrix FilterCompressibilityCalculator::LHSContribution(const Matrix& rCompressibilityMatrix) const | ||
{ | ||
return mInputProvider.GetMatrixScalarFactor() * rCompressibilityMatrix; | ||
} | ||
|
||
std::pair<Matrix, Vector> FilterCompressibilityCalculator::LocalSystemContribution() | ||
{ | ||
const auto compressibility_matrix = CalculateCompressibilityMatrix(); | ||
return {LHSContribution(compressibility_matrix), RHSContribution(compressibility_matrix)}; | ||
} | ||
|
||
Matrix FilterCompressibilityCalculator::CalculateCompressibilityMatrix() const | ||
{ | ||
const auto& r_N_container = mInputProvider.GetNContainer(); | ||
const auto& integration_coefficients = mInputProvider.GetIntegrationCoefficients(); | ||
const auto& projected_gravity_on_integration_points = | ||
mInputProvider.GetProjectedGravityForIntegrationPoints(); | ||
auto result = Matrix{ZeroMatrix{r_N_container.size2(), r_N_container.size2()}}; | ||
for (unsigned int integration_point_index = 0; | ||
integration_point_index < integration_coefficients.size(); ++integration_point_index) { | ||
const auto N = Vector{row(r_N_container, integration_point_index)}; | ||
result += GeoTransportEquationUtilities::CalculateCompressibilityMatrix( | ||
N, CalculateElasticCapacity(projected_gravity_on_integration_points[integration_point_index]), | ||
integration_coefficients[integration_point_index]); | ||
} | ||
return result; | ||
} | ||
|
||
double FilterCompressibilityCalculator::CalculateElasticCapacity(double ProjectedGravity) const | ||
{ | ||
const auto& r_properties = mInputProvider.GetElementProperties(); | ||
return 1.0 / (r_properties[DENSITY_WATER] * ProjectedGravity * r_properties[FILTER_LENGTH]) + | ||
1.0 / r_properties[BULK_MODULUS_FLUID]; | ||
} | ||
|
||
const Properties& FilterCompressibilityCalculator::InputProvider::GetElementProperties() const | ||
{ | ||
return mGetElementProperties(); | ||
} | ||
|
||
const Matrix& FilterCompressibilityCalculator::InputProvider::GetNContainer() const | ||
{ | ||
return mGetNContainer(); | ||
} | ||
|
||
Vector FilterCompressibilityCalculator::InputProvider::GetIntegrationCoefficients() const | ||
{ | ||
return mGetIntegrationCoefficients(); | ||
} | ||
|
||
Vector FilterCompressibilityCalculator::InputProvider::GetProjectedGravityForIntegrationPoints() const | ||
{ | ||
return mGetProjectedGravityForIntegrationPoints(); | ||
} | ||
|
||
double FilterCompressibilityCalculator::InputProvider::GetMatrixScalarFactor() const | ||
{ | ||
return mGetMatrixScalarFactor(); | ||
} | ||
|
||
Vector FilterCompressibilityCalculator::InputProvider::GetNodalValues(const Variable<double>& rVariable) const | ||
{ | ||
return mGetNodalValues(rVariable); | ||
} | ||
|
||
} // namespace Kratos |
78 changes: 78 additions & 0 deletions
78
applications/GeoMechanicsApplication/custom_elements/filter_compressibility_calculator.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
// KRATOS___ | ||
// // ) ) | ||
// // ___ ___ | ||
// // ____ //___) ) // ) ) | ||
// // / / // // / / | ||
// ((____/ / ((____ ((___/ / MECHANICS | ||
// | ||
// License: geo_mechanics_application/license.txt | ||
// | ||
// Main authors: Mohamed Nabi | ||
// Richard Faasse | ||
|
||
#pragma once | ||
|
||
#include "contribution_calculator.h" | ||
#include "custom_retention/retention_law.h" | ||
#include "includes/properties.h" | ||
#include "includes/ublas_interface.h" | ||
|
||
#include <utility> | ||
#include <vector> | ||
|
||
namespace Kratos | ||
{ | ||
|
||
class FilterCompressibilityCalculator : public ContributionCalculator | ||
{ | ||
public: | ||
class InputProvider | ||
{ | ||
public: | ||
InputProvider(std::function<const Properties&()> GetElementProperties, | ||
std::function<const Matrix&()> GetNContainer, | ||
std::function<Vector()> GetIntegrationCoefficients, | ||
std::function<Vector()> GetProjectedGravityForIntegrationPoints, | ||
std::function<double()> GetMatrixScalarFactor, | ||
std::function<Vector(const Variable<double>&)> GetNodalValuesOf) | ||
: mGetElementProperties(std::move(GetElementProperties)), | ||
mGetNContainer(std::move(GetNContainer)), | ||
mGetIntegrationCoefficients(std::move(GetIntegrationCoefficients)), | ||
mGetProjectedGravityForIntegrationPoints(std::move(GetProjectedGravityForIntegrationPoints)), | ||
mGetMatrixScalarFactor(std::move(GetMatrixScalarFactor)), | ||
mGetNodalValues(std::move(GetNodalValuesOf)) | ||
{ | ||
} | ||
|
||
[[nodiscard]] const Properties& GetElementProperties() const; | ||
[[nodiscard]] const Matrix& GetNContainer() const; | ||
[[nodiscard]] Vector GetIntegrationCoefficients() const; | ||
[[nodiscard]] Vector GetProjectedGravityForIntegrationPoints() const; | ||
[[nodiscard]] double GetMatrixScalarFactor() const; | ||
[[nodiscard]] Vector GetNodalValues(const Variable<double>& rVariable) const; | ||
|
||
private: | ||
std::function<const Properties&()> mGetElementProperties; | ||
std::function<const Matrix&()> mGetNContainer; | ||
std::function<Vector()> mGetIntegrationCoefficients; | ||
std::function<Vector()> mGetProjectedGravityForIntegrationPoints; | ||
std::function<double()> mGetMatrixScalarFactor; | ||
std::function<Vector(const Variable<double>&)> mGetNodalValues; | ||
}; | ||
|
||
explicit FilterCompressibilityCalculator(InputProvider AnInputProvider); | ||
|
||
Matrix LHSContribution() override; | ||
Vector RHSContribution() override; | ||
std::pair<Matrix, Vector> LocalSystemContribution() override; | ||
|
||
private: | ||
[[nodiscard]] Matrix CalculateCompressibilityMatrix() const; | ||
[[nodiscard]] double CalculateElasticCapacity(double ProjectedGravity) const; | ||
[[nodiscard]] Vector RHSContribution(const Matrix& rCompressibilityMatrix) const; | ||
[[nodiscard]] Matrix LHSContribution(const Matrix& rCompressibilityMatrix) const; | ||
|
||
InputProvider mInputProvider; | ||
}; | ||
|
||
} // namespace Kratos |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
If I'm correct in other parts of the code this is called
j
: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