Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -675,4 +675,124 @@ KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateMaterialResponse
expected_cauchy_stress_vector, tolerance);
}

Vector ComputeStressVectorUsingCPhiReductionTestData(double Cohesion,
double FrictionAngle,
Vector& rStrainVectorFinalized,
Vector& rStressVectorFinalized,
Vector& rStrainVector)
{
Properties properties;
properties.SetValue(GEO_COHESION, Cohesion);
properties.SetValue(GEO_FRICTION_ANGLE, FrictionAngle);
properties.SetValue(GEO_DILATANCY_ANGLE, 0.0);
properties.SetValue(GEO_TENSILE_STRENGTH, 1000.0);
properties.SetValue(YOUNG_MODULUS, 30.0e6);
properties.SetValue(POISSON_RATIO, 0.2);

auto law = MohrCoulombWithTensionCutOff(std::make_unique<PlaneStrain>());

const auto dummy_element_geometry = Geometry<Node>{};
const auto dummy_shape_function_values = Vector{};
law.InitializeMaterial(properties, dummy_element_geometry, dummy_shape_function_values);

ConstitutiveLaw::Parameters parameters;
parameters.SetMaterialProperties(properties);
parameters.SetStrainVector(rStrainVectorFinalized);
parameters.SetStressVector(rStressVectorFinalized);
const auto dummy_process_info = ProcessInfo{};
law.SetValue(CAUCHY_STRESS_VECTOR, rStressVectorFinalized, dummy_process_info);
law.FinalizeMaterialResponseCauchy(parameters);

parameters.SetStrainVector(rStrainVector);
law.CalculateMaterialResponseCauchy(parameters);

Vector result;
law.GetValue(CAUCHY_STRESS_VECTOR, result);
return result;
}

KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateMaterialResponseCauchyAtRegularFailureRegion_CPhiVariation,
KratosGeoMechanicsFastSuiteWithoutKernel)
{
// Arrange, data are taken from C-Phi reduction test for GPoint 0 of Element 8
constexpr auto cohesion = 800.0;
constexpr auto friction_angle = 24.79128089714489;
auto strain_vector_finalized = UblasUtilities::CreateVector(
{6.9595905431284102e-04, -5.1669244190907055e-04, 0.0000000000000000e+00, 3.6495572640421296e-05});
auto stress_vector_finalized = UblasUtilities::CreateVector(
{-1.8485198418257996e+03, -7.9720205330738399e+03, -3.6748820224188021e+03, 7.4955824230365451e+01});
auto strain_vector = UblasUtilities::CreateVector({6.9595905431284102e-04, -5.1669244190907055e-04,
0.0000000000000000e+00, 3.6495572640421296e-05});
// Act
const auto actual_cauchy_stress_vector = ComputeStressVectorUsingCPhiReductionTestData(
cohesion, friction_angle, strain_vector_finalized, stress_vector_finalized, strain_vector);
// Assert
const auto expected_cauchy_stress_vector = UblasUtilities::CreateVector(
{-2.1258867028468462e+03, -7.6946536720527947e+03, -3.6748820224188021e+03, 6.8165505185660834e+01});
KRATOS_EXPECT_VECTOR_NEAR(actual_cauchy_stress_vector, expected_cauchy_stress_vector,
Defaults::relative_tolerance);
}

KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateMaterialResponseCauchyAtRegularFailureRegion,
KratosGeoMechanicsFastSuiteWithoutKernel)
{
// Arrange, data are taken from C-Phi reduction test for GPoint 0 of Element 8
constexpr auto cohesion = 900.0;
constexpr auto friction_angle = 27.457076095938259;
auto strain_vector_finalized = Vector(4, 0.0);
auto stress_vector_finalized = UblasUtilities::CreateVector(
{-5.1687704591168895e+03, -1.2121212099273185e+04, -5.1687704591168895e+03, 0.0000000000000000e+00});
auto strain_vector = UblasUtilities::CreateVector({2.0849072892302034e-04, -5.2137806109330782e-05,
0.0000000000000000e+00, 1.3759667604308981e-08});
// Act
const auto actual_cauchy_stress_vector = ComputeStressVectorUsingCPhiReductionTestData(
cohesion, friction_angle, strain_vector_finalized, stress_vector_finalized, strain_vector);
// Assert
const auto expected_cauchy_stress_vector = UblasUtilities::CreateVector(
{-2.1048640257824104e+03, -8.6704134153705982e+03, -3.8658294356694760e+03, 8.3845724538103905e-02});
KRATOS_EXPECT_VECTOR_NEAR(actual_cauchy_stress_vector, expected_cauchy_stress_vector,
Defaults::relative_tolerance);
}

KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateMaterialResponseCauchyAtCornerWithTensionCutoff_1,
KratosGeoMechanicsFastSuiteWithoutKernel)
{
// Arrange, data are taken from C-Phi reduction test for GPoint 1 of Element 8
constexpr auto cohesion = 900.0;
constexpr auto friction_angle = 27.457076095938259;
auto strain_vector_finalized = Vector(4, 0.0);
auto stress_vector_finalized = UblasUtilities::CreateVector(
{-1.2921926147786228e+03, -3.0303030248168902e+03, -1.2921926147786228e+03, 0.0000000000000000e+00});
auto strain_vector = UblasUtilities::CreateVector({2.1223519849231651e-04, -5.3061831008594524e-05,
0.0000000000000000e+00, 8.1947498012640424e-09});
// Act
const auto actual_cauchy_stress_vector = ComputeStressVectorUsingCPhiReductionTestData(
cohesion, friction_angle, strain_vector_finalized, stress_vector_finalized, strain_vector);
// Assert
const auto expected_cauchy_stress_vector = UblasUtilities::CreateVector(
{9.9999999981240751e+02, -2.5265113866824933e+02, 3.4252114252393994e+01, 1.5329308790913803e-02});
KRATOS_EXPECT_VECTOR_NEAR(actual_cauchy_stress_vector, expected_cauchy_stress_vector,
Defaults::absolute_tolerance);
}

KRATOS_TEST_CASE_IN_SUITE(MohrCoulombWithTensionCutOff_CalculateMaterialResponseCauchyAtCornerWithTensionCutoff_2,
KratosGeoMechanicsFastSuiteWithoutKernel)
{
// Arrange, data are taken from C-Phi reduction test for GPoint 2 of Element 8
constexpr auto cohesion = 900.0;
constexpr auto friction_angle = 27.457076095938259;
auto strain_vector_finalized = Vector(4, 0.0);
auto stress_vector_finalized = UblasUtilities::CreateVector(
{-1.2921926147789015e+03, -3.0303030248175442e+03, -1.2921926147789015e+03, 0.0000000000000000e+00});
auto strain_vector = UblasUtilities::CreateVector({2.1221334908075760e-04, -5.3056189639024483e-05,
0.0000000000000000e+00, 3.4835553978606573e-08});
// Act
const auto actual_cauchy_stress_vector = ComputeStressVectorUsingCPhiReductionTestData(
cohesion, friction_angle, strain_vector_finalized, stress_vector_finalized, strain_vector);
// Assert
const auto expected_cauchy_stress_vector = UblasUtilities::CreateVector(
{9.9999999660952608e+02, -2.5265113546536796e+02, 3.4117047235541349e+01, 6.5169629648695174e-02});
KRATOS_EXPECT_VECTOR_NEAR(actual_cauchy_stress_vector, expected_cauchy_stress_vector,
Defaults::absolute_tolerance);
}
} // namespace Kratos::Testing
Loading