www.mooseframework.org
TwoPhaseStressMaterial.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 "TwoPhaseStressMaterial.h"
11 #include "RankTwoTensor.h"
12 #include "RankFourTensor.h"
13 
14 registerMooseObject("SolidMechanicsApp", TwoPhaseStressMaterial);
15 
18 {
20  params.addClassDescription("Compute a global stress in a two phase model");
21  params.addParam<MaterialPropertyName>(
22  "h", "h", "Switching Function Material that provides h(eta)");
23  params.addRequiredParam<std::string>("base_A", "Base name for the Phase A strain.");
24  params.addRequiredParam<std::string>("base_B", "Base name for the Phase B strain.");
25  params.addParam<std::string>("base_name", "Base name for the computed global stress (optional).");
26  return params;
27 }
28 
31  _h_eta(getMaterialProperty<Real>("h")),
32 
33  _base_A(getParam<std::string>("base_A") + "_"),
34  _stress_A(getMaterialPropertyByName<RankTwoTensor>(_base_A + "stress")),
35  _dstress_dstrain_A(getMaterialPropertyByName<RankFourTensor>(_base_A + "Jacobian_mult")),
36 
37  _base_B(getParam<std::string>("base_B") + "_"),
38  _stress_B(getMaterialPropertyByName<RankTwoTensor>(_base_B + "stress")),
39  _dstress_dstrain_B(getMaterialPropertyByName<RankFourTensor>(_base_B + "Jacobian_mult")),
40 
41  _base_name(isParamValid("base_name") ? getParam<std::string>("base_name") + "_" : ""),
42  _stress(declareProperty<RankTwoTensor>(_base_name + "stress")),
43  _dstress_dstrain(declareProperty<RankFourTensor>(_base_name + "Jacobian_mult")),
44  _global_extra_stress(getDefaultMaterialProperty<RankTwoTensor>("extra_stress"))
45 {
46 }
47 
48 void
50 {
51  _stress[_qp] = _h_eta[_qp] * _stress_B[_qp] + (1.0 - _h_eta[_qp]) * _stress_A[_qp];
52 
53  // Add in global extra stress
55 
58 }
registerMooseObject("SolidMechanicsApp", TwoPhaseStressMaterial)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
const MaterialProperty< RankTwoTensor > & _global_extra_stress
Global extra stress tensor.
const MaterialProperty< RankTwoTensor > & _stress_A
Construct a global strain from the phase strains in a manner that is consistent with the construction...
MaterialProperty< RankTwoTensor > & _stress
void addRequiredParam(const std::string &name, const std::string &doc_string)
const MaterialProperty< RankFourTensor > & _dstress_dstrain_B
static InputParameters validParams()
TwoPhaseStressMaterial(const InputParameters &parameters)
MaterialProperty< RankFourTensor > & _dstress_dstrain
static InputParameters validParams()
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const MaterialProperty< RankTwoTensor > & _stress_B
void addClassDescription(const std::string &doc_string)
const MaterialProperty< RankFourTensor > & _dstress_dstrain_A
const MaterialProperty< Real > & _h_eta