www.mooseframework.org
LinearIsotropicMaterial.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 
9 #include "ColumnMajorMatrix.h"
10 #include "SolidMechanicsMaterial.h"
12 #include "VolumetricModel.h"
13 
14 #include "libmesh/quadrature.h"
15 
16 template <>
17 InputParameters
19 {
20  InputParameters params = validParams<SolidMechanicsMaterial>();
21  params.addRequiredParam<Real>("youngs_modulus", "Young's Modulus");
22  params.addRequiredParam<Real>("poissons_ratio", "Poisson's Ratio");
23  params.addParam<Real>(
24  "t_ref", 0.0, "The reference temperature at which this material has zero strain.");
25  params.addParam<Real>("thermal_expansion", 0.0, "The thermal expansion coefficient.");
26  return params;
27 }
28 
29 LinearIsotropicMaterial::LinearIsotropicMaterial(const InputParameters & parameters)
30  : SolidMechanicsMaterial(parameters),
31  _youngs_modulus(getParam<Real>("youngs_modulus")),
32  _poissons_ratio(getParam<Real>("poissons_ratio")),
33  _t_ref(getParam<Real>("t_ref")),
34  _alpha(getParam<Real>("thermal_expansion")),
35  _local_elasticity_tensor(NULL)
36 {
38  iso_elasticity_tensor->setYoungsModulus(_youngs_modulus);
39  iso_elasticity_tensor->setPoissonsRatio(_poissons_ratio);
40 
41  _local_elasticity_tensor = iso_elasticity_tensor;
42 
43  _pi = 3.14159;
44  _tol = 1.0e-5;
45 }
46 
48 
49 void
51 {
52  for (_qp = 0; _qp < _qrule->n_points(); ++_qp)
53  {
54  Real alpha = computeAlpha();
55 
57 
59 
60  SymmTensor strn(_grad_disp_x[_qp](0),
61  _grad_disp_y[_qp](1),
62  _grad_disp_z[_qp](2),
63  0.5 * (_grad_disp_x[_qp](1) + _grad_disp_y[_qp](0)),
64  0.5 * (_grad_disp_y[_qp](2) + _grad_disp_z[_qp](1)),
65  0.5 * (_grad_disp_z[_qp](0) + _grad_disp_x[_qp](2)));
66 
67  // Add in Isotropic Thermal Strain
68  if (_has_temp)
69  {
70  Real isotropic_strain = alpha * (_temp[_qp] - _t_ref);
71 
72  strn.addDiag(-isotropic_strain);
73 
75  _d_strain_dT.addDiag(-alpha);
76  }
77 
78  SymmTensor strain(strn);
79 
80  computeStress(strain, _stress[_qp]);
81  }
82 }
83 
84 void
86 {
87  // Add in any extra strain components
88  SymmTensor elastic_strain;
89 
90  computeStrain(strain, elastic_strain);
91 
92  // Multiplier that zeros out stiffness
93  // Real h = (1.0 - _c[_qp]*_c[_qp]);
94  /*Real vl = -0.05 + _c[_qp]*1.1;
95  if (vl < 0.0)
96  vl = 0.0;
97  if (vl > 1.0)
98  vl = 1.0;*/
99 
100  Real h = (1.0 + std::cos(_pi * _c[_qp])) / 2.0;
101  if (h < _tol)
102  h = _tol;
103 
104  // Save that off as the elastic strain
105  _elastic_strain[_qp] = elastic_strain;
106 
107  // Create column vector
108  // C * e
109  stress = (*_local_elasticity_tensor) * h * elastic_strain;
110 }
111 
112 void
113 LinearIsotropicMaterial::computeStrain(const SymmTensor & total_strain, SymmTensor & elastic_strain)
114 {
115 
116  // Multiplier that zeros out stiffness
117  // Real h = (1.0 - _c[_qp]*_c[_qp]);
118  /*Real vl = -0.05 + _c[_qp]*1.1;
119  if (vl < 0.0)
120  vl = 0.0;
121  if (vl > 1.0)
122  vl = 1.0;*/
123 
124  Real h = (1.0 + std::cos(_pi * _c[_qp])) / 2.0;
125  if (h < _tol)
126  h = _tol;
127 
128  elastic_strain = total_strain;
129  // Jacobian multiplier of the stress
131 
133  // d_stress_dT *= _dt;
134  d_stress_dT *= h;
135  _d_stress_dT[_qp] = d_stress_dT;
136 }
137 
138 Real
140 {
141  return _alpha;
142 }
const VariableValue & _c
SolidMechanics material for use in simple applications that don&#39;t need material properties.
InputParameters validParams< LinearIsotropicMaterial >()
MaterialProperty< SymmTensor > & _elastic_strain
const VariableValue & _temp
const VariableGradient & _grad_disp_y
LinearIsotropicMaterial(const InputParameters &parameters)
const VariableGradient & _grad_disp_x
MaterialProperty< SymmElasticityTensor > & _elasticity_tensor
InputParameters validParams< SolidMechanicsMaterial >()
void zero()
Definition: SymmTensor.h:273
void calculate(unsigned int qp)
Public function that will be called whenever the values for this matrix need to be filled in...
MaterialProperty< SymmTensor > & _stress
const VariableGradient & _grad_disp_z
void addDiag(Real value)
Definition: SymmTensor.h:279
void setYoungsModulus(const Real E)
Set the Young&#39;s Modulus.
MaterialProperty< SymmElasticityTensor > & _Jacobian_mult
virtual void computeStrain(const SymmTensor &total_strain, SymmTensor &elastic_strain)
Will always be passed to full symmetric strain tensor.
SymmElasticityTensor * _local_elasticity_tensor
MaterialProperty< SymmTensor > & _d_stress_dT
Defines an Isotropic Elasticity Tensor.
virtual void computeStress(const SymmTensor &strain, SymmTensor &stress)
void setPoissonsRatio(const Real nu)
Set Poissons Ratio.