Permalink
Browse files

Merge pull request #12676 from laagesen/twophaseextrastress_12675

Modify TwoPhaseStressMaterial to allow a global extra_stress
  • Loading branch information...
rwcarlsen committed Jan 11, 2019
2 parents e431f47 + 859e19f commit ca90e12e110de4c0ec347b44b0738991466634c2
@@ -11,6 +11,7 @@
#define TWOPHASESTRESSMATERIAL_H

#include "Material.h"
#include "DerivativeMaterialInterface.h"

// Forward Declarations
class TwoPhaseStressMaterial;
@@ -28,7 +29,7 @@ InputParameters validParams<TwoPhaseStressMaterial>();
* Construct a global strain from the phase strains in a manner that is consistent
* with the construction of the global elastic energy by DerivativeTwoPhaseMaterial.
*/
class TwoPhaseStressMaterial : public Material
class TwoPhaseStressMaterial : public DerivativeMaterialInterface<Material>
{
public:
TwoPhaseStressMaterial(const InputParameters & parameters);
@@ -53,6 +54,9 @@ class TwoPhaseStressMaterial : public Material
std::string _base_name;
MaterialProperty<RankTwoTensor> & _stress;
MaterialProperty<RankFourTensor> & _dstress_dstrain;

/// Global extra stress tensor
const MaterialProperty<RankTwoTensor> & _global_extra_stress;
};

#endif // TWOPHASESTRESSMATERIAL_H
@@ -28,7 +28,7 @@ validParams<TwoPhaseStressMaterial>()
}

TwoPhaseStressMaterial::TwoPhaseStressMaterial(const InputParameters & parameters)
: Material(parameters),
: DerivativeMaterialInterface<Material>(parameters),
_h_eta(getMaterialProperty<Real>("h")),

_base_A(getParam<std::string>("base_A") + "_"),
@@ -41,14 +41,19 @@ TwoPhaseStressMaterial::TwoPhaseStressMaterial(const InputParameters & parameter

_base_name(isParamValid("base_name") ? getParam<std::string>("base_name") + "_" : ""),
_stress(declareProperty<RankTwoTensor>(_base_name + "stress")),
_dstress_dstrain(declareProperty<RankFourTensor>(_base_name + "Jacobian_mult"))
_dstress_dstrain(declareProperty<RankFourTensor>(_base_name + "Jacobian_mult")),
_global_extra_stress(getDefaultMaterialProperty<RankTwoTensor>("extra_stress"))
{
}

void
TwoPhaseStressMaterial::computeQpProperties()
{
_stress[_qp] = _h_eta[_qp] * _stress_B[_qp] + (1.0 - _h_eta[_qp]) * _stress_A[_qp];

// Add in global extra stress
_stress[_qp] += _global_extra_stress[_qp];

_dstress_dstrain[_qp] =
_h_eta[_qp] * _dstress_dstrain_B[_qp] + (1.0 - _h_eta[_qp]) * _dstress_dstrain_A[_qp];
}

0 comments on commit ca90e12

Please sign in to comment.