Line data Source code
1 : //* This file is part of the MOOSE framework 2 : //* https://mooseframework.inl.gov 3 : //* 4 : //* All rights reserved, see COPYRIGHT for full restrictions 5 : //* https://github.com/idaholab/moose/blob/master/COPYRIGHT 6 : //* 7 : //* Licensed under LGPL 2.1, please see LICENSE for details 8 : //* https://www.gnu.org/licenses/lgpl-2.1.html 9 : 10 : #include "SolidMechanicsPlasticWeakPlaneTensile.h" 11 : #include "RankFourTensor.h" 12 : 13 : registerMooseObject("SolidMechanicsApp", SolidMechanicsPlasticWeakPlaneTensile); 14 : registerMooseObjectRenamed("SolidMechanicsApp", 15 : TensorMechanicsPlasticWeakPlaneTensile, 16 : "01/01/2025 00:00", 17 : SolidMechanicsPlasticWeakPlaneTensile); 18 : 19 : InputParameters 20 101 : SolidMechanicsPlasticWeakPlaneTensile::validParams() 21 : { 22 101 : InputParameters params = SolidMechanicsPlasticModel::validParams(); 23 202 : params.addParam<Real>("stress_coefficient", 24 202 : 1.0, 25 : "The yield function is stress_coefficient * stress_zz - tensile_strength"); 26 202 : params.addRequiredParam<UserObjectName>("tensile_strength", 27 : "A SolidMechanicsHardening " 28 : "UserObject that defines hardening " 29 : "of the weak-plane tensile strength"); 30 101 : params.addClassDescription("Associative weak-plane tensile plasticity with hardening/softening"); 31 : 32 101 : return params; 33 0 : } 34 : 35 51 : SolidMechanicsPlasticWeakPlaneTensile::SolidMechanicsPlasticWeakPlaneTensile( 36 51 : const InputParameters & parameters) 37 : : SolidMechanicsPlasticModel(parameters), 38 51 : _a(getParam<Real>("stress_coefficient")), 39 102 : _strength(getUserObject<SolidMechanicsHardeningModel>("tensile_strength")) 40 : { 41 : // cannot check the following for all values of strength, but this is a start 42 51 : if (_strength.value(0) < 0) 43 1 : mooseError("Weak plane tensile strength must not be negative"); 44 50 : } 45 : 46 : Real 47 139072 : SolidMechanicsPlasticWeakPlaneTensile::yieldFunction(const RankTwoTensor & stress, Real intnl) const 48 : { 49 139072 : return _a * stress(2, 2) - tensile_strength(intnl); 50 : } 51 : 52 : RankTwoTensor 53 39472 : SolidMechanicsPlasticWeakPlaneTensile::dyieldFunction_dstress(const RankTwoTensor & /*stress*/, 54 : Real /*intnl*/) const 55 : { 56 39472 : RankTwoTensor df_dsig; 57 39472 : df_dsig(2, 2) = _a; 58 39472 : return df_dsig; 59 : } 60 : 61 : Real 62 39472 : SolidMechanicsPlasticWeakPlaneTensile::dyieldFunction_dintnl(const RankTwoTensor & /*stress*/, 63 : Real intnl) const 64 : { 65 39472 : return -dtensile_strength(intnl); 66 : } 67 : 68 : RankTwoTensor 69 107060 : SolidMechanicsPlasticWeakPlaneTensile::flowPotential(const RankTwoTensor & /*stress*/, 70 : Real /*intnl*/) const 71 : { 72 107060 : RankTwoTensor df_dsig; 73 107060 : df_dsig(2, 2) = _a; 74 107060 : return df_dsig; 75 : } 76 : 77 : RankFourTensor 78 39472 : SolidMechanicsPlasticWeakPlaneTensile::dflowPotential_dstress(const RankTwoTensor & /*stress*/, 79 : Real /*intnl*/) const 80 : { 81 39472 : return RankFourTensor(); 82 : } 83 : 84 : RankTwoTensor 85 39472 : SolidMechanicsPlasticWeakPlaneTensile::dflowPotential_dintnl(const RankTwoTensor & /*stress*/, 86 : Real /*intnl*/) const 87 : { 88 39472 : return RankTwoTensor(); 89 : } 90 : 91 : Real 92 151740 : SolidMechanicsPlasticWeakPlaneTensile::tensile_strength(const Real internal_param) const 93 : { 94 151740 : return _strength.value(internal_param); 95 : } 96 : 97 : Real 98 39664 : SolidMechanicsPlasticWeakPlaneTensile::dtensile_strength(const Real internal_param) const 99 : { 100 39664 : return _strength.derivative(internal_param); 101 : } 102 : 103 : void 104 18164 : SolidMechanicsPlasticWeakPlaneTensile::activeConstraints(const std::vector<Real> & f, 105 : const RankTwoTensor & stress, 106 : Real intnl, 107 : const RankFourTensor & Eijkl, 108 : std::vector<bool> & act, 109 : RankTwoTensor & returned_stress) const 110 : { 111 : act.assign(1, false); 112 : 113 18164 : if (f[0] <= _f_tol) 114 : { 115 5880 : returned_stress = stress; 116 5880 : return; 117 : } 118 : 119 12284 : Real str = tensile_strength(intnl); 120 : 121 12284 : RankTwoTensor n; // flow direction 122 49136 : for (unsigned i = 0; i < 3; ++i) 123 147408 : for (unsigned j = 0; j < 3; ++j) 124 110556 : n(i, j) = _a * Eijkl(i, j, 2, 2); 125 : 126 : // returned_stress = _a * stress - alpha*n 127 : // where alpha = (_a * stress(2, 2) - str)/n(2, 2) 128 12284 : Real alpha = (_a * stress(2, 2) - str) / n(2, 2); 129 : 130 49136 : for (unsigned i = 0; i < 3; ++i) 131 147408 : for (unsigned j = 0; j < 3; ++j) 132 110556 : returned_stress(i, j) = _a * stress(i, j) - alpha * n(i, j); 133 : 134 : act[0] = true; 135 : } 136 : 137 : std::string 138 6 : SolidMechanicsPlasticWeakPlaneTensile::modelName() const 139 : { 140 6 : return "WeakPlaneTensile"; 141 : }