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 "SolidMechanicsPlasticSimpleTester.h"
11 : #include "RankFourTensor.h"
12 :
13 : registerMooseObject("SolidMechanicsApp", SolidMechanicsPlasticSimpleTester);
14 : registerMooseObjectRenamed("SolidMechanicsApp",
15 : TensorMechanicsPlasticSimpleTester,
16 : "01/01/2025 00:00",
17 : SolidMechanicsPlasticSimpleTester);
18 :
19 : InputParameters
20 1672 : SolidMechanicsPlasticSimpleTester::validParams()
21 : {
22 1672 : InputParameters params = SolidMechanicsPlasticModel::validParams();
23 3344 : params.addRequiredParam<Real>("a",
24 : "Yield function = a*stress_yy + b*stress_zz + c*stress_xx + "
25 : "d*(stress_xy + stress_yx)/2 + e*(stress_xz + stress_zx)/2 + "
26 : "f*(stress_yz + stress_zy)/2 - strength");
27 3344 : params.addRequiredParam<Real>("b",
28 : "Yield function = a*stress_yy + b*stress_zz + c*stress_xx + "
29 : "d*(stress_xy + stress_yx)/2 + e*(stress_xz + stress_zx)/2 + "
30 : "f*(stress_yz + stress_zy)/2 - strength");
31 3344 : params.addParam<Real>("c",
32 3344 : 0,
33 : "Yield function = a*stress_yy + b*stress_zz + c*stress_xx + "
34 : "d*(stress_xy + stress_yx)/2 + e*(stress_xz + stress_zx)/2 + "
35 : "f*(stress_yz + stress_zy)/2 - strength");
36 3344 : params.addParam<Real>("d",
37 3344 : 0,
38 : "Yield function = a*stress_yy + b*stress_zz + c*stress_xx + "
39 : "d*(stress_xy + stress_yx)/2 + e*(stress_xz + stress_zx)/2 + "
40 : "f*(stress_yz + stress_zy)/2 - strength");
41 3344 : params.addParam<Real>("e",
42 3344 : 0,
43 : "Yield function = a*stress_yy + b*stress_zz + c*stress_xx + "
44 : "d*(stress_xy + stress_yx)/2 + e*(stress_xz + stress_zx)/2 + "
45 : "f*(stress_yz + stress_zy)/2 - strength");
46 3344 : params.addParam<Real>("f",
47 3344 : 0,
48 : "Yield function = a*stress_yy + b*stress_zz + c*stress_xx + "
49 : "d*(stress_xy + stress_yx)/2 + e*(stress_xz + stress_zx)/2 + "
50 : "f*(stress_yz + stress_zy)/2 - strength");
51 3344 : params.addRequiredParam<Real>("strength",
52 : "Yield function = a*stress_yy + b*stress_zz + "
53 : "c*stress_xx + d*(stress_xy + stress_yx)/2 + "
54 : "e*(stress_xz + stress_zx)/2 + f*(stress_yz + "
55 : "stress_zy)/2 - strength");
56 1672 : params.addClassDescription("Class that can be used for testing multi-surface plasticity models. "
57 : "Yield function = a*stress_yy + b*stress_zz + c*stress_xx + "
58 : "d*(stress_xy + stress_yx)/2 + e*(stress_xz + stress_zx)/2 + "
59 : "f*(stress_yz + stress_zy)/2 - strength");
60 :
61 1672 : return params;
62 0 : }
63 :
64 836 : SolidMechanicsPlasticSimpleTester::SolidMechanicsPlasticSimpleTester(
65 836 : const InputParameters & parameters)
66 : : SolidMechanicsPlasticModel(parameters),
67 836 : _a(getParam<Real>("a")),
68 1672 : _b(getParam<Real>("b")),
69 1672 : _c(getParam<Real>("c")),
70 1672 : _d(getParam<Real>("d")),
71 1672 : _e(getParam<Real>("e")),
72 1672 : _f(getParam<Real>("f")),
73 2508 : _strength(getParam<Real>("strength"))
74 : {
75 836 : }
76 :
77 : Real
78 476546 : SolidMechanicsPlasticSimpleTester::yieldFunction(const RankTwoTensor & stress, Real /*intnl*/) const
79 : {
80 476546 : return _a * stress(1, 1) + _b * stress(2, 2) + _c * stress(0, 0) +
81 476546 : _d * (stress(0, 1) + stress(1, 0)) / 2.0 + _e * (stress(0, 2) + stress(2, 0)) / 2.0 +
82 476546 : _f * (stress(1, 2) + stress(2, 1)) / 2.0 - _strength;
83 : }
84 :
85 : RankTwoTensor
86 607678 : SolidMechanicsPlasticSimpleTester::dyieldFunction_dstress(const RankTwoTensor & /*stress*/,
87 : Real /*intnl*/) const
88 : {
89 607678 : RankTwoTensor df_dsig;
90 607678 : df_dsig(1, 1) = _a;
91 607678 : df_dsig(2, 2) = _b;
92 607678 : df_dsig(0, 0) = _c;
93 607678 : df_dsig(0, 1) = _d / 2.0;
94 607678 : df_dsig(1, 0) = _d / 2.0;
95 607678 : df_dsig(0, 2) = _e / 2.0;
96 607678 : df_dsig(2, 0) = _e / 2.0;
97 607678 : df_dsig(1, 2) = _f / 2.0;
98 607678 : df_dsig(2, 1) = _f / 2.0;
99 607678 : return df_dsig;
100 : }
101 :
102 : Real
103 78564 : SolidMechanicsPlasticSimpleTester::dyieldFunction_dintnl(const RankTwoTensor & /*stress*/,
104 : Real /*intnl*/) const
105 : {
106 78564 : return 0.0;
107 : }
108 :
109 : RankTwoTensor
110 421716 : SolidMechanicsPlasticSimpleTester::flowPotential(const RankTwoTensor & stress, Real intnl) const
111 : {
112 421716 : return dyieldFunction_dstress(stress, intnl);
113 : }
114 :
115 : RankFourTensor
116 144886 : SolidMechanicsPlasticSimpleTester::dflowPotential_dstress(const RankTwoTensor & /*stress*/,
117 : Real /*intnl*/) const
118 : {
119 144886 : return RankFourTensor();
120 : }
121 :
122 : RankTwoTensor
123 144886 : SolidMechanicsPlasticSimpleTester::dflowPotential_dintnl(const RankTwoTensor & /*stress*/,
124 : Real /*intnl*/) const
125 : {
126 144886 : return RankTwoTensor();
127 : }
128 :
129 : std::string
130 0 : SolidMechanicsPlasticSimpleTester::modelName() const
131 : {
132 0 : return "SimpleTester";
133 : }
|