https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
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
55void
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
74void
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
94void
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
void addCoupledVar(const std::string &name, const std::string &doc_string)
unsigned int _qp
const Elem *const & _current_elem
Base material class for peridynamic solid mechanics models.
MaterialProperty< Real > & _total_stretch
Material properties to store.
const bool _has_temp
Temperature variables.
Real _current_len
Length of current bond.
void computeBondCurrentLength()
Function to compute the current bond length.
static InputParameters validParams()
MaterialProperty< Real > & _mechanical_stretch
void mooseError(Args &&... args) const
DofValue getNodalValue(const Node &node) const
virtual void computeProperties() override
virtual void computePeridynamicsParams()=0
Function to compute the micro-moduli for bond-based and ordinary state-based models.
static InputParameters validParams()
void computeMaterialConstants()
Function to compute material constants from elasticity tensor.
virtual void computeBondStretch() override
Function to compute current bond stretch: one dimensional strain.
const Real _temp_ref
Reference temperature.
Real _tec
Thermal expension coefficient.
MaterialProperty< Real > & _thermal_expansion_coeff
const MaterialProperty< RankFourTensor > & _Cijkl
Material properties to fetch.
virtual void computeBondForce()=0
Function to compute force of a bond.
std::vector< Real > _temp
Temperature variable.
const bool _plane_stress
Plane stress problem or not.
ParametricMaterialBasePD(const InputParameters &parameters)
const bool _scalar_out_of_plane_strain_coupled
Scalar out-of-plane component of strain tensor for generalized plane strain.
void setupMeshRelatedData()
Function to setup mesh related data to be used in this class.
T getIsotropicYoungsModulus(const RankFourTensorTempl< T > &elasticity_tensor)
Get the Young's modulus for an isotropic elasticity tensor param elasticity_tensor the tensor (must b...
T getIsotropicPoissonsRatio(const RankFourTensorTempl< T > &elasticity_tensor)
Get the Poisson's modulus for an isotropic elasticity tensor param elasticity_tensor the tensor (must...