https://mooseframework.inl.gov
Loading...
Searching...
No Matches
TwoPhaseStressMaterial.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 "RankTwoTensor.h"
12#include "RankFourTensor.h"
13
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
48void
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
54 _stress[_qp] += _global_extra_stress[_qp];
55
56 _dstress_dstrain[_qp] =
57 _h_eta[_qp] * _dstress_dstrain_B[_qp] + (1.0 - _h_eta[_qp]) * _dstress_dstrain_A[_qp];
58}
registerMooseObject("SolidMechanicsApp", TwoPhaseStressMaterial)
void addRequiredParam(const std::string &name, const std::string &doc_string)
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)
static InputParameters validParams()
Construct a global strain from the phase strains in a manner that is consistent with the construction...
static InputParameters validParams()
const MaterialProperty< RankTwoTensor > & _stress_A
const MaterialProperty< RankFourTensor > & _dstress_dstrain_A
TwoPhaseStressMaterial(const InputParameters &parameters)
MaterialProperty< RankTwoTensor > & _stress
const MaterialProperty< RankTwoTensor > & _global_extra_stress
Global extra stress tensor.
const MaterialProperty< RankTwoTensor > & _stress_B
const MaterialProperty< Real > & _h_eta
MaterialProperty< RankFourTensor > & _dstress_dstrain
const MaterialProperty< RankFourTensor > & _dstress_dstrain_B