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

[GeoMechanicsApplication] A 3D elastic constitutive law is lacking in GeoMechanicsApplication #12816

Merged
merged 14 commits into from
Nov 8, 2024
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class ConstitutiveLawDimension;
/**
* @class GeoIncrementalLinearElasticLaw
* @ingroup GeoMechanicsApplication
* @brief This class defines a small deformation linear elastic constitutive model for plane strain and 3D cases
* @brief This class defines a incremental linear elastic constitutive model for plane strain and 3D cases
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very minor (nitpicking at this point)

Suggested change
* @brief This class defines a incremental linear elastic constitutive model for plane strain and 3D cases
* @brief This class defines an incremental linear elastic constitutive model for plane strain and 3D cases

* @author Vahid Galavi
*/
class KRATOS_API(GEO_MECHANICS_APPLICATION) GeoIncrementalLinearElasticLaw : public GeoLinearElasticLaw
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class KRATOS_API(GEO_MECHANICS_APPLICATION) LinearElastic2DBeamLaw : public GeoI
/// The base class ConstitutiveLaw type definition
using CLBaseType = ConstitutiveLaw;

/// The base class ElasticIsotropicK03DLaw type definition
/// The base class GeoIncrementalLinearElasticLaw type definition
avdg81 marked this conversation as resolved.
Show resolved Hide resolved
using BaseType = GeoIncrementalLinearElasticLaw;

/// The size type definition
Expand Down Expand Up @@ -171,12 +171,12 @@ class KRATOS_API(GEO_MECHANICS_APPLICATION) LinearElastic2DBeamLaw : public GeoI

void save(Serializer& rSerializer) const override
{
KRATOS_SERIALIZE_SAVE_BASE_CLASS(rSerializer, GeoIncrementalLinearElasticLaw)
KRATOS_SERIALIZE_SAVE_BASE_CLASS(rSerializer, BaseType)
}

void load(Serializer& rSerializer) override
{
KRATOS_SERIALIZE_LOAD_BASE_CLASS(rSerializer, GeoIncrementalLinearElasticLaw)
KRATOS_SERIALIZE_LOAD_BASE_CLASS(rSerializer, BaseType)
}
}; // Class LinearElastic2DBeamLaw

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class KRATOS_API(GEO_MECHANICS_APPLICATION) LinearElastic2DInterfaceLaw : public
/// The base class ConstitutiveLaw type definition
using CLBaseType = ConstitutiveLaw;

/// The base class ElasticIsotropicK03DLaw type definition
/// The base class GeoIncrementalLinearElasticLaw type definition
avdg81 marked this conversation as resolved.
Show resolved Hide resolved
using BaseType = GeoIncrementalLinearElasticLaw;

/// The size type definition
Expand Down Expand Up @@ -189,12 +189,12 @@ class KRATOS_API(GEO_MECHANICS_APPLICATION) LinearElastic2DInterfaceLaw : public

void save(Serializer& rSerializer) const override
{
KRATOS_SERIALIZE_SAVE_BASE_CLASS(rSerializer, GeoIncrementalLinearElasticLaw)
KRATOS_SERIALIZE_SAVE_BASE_CLASS(rSerializer, BaseType)
}

void load(Serializer& rSerializer) override
{
KRATOS_SERIALIZE_LOAD_BASE_CLASS(rSerializer, GeoIncrementalLinearElasticLaw)
KRATOS_SERIALIZE_LOAD_BASE_CLASS(rSerializer, BaseType)
}
}; // Class LinearElastic2DInterfaceLaw

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
// Gennady Markelov
//

#include "elastic_3D.h"
#include "three_dimensional.h"

#include "geo_mechanics_application_constants.h"
#include "includes/constitutive_law.h"

