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 "SolidMechanicsPlasticWeakPlaneTensileN.h" 11 : #include "RotationMatrix.h" // for rotVecToZ 12 : #include "RankFourTensor.h" 13 : 14 : registerMooseObject("SolidMechanicsApp", SolidMechanicsPlasticWeakPlaneTensileN); 15 : registerMooseObjectRenamed("SolidMechanicsApp", 16 : TensorMechanicsPlasticWeakPlaneTensileN, 17 : "01/01/2025 00:00", 18 : SolidMechanicsPlasticWeakPlaneTensileN); 19 : 20 : InputParameters 21 14 : SolidMechanicsPlasticWeakPlaneTensileN::validParams() 22 : { 23 14 : InputParameters params = SolidMechanicsPlasticWeakPlaneTensile::validParams(); 24 28 : params.addRequiredParam<RealVectorValue>("normal_vector", "The normal vector to the weak plane"); 25 14 : params.addClassDescription("Associative weak-plane tensile plasticity with hardening/softening, " 26 : "with specified, fixed normal vector. (WeakPlaneTensile combined " 27 : "with specifying N in the Material might be preferable to you.)"); 28 : 29 14 : return params; 30 0 : } 31 : 32 7 : SolidMechanicsPlasticWeakPlaneTensileN::SolidMechanicsPlasticWeakPlaneTensileN( 33 7 : const InputParameters & parameters) 34 : : SolidMechanicsPlasticWeakPlaneTensile(parameters), 35 7 : _input_n(getParam<RealVectorValue>("normal_vector")), 36 14 : _df_dsig(RankTwoTensor()) 37 : { 38 : // cannot check the following for all values of strength, but this is a start 39 7 : if (_strength.value(0) < 0) 40 0 : mooseError("Weak plane tensile strength must not be negative"); 41 7 : if (_input_n.norm() == 0) 42 0 : mooseError("Weak-plane normal vector must not have zero length"); 43 : else 44 7 : _input_n /= _input_n.norm(); 45 7 : _rot = RotationMatrix::rotVecToZ(_input_n); 46 : 47 28 : for (unsigned i = 0; i < 3; ++i) 48 84 : for (unsigned j = 0; j < 3; ++j) 49 63 : _df_dsig(i, j) = _rot(2, i) * _rot(2, j); 50 7 : } 51 : 52 : Real 53 576 : SolidMechanicsPlasticWeakPlaneTensileN::yieldFunction(const RankTwoTensor & stress, 54 : Real intnl) const 55 : { 56 : Real s22 = 0; 57 2304 : for (unsigned i = 0; i < 3; ++i) 58 6912 : for (unsigned j = 0; j < 3; ++j) 59 5184 : s22 += _rot(2, i) * _rot(2, j) * stress(i, j); 60 576 : return s22 - tensile_strength(intnl); 61 : } 62 : 63 : RankTwoTensor 64 288 : SolidMechanicsPlasticWeakPlaneTensileN::dyieldFunction_dstress(const RankTwoTensor & /*stress*/, 65 : Real /*intnl*/) const 66 : { 67 288 : return _df_dsig; 68 : } 69 : 70 : Real 71 288 : SolidMechanicsPlasticWeakPlaneTensileN::dyieldFunction_dintnl(const RankTwoTensor & /*stress*/, 72 : Real intnl) const 73 : { 74 288 : return -dtensile_strength(intnl); 75 : } 76 : 77 : RankTwoTensor 78 576 : SolidMechanicsPlasticWeakPlaneTensileN::flowPotential(const RankTwoTensor & /*stress*/, 79 : Real /*intnl*/) const 80 : { 81 576 : return _df_dsig; 82 : } 83 : 84 : RankFourTensor 85 288 : SolidMechanicsPlasticWeakPlaneTensileN::dflowPotential_dstress(const RankTwoTensor & /*stress*/, 86 : Real /*intnl*/) const 87 : { 88 288 : return RankFourTensor(); 89 : } 90 : 91 : RankTwoTensor 92 288 : SolidMechanicsPlasticWeakPlaneTensileN::dflowPotential_dintnl(const RankTwoTensor & /*stress*/, 93 : Real /*intnl*/) const 94 : { 95 288 : return RankTwoTensor(); 96 : } 97 : 98 : std::string 99 0 : SolidMechanicsPlasticWeakPlaneTensileN::modelName() const 100 : { 101 0 : return "WeakPlaneTensileN"; 102 : }