KratosMultiphysics / Kratos

Kratos Multiphysics (A.K.A Kratos) is a framework for building parallel multi-disciplinary simulation software. Modularity, extensibility and HPC are the main objectives. Kratos has BSD license and is written in C++ with extensive Python interface.
https://kratosmultiphysics.github.io/Kratos/
Other
985 stars 242 forks source link

[GeoMechanicsApplication] Standard K0 procedure for 3D #12336

Open rfaasse opened 2 months ago

rfaasse commented 2 months ago

As a Kratos user, I would like to be able to use the standard K0 procedure for 3D linear elastic materials, such that I have results that are closely comparable to competitive software.

Required for 3D soil structure interaction

Predecessor: #12396

Acceptance Criteria Given a user runs a K0 stage in 3D When the user does not specify anything about the standard procedure Then the standard procedure (which is already available in 2D) is used

Given a user runs a K0 stage in 3D When the user specifies the "use_standard_procedure" boolean in the process parameters (via json). Then depending on the boolean, the standard procedure (which is already available in 2D) is (or is not) used

rfaasse commented 2 months ago

Small investigation to refine this will be taken up by @WPK4FEM @rfaasse

rfaasse commented 2 months ago

Refinement investigation start (work in progress)

Functions the GeoLinearElasticPlaneStrain2DLaw overrides:

public:
ConstitutiveLaw::Pointer Clone() const override;
bool RequiresInitializeMaterialResponse() override;
void InitializeMaterialResponseCauchy(ConstitutiveLaw::Parameters& rValues) override;
bool RequiresFinalizeMaterialResponse() override;
void FinalizeMaterialResponseCauchy(ConstitutiveLaw::Parameters& rValues) override;
void FinalizeMaterialResponsePK2(ConstitutiveLaw::Parameters& rValues) override;
void GetLawFeatures(Features& rFeatures) override;
SizeType WorkingSpaceDimension() override;
SizeType GetStrainSize() const override;
bool IsIncremental() override;
bool& GetValue(const Variable<bool>& rThisVariable, bool& rValue) override;

protected:
void CalculateElasticMatrix(Matrix& C, ConstitutiveLaw::Parameters& rValues) override;
void CalculatePK2Stress(const Vector&                rStrainVector,
                        Vector&                      rStressVector,
                        ConstitutiveLaw::Parameters& rValues) override;

Functions its base LinearPlaneStrainK0Law overrides:

public:
ConstitutiveLaw::Pointer Clone() const override;
void GetLawFeatures(Features& rFeatures) override;
SizeType WorkingSpaceDimension() override { return Dimension; };
SizeType GetStrainSize() const override { return VoigtSize; }
bool& GetValue(const Variable<bool>& rThisVariable, bool& rValue) override;

protected:    
void CalculateElasticMatrix(Matrix& C, ConstitutiveLaw::Parameters& rValues) override;
void CalculatePK2Stress(const Vector&                rStrainVector,
                        Vector&                      rStressVector,
                        ConstitutiveLaw::Parameters& rValues) override;
void CalculateCauchyGreenStrain(ConstitutiveLaw::Parameters& rValues, Vector& rStrainVector) override;

The only one the K0 version has, that the 2D version doesn't have is the CalculateCauchyGreenStrain function. If it would have that function, we could move it in the inheritance structure to derive from GeoLinearElasticLaw directly. This should be relatively small effort, so we could look at the possibility of extending this class to have 3D functionality.

My first idea would be to take the following steps to get this done:

  1. Make sure the GeoLinearElasticPlaneStrain2DLaw does not derive from a K0 law anymore
  2. Identify the behavior that's dimension specific (should that be part of the refinement?)
  3. Create a policy we can inject into the GeoLinearElasticPlaneStrain2DLaw (which should then be renamed to something more generic)
  4. Capture the 2D and 3D behaviors in the policy, later on easily extendible to axisymmetric
  5. Register the laws (where both 2D and 3D are the same class, but get a different policy)
rfaasse commented 1 month ago

To be split by @rfaasse