namespace Kratos
{

Matrix Elastic3D::FillConstitutiveMatrix(double c1, double c2, double c3) const
Matrix ThreeDimensional::FillConstitutiveMatrix(double c1, double c2, double c3) const
{
Matrix result = ZeroMatrix(GetStrainSize(), GetStrainSize());

Expand All @@ -42,15 +42,15 @@ Matrix Elastic3D::FillConstitutiveMatrix(double c1, double c2, double c3) const
return result;
}

std::unique_ptr<ConstitutiveLawDimension> Elastic3D::Clone() const
std::unique_ptr<ConstitutiveLawDimension> ThreeDimensional::Clone() const
{
return std::make_unique<Elastic3D>();
return std::make_unique<ThreeDimensional>();
}

std::size_t Elastic3D::GetStrainSize() const { return VOIGT_SIZE_3D; }
std::size_t ThreeDimensional::GetStrainSize() const { return VOIGT_SIZE_3D; }

std::size_t Elastic3D::GetDimension() const { return N_DIM_3D; }
std::size_t ThreeDimensional::GetDimension() const { return N_DIM_3D; }

Flags Elastic3D::GetSpatialType() const { return ConstitutiveLaw::THREE_DIMENSIONAL_LAW; }
Flags ThreeDimensional::GetSpatialType() const { return ConstitutiveLaw::THREE_DIMENSIONAL_LAW; }

} // namespace Kratos
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@
#pragma once

#include "constitutive_law_dimension.h"
#include "includes/kratos_export_api.h"

namespace Kratos
{

class KRATOS_API(GEO_MECHANICS_APPLICATION) Elastic3D : public ConstitutiveLawDimension
class KRATOS_API(GEO_MECHANICS_APPLICATION) ThreeDimensional : public ConstitutiveLawDimension
{
public:
[[nodiscard]] Matrix FillConstitutiveMatrix(double c1, double c2, double c3) const override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ void KratosGeoMechanicsApplication::Register()
KRATOS_REGISTER_CONSTITUTIVE_LAW("LinearElasticPlaneStrainK02DLaw", mLinearPlaneStrainK0Law)
KRATOS_REGISTER_CONSTITUTIVE_LAW("LinearElasticK03DLaw", mElasticIsotropicK03DLaw)
KRATOS_REGISTER_CONSTITUTIVE_LAW("GeoLinearElasticPlaneStrain2DLaw", mLinearElasticPlaneStrain2DLaw)
KRATOS_REGISTER_CONSTITUTIVE_LAW("GeoLinearElastic3DLaw", mLinearElastic3DLaw)
KRATOS_REGISTER_CONSTITUTIVE_LAW("GeoIncrementalLinearElastic3DLaw", mLinearElastic3DLaw)

KRATOS_REGISTER_CONSTITUTIVE_LAW("GeoLinearElasticPlaneStress2DLaw", mLinearElasticPlaneStress2DLaw)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@
// constitutive models
#include "custom_constitutive/bilinear_cohesive_2D_law.hpp"
#include "custom_constitutive/bilinear_cohesive_3D_law.hpp"
#include "custom_constitutive/elastic_3D.h"
#include "custom_constitutive/elastic_isotropic_K0_3d_law.h"
#include "custom_constitutive/incremental_linear_elastic_interface_law.h"
#include "custom_constitutive/incremental_linear_elastic_law.h"
Expand All @@ -137,6 +136,7 @@
#include "custom_constitutive/small_strain_umat_2D_plane_strain_law.hpp"
#include "custom_constitutive/small_strain_umat_3D_interface_law.hpp"
#include "custom_constitutive/small_strain_umat_3D_law.hpp"
#include "custom_constitutive/three_dimensional.h"
#include "custom_constitutive/truss_backbone_constitutive_law.h"

namespace Kratos
Expand Down Expand Up @@ -947,8 +947,8 @@ class KRATOS_API(GEO_MECHANICS_APPLICATION) KratosGeoMechanicsApplication : publ
const BilinearCohesive2DLaw mBilinearCohesive2DLaw;
const LinearPlaneStrainK0Law mLinearPlaneStrainK0Law;
const GeoIncrementalLinearElasticLaw mLinearElasticPlaneStrain2DLaw{std::make_unique<PlaneStrain>()};
const GeoIncrementalLinearElasticLaw mLinearElastic3DLaw{std::make_unique<Elastic3D>()};
const ElasticIsotropicK03DLaw mElasticIsotropicK03DLaw;
const GeoIncrementalLinearElasticLaw mLinearElastic3DLaw{std::make_unique<ThreeDimensional>()};
const ElasticIsotropicK03DLaw mElasticIsotropicK03DLaw;
const GeoLinearElasticPlaneStress2DLaw mLinearElasticPlaneStress2DLaw;

const SmallStrainUDSM3DLaw mSmallStrainUDSM3DLaw{};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ It checks the water pressure after a single stage of calculation on these single
- Next to this, the X,Y displacements of the sides are fixed, meaning only the top nodes are free to move and only in the Z direction.
- The water pressure in the top nodes is kept at 0.0.
- Material:
- The material is described using a linear elastic material with a `LinearElastic3DLaw`, a Young's modulus
- The material is described using a linear elastic material with a `GeoIncrementalLinearElastic3DLaw`, a Young's modulus
of 10000 [kPa] and a Poisson ratio of 0.0.
- Loads:
- Using the `ApplyVectorConstraintTableProcess`, a negative VOLUME_ACCELERATION of 9.81 [m/s^2] is applied in the z-direction to the entire cube.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"properties_id": 1,
"Material": {
"constitutive_law": {
"name" : "GeoLinearElastic3DLaw"
"name" : "GeoIncrementalLinearElastic3DLaw"
},
"Variables": {
"IGNORE_UNDRAINED" : false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"properties_id": 1,
"Material": {
"constitutive_law": {
"name" : "GeoLinearElastic3DLaw"
"name" : "GeoIncrementalLinearElastic3DLaw"
},
"Variables": {
"IGNORE_UNDRAINED" : false,
Expand Down
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor typo in the name (inremental -> incremental)

Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@
// License: geo_mechanics_application/license.txt
//
// Main authors: Richard Faasse
// Gennady Markelov
//

#include "custom_constitutive/elastic_3D.h"
#include "custom_constitutive/incremental_linear_elastic_law.h"
#include "custom_constitutive/three_dimensional.h"
#include "tests/cpp_tests/geo_mechanics_fast_suite.h"

#include <boost/numeric/ublas/assignment.hpp>
Expand Down Expand Up @@ -46,19 +47,19 @@ Vector Calculate3DStress(GeoIncrementalLinearElasticLaw& rConstitutiveLaw)
return stress;
}

GeoIncrementalLinearElasticLaw CreateLinearElastic3DLaw()
GeoIncrementalLinearElasticLaw CreateIncrementalLinearElastic3DLaw()
{
return GeoIncrementalLinearElasticLaw{std::make_unique<Elastic3D>()};
return GeoIncrementalLinearElasticLaw{std::make_unique<ThreeDimensional>()};
}

} // namespace

namespace Kratos::Testing
{

KRATOS_TEST_CASE_IN_SUITE(GeoLinearElastic3DLawReturnsExpectedLawFeatures, KratosGeoMechanicsFastSuiteWithoutKernel)
KRATOS_TEST_CASE_IN_SUITE(GeoIncrementalLinearElastic3DLawReturnsExpectedLawFeatures, KratosGeoMechanicsFastSuiteWithoutKernel)
{
auto law = CreateLinearElastic3DLaw();
auto law = CreateIncrementalLinearElastic3DLaw();

ConstitutiveLaw::Features law_features;
law.GetLawFeatures(law_features);
Expand All @@ -78,21 +79,22 @@ KRATOS_TEST_CASE_IN_SUITE(GeoLinearElastic3DLawReturnsExpectedLawFeatures, Krato
KRATOS_EXPECT_EQ(law_features.mSpaceDimension, 3);
}

KRATOS_TEST_CASE_IN_SUITE(GeoLinearElastic3DLawReturnsExpectedStrainSize, KratosGeoMechanicsFastSuiteWithoutKernel)
KRATOS_TEST_CASE_IN_SUITE(GeoIncrementalLinearElastic3DLawReturnsExpectedStrainSize, KratosGeoMechanicsFastSuiteWithoutKernel)
{
const auto law = CreateLinearElastic3DLaw();
const auto law = CreateIncrementalLinearElastic3DLaw();
KRATOS_EXPECT_EQ(law.GetStrainSize(), 6);
}

KRATOS_TEST_CASE_IN_SUITE(GeoLinearElastic3DLawReturnsExpectedWorkingSpaceDimension, KratosGeoMechanicsFastSuiteWithoutKernel)
KRATOS_TEST_CASE_IN_SUITE(GeoIncrementalLinearElastic3DLawReturnsExpectedWorkingSpaceDimension,
KratosGeoMechanicsFastSuiteWithoutKernel)
{
auto law = CreateLinearElastic3DLaw();
auto law = CreateIncrementalLinearElastic3DLaw();
KRATOS_EXPECT_EQ(law.WorkingSpaceDimension(), 3);
}

KRATOS_TEST_CASE_IN_SUITE(GeoLinearElastic3DLawReturnsExpectedStress, KratosGeoMechanicsFastSuiteWithoutKernel)
KRATOS_TEST_CASE_IN_SUITE(GeoIncrementalLinearElastic3DLawReturnsExpectedStress, KratosGeoMechanicsFastSuiteWithoutKernel)
{
auto law = CreateLinearElastic3DLaw();
auto law = CreateIncrementalLinearElastic3DLaw();

const auto stress = Calculate3DStress(law);

Expand All @@ -101,10 +103,10 @@ KRATOS_TEST_CASE_IN_SUITE(GeoLinearElastic3DLawReturnsExpectedStress, KratosGeoM
KRATOS_EXPECT_VECTOR_RELATIVE_NEAR(expected_stress, stress, 1e-3);
}

KRATOS_TEST_CASE_IN_SUITE(GeoLinearElastic3DLawReturnsExpectedStress_WhenOnlyDiagonalEntriesAreConsidered,
KRATOS_TEST_CASE_IN_SUITE(GeoIncrementalLinearElastic3DLawReturnsExpectedStress_WhenOnlyDiagonalEntriesAreConsidered,
KratosGeoMechanicsFastSuiteWithoutKernel)
{
auto law = CreateLinearElastic3DLaw();
auto law = CreateIncrementalLinearElastic3DLaw();
law.SetConsiderDiagonalEntriesOnlyAndNoShear(true);

const auto stress = Calculate3DStress(law);
Expand All @@ -114,10 +116,10 @@ KRATOS_TEST_CASE_IN_SUITE(GeoLinearElastic3DLawReturnsExpectedStress_WhenOnlyDia
KRATOS_EXPECT_VECTOR_RELATIVE_NEAR(expected_stress, stress, 1e-3);
}

KRATOS_TEST_CASE_IN_SUITE(GeoLinearElastic3DLawReturnsExpectedStress_WithInitialStressAndStrain,
KRATOS_TEST_CASE_IN_SUITE(GeoIncrementalLinearElastic3DLawReturnsExpectedStress_WithInitialStressAndStrain,
KratosGeoMechanicsFastSuiteWithoutKernel)
{
auto law = CreateLinearElastic3DLaw();
auto law = CreateIncrementalLinearElastic3DLaw();

ConstitutiveLaw::Parameters parameters;
auto initial_strain = Vector{ScalarVector{6, 0.5}};
Expand All @@ -133,10 +135,10 @@ KRATOS_TEST_CASE_IN_SUITE(GeoLinearElastic3DLawReturnsExpectedStress_WithInitial
KRATOS_EXPECT_VECTOR_RELATIVE_NEAR(expected_stress, stress, 1e-3);
}

KRATOS_TEST_CASE_IN_SUITE(GeoLinearElastic3DLawReturnsExpectedStress_AfterFinalizeMaterialResponse,
KRATOS_TEST_CASE_IN_SUITE(GeoIncrementalLinearElastic3DLawReturnsExpectedStress_AfterFinalizeMaterialResponse,
KratosGeoMechanicsFastSuiteWithoutKernel)
{
auto law = CreateLinearElastic3DLaw();
auto law = CreateIncrementalLinearElastic3DLaw();

ConstitutiveLaw::Parameters initial_parameters;
auto initial_strain = Vector{ScalarVector{6, 0.5}};
Expand All @@ -159,10 +161,10 @@ KRATOS_TEST_CASE_IN_SUITE(GeoLinearElastic3DLawReturnsExpectedStress_AfterFinali
}

#ifdef KRATOS_DEBUG
KRATOS_TEST_CASE_IN_SUITE(GeoLinearElastic3DLawThrows_WhenElementProvidedStrainIsSetToFalse,
KRATOS_TEST_CASE_IN_SUITE(GeoIncrementalLinearElastic3DLawThrows_WhenElementProvidedStrainIsSetToFalse,
KratosGeoMechanicsFastSuiteWithoutKernel)
{
auto law = CreateLinearElastic3DLaw();
auto law = CreateIncrementalLinearElastic3DLaw();

ConstitutiveLaw::Parameters parameters;
parameters.GetOptions().Set(ConstitutiveLaw::USE_ELEMENT_PROVIDED_STRAIN, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"properties_id": 1,
"Material": {
"constitutive_law": {
"name" : "GeoLinearElastic3DLaw"
"name" : "GeoIncrementalLinearElastic3DLaw"
},
"Variables": {
"IGNORE_UNDRAINED" : true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ A schematic depiction of the test case is shown below:
- Constraints:
- The X, Y and Z displacements in the bottom four nodes (1, 2, 3 and 4) are fixed.
- Material:
- The material is described using a linear elastic material with a `LinearElastic3DLaw`, a Young's modulus
- The material is described using a linear elastic material with a `GeoIncrementalLinearElastic3DLaw`, a Young's modulus
of 3.0e7 [kPa] and a Poisson ratio of 0.0.
- Conditions:
- A UpwNormalFaceLoadCondition3D4N is added to the top of the cube (nodes 5, 6, 7 and 8).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"properties_id": 1,
"Material": {
"constitutive_law": {
"name" : "GeoLinearElastic3DLaw"
"name" : "GeoIncrementalLinearElastic3DLaw"
},
"Variables": {
"IGNORE_UNDRAINED" : true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"properties_id": 1,
"Material": {
"constitutive_law": {
"name" : "GeoLinearElastic3DLaw"
"name" : "GeoIncrementalLinearElastic3DLaw"
},
"Variables": {
"IGNORE_UNDRAINED" : true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"properties_id": 1,
"Material": {
"constitutive_law": {
"name" : "GeoLinearElastic3DLaw"
"name" : "GeoIncrementalLinearElastic3DLaw"
},
"Variables": {
"IGNORE_UNDRAINED" : true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"properties_id": 1,
"Material": {
"constitutive_law": {
"name" : "GeoLinearElastic3DLaw"
"name" : "GeoIncrementalLinearElastic3DLaw"
},
"Variables": {
"IGNORE_UNDRAINED" : true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ The mesh with hexa elements is given in the following figure.

The material is described using:

- A linear elastic 3D model (LinearElastic3DLaw),
- A linear elastic 3D model (GeoIncrementalLinearElastic3DLaw),
- Young's modulus is $E$=10 $[MPa]$
- Poisson's ratio is $\nu$=0.2,
- Density of solid is $\rho$=2.65 $[ton/m^3]$,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"properties_id": 1,
"Material": {
"constitutive_law": {
"name" : "GeoLinearElastic3DLaw"
"name" : "GeoIncrementalLinearElastic3DLaw"
},
"Variables": {
"IGNORE_UNDRAINED" : true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"properties_id": 1,
"Material": {
"constitutive_law": {
"name" : "GeoLinearElastic3DLaw"
"name" : "GeoIncrementalLinearElastic3DLaw"
},
"Variables": {
"IGNORE_UNDRAINED" : true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"properties_id": 1,
"Material": {
"constitutive_law": {
"name" : "GeoLinearElastic3DLaw"
"name" : "GeoIncrementalLinearElastic3DLaw"
},
"Variables": {
"IGNORE_UNDRAINED" : true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"properties_id" : 1,
"Material": {
"constitutive_law": {
"name" : "GeoLinearElastic3DLaw"
"name" : "GeoIncrementalLinearElastic3DLaw"
},
"Variables": {
"YOUNG_MODULUS" : 91800.0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"properties_id": 1,
"Material": {
"constitutive_law": {
"name" : "GeoLinearElastic3DLaw"
"name" : "GeoIncrementalLinearElastic3DLaw"
},
"Variables": {
"IGNORE_UNDRAINED" : true,
Expand Down
Loading
Loading