https://mooseframework.inl.gov
ParametricMaterialBasePD.C
Go to the documentation of this file.
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 
11 #include "ElasticityTensorTools.h"
12 
13 #include "libmesh/quadrature.h"
14 
17 {
19  params.addClassDescription("Base class for peridynamic models based on derived micro moduli");
20 
21  params.addParam<bool>("plane_stress", false, "Plane stress problem or not");
22  params.addCoupledVar("scalar_out_of_plane_strain",
23  "Scalar variable for strain in the out-of-plane direction");
24  params.addParam<Real>("stress_free_temperature", "Stress free temperature");
25  params.addParam<Real>("thermal_expansion_coeff",
26  "Value of material thermal expansion coefficient");
27 
28  return params;
29 }
30 
32  : MechanicsMaterialBasePD(parameters),
33  _plane_stress(getParam<bool>("plane_stress")),
34  _scalar_out_of_plane_strain_coupled(isCoupledScalar("scalar_out_of_plane_strain")),
35  _scalar_out_of_plane_strain(_scalar_out_of_plane_strain_coupled
36  ? coupledScalarValue("scalar_out_of_plane_strain")
37  : _zero),
38  _temp(2),
39  _temp_ref(_has_temp ? getParam<Real>("stress_free_temperature") : 0.0),
40  _tec(_has_temp ? getParam<Real>("thermal_expansion_coeff") : 0.0),
41  _bond_local_force(declareProperty<Real>("bond_local_force")),
42  _bond_local_dfdU(declareProperty<Real>("bond_dfdU")),
43  _bond_local_dfdT(declareProperty<Real>("bond_dfdT")),
44  _bond_local_dfdE(declareProperty<Real>("bond_local_dfdE")),
45  _thermal_expansion_coeff(declareProperty<Real>("thermal_expansion_coeff")),
46  _Cijkl(getMaterialProperty<RankFourTensor>("elasticity_tensor"))
47 {
49  mooseError("scalar strain can ONLY be specified for 2D analysis!");
50 
52  mooseError("Scalar strain can ONLY be specified for generalized plane strain case!");
53 }
54 
55 void
57 {
58  setupMeshRelatedData(); // function from base class
59  computeBondCurrentLength(); // current length of a bond from base class
60 
61  _temp[0] = _has_temp ? _temp_var->getNodalValue(*_current_elem->node_ptr(0)) : 0.0;
62  _temp[1] = _has_temp ? _temp_var->getNodalValue(*_current_elem->node_ptr(1)) : 0.0;
63 
66 
67  for (_qp = 0; _qp < _nnodes; ++_qp)
68  {
71  }
72 }
73 
74 void
76 {
81  if (_dim == 3 || _scalar_out_of_plane_strain_coupled) // general 3D and generalized plane strain
82  _bulk_modulus = _youngs_modulus / 3.0 / (1.0 - 2.0 * _poissons_ratio);
83  else if (_plane_stress) // plane stress case
85  else // plane strain case
86  _bulk_modulus = _youngs_modulus / 2.0 / (1.0 + _poissons_ratio) / (1.0 - 2.0 * _poissons_ratio);
87 
88  if (_dim == 2 && !_plane_stress && !_scalar_out_of_plane_strain_coupled) // plane strain case
89  _alpha = _tec * (1.0 + _poissons_ratio);
90  else
91  _alpha = _tec;
92 }
93 
94 void
96 {
98 
101  _total_stretch[_qp] - _alpha * (0.5 * (_temp[0] + _temp[1]) - _temp_ref);
102 }
void computeMaterialConstants()
Function to compute material constants from elasticity tensor.
static InputParameters validParams()
auto norm() const -> decltype(std::norm(Real()))
const bool _has_temp
Temperature variables.
const Real _temp_ref
Reference temperature.
const bool _plane_stress
Plane stress problem or not.
const MaterialProperty< RankFourTensor > & _Cijkl
Material properties to fetch.
std::vector< Real > _temp
Temperature variable.
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
const bool _scalar_out_of_plane_strain_coupled
Scalar out-of-plane component of strain tensor for generalized plane strain.
MaterialProperty< Real > & _total_stretch
Material properties to store.
virtual void computeProperties() override
Real _tec
Thermal expension coefficient.
Real _current_len
Length of current bond.
unsigned int _qp
void addCoupledVar(const std::string &name, const std::string &doc_string)
OutputData getNodalValue(const Node &node) const
void setupMeshRelatedData()
Function to setup mesh related data to be used in this class.
MaterialProperty< Real > & _thermal_expansion_coeff
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
T getIsotropicPoissonsRatio(const RankFourTensorTempl< T > &elasticity_tensor)
Get the Poisson&#39;s modulus for an isotropic elasticity tensor param elasticity_tensor the tensor (must...
void mooseError(Args &&... args) const
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()
virtual void computeBondForce()=0
Function to compute force of a bond.
void computeBondCurrentLength()
Function to compute the current bond length.
Base material class for peridynamic solid mechanics models.
MaterialProperty< Real > & _mechanical_stretch
T getIsotropicYoungsModulus(const RankFourTensorTempl< T > &elasticity_tensor)
Get the Young&#39;s modulus for an isotropic elasticity tensor param elasticity_tensor the tensor (must b...
ParametricMaterialBasePD(const InputParameters &parameters)
virtual void computePeridynamicsParams()=0
Function to compute the micro-moduli for bond-based and ordinary state-based models.
virtual void computeBondStretch() override
Function to compute current bond stretch: one dimensional strain.
const Elem *const & _current_elem