www.mooseframework.org
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
HEVPFlowRatePowerLawJ2 Class Reference

This user object classs Computes flow rate based on power law and Direction based on J2. More...

#include <HEVPFlowRatePowerLawJ2.h>

Inheritance diagram for HEVPFlowRatePowerLawJ2:
[legend]

Public Member Functions

 HEVPFlowRatePowerLawJ2 (const InputParameters &parameters)
 
virtual bool computeValue (unsigned int, Real &) const
 
virtual bool computeDirection (unsigned int, RankTwoTensor &) const
 
virtual bool computeDerivative (unsigned int, const std::string &, Real &) const
 
virtual bool computeTensorDerivative (unsigned int, const std::string &, RankTwoTensor &) const
 

Protected Member Functions

RankTwoTensor computePK2Deviatoric (const RankTwoTensor &, const RankTwoTensor &) const
 
Real computeEqvStress (const RankTwoTensor &, const RankTwoTensor &) const
 

Protected Attributes

Real _ref_flow_rate
 
Real _flow_rate_exponent
 
Real _flow_rate_tol
 
std::string _strength_prop_name
 
std::string _base_name
 
const MaterialProperty< Real > & _strength
 
std::string _pk2_prop_name
 
const MaterialProperty< RankTwoTensor > & _pk2
 
const MaterialProperty< RankTwoTensor > & _ce
 

Detailed Description

This user object classs Computes flow rate based on power law and Direction based on J2.

Definition at line 25 of file HEVPFlowRatePowerLawJ2.h.

Constructor & Destructor Documentation

◆ HEVPFlowRatePowerLawJ2()

HEVPFlowRatePowerLawJ2::HEVPFlowRatePowerLawJ2 ( const InputParameters &  parameters)

Definition at line 29 of file HEVPFlowRatePowerLawJ2.C.

30  : HEVPFlowRateUOBase(parameters),
31  _ref_flow_rate(getParam<Real>("reference_flow_rate")),
32  _flow_rate_exponent(getParam<Real>("flow_rate_exponent")),
33  _flow_rate_tol(getParam<Real>("flow_rate_tol"))
34 {
35 }
HEVPFlowRateUOBase(const InputParameters &parameters)

Member Function Documentation

◆ computeDerivative()

bool HEVPFlowRatePowerLawJ2::computeDerivative ( unsigned int  qp,
const std::string &  coupled_var_name,
Real &  val 
) const
virtual

Implements HEVPFlowRateUOBase.

Definition at line 69 of file HEVPFlowRatePowerLawJ2.C.

72 {
73  val = 0.0;
74 
75  if (_strength_prop_name == coupled_var_name)
76  {
77  RankTwoTensor pk2_dev = computePK2Deviatoric(_pk2[qp], _ce[qp]);
78  Real eqv_stress = computeEqvStress(pk2_dev, _ce[qp]);
80  std::pow(eqv_stress / _strength[qp], _flow_rate_exponent) / _strength[qp];
81  }
82 
83  return true;
84 }
const MaterialProperty< Real > & _strength
const MaterialProperty< RankTwoTensor > & _pk2
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
Real computeEqvStress(const RankTwoTensor &, const RankTwoTensor &) const
RankTwoTensor computePK2Deviatoric(const RankTwoTensor &, const RankTwoTensor &) const
const MaterialProperty< RankTwoTensor > & _ce
std::string _strength_prop_name

◆ computeDirection()

bool HEVPFlowRatePowerLawJ2::computeDirection ( unsigned int  qp,
RankTwoTensor &  val 
) const
virtual

Implements HEVPFlowRateUOBase.

Definition at line 56 of file HEVPFlowRatePowerLawJ2.C.

57 {
58  RankTwoTensor pk2_dev = computePK2Deviatoric(_pk2[qp], _ce[qp]);
59  Real eqv_stress = computeEqvStress(pk2_dev, _ce[qp]);
60 
61  val.zero();
62  if (eqv_stress > 0.0)
63  val = 1.5 / eqv_stress * _ce[qp] * pk2_dev * _ce[qp];
64 
65  return true;
66 }
const MaterialProperty< RankTwoTensor > & _pk2
Real computeEqvStress(const RankTwoTensor &, const RankTwoTensor &) const
RankTwoTensor computePK2Deviatoric(const RankTwoTensor &, const RankTwoTensor &) const
const MaterialProperty< RankTwoTensor > & _ce

◆ computeEqvStress()

Real HEVPFlowRatePowerLawJ2::computeEqvStress ( const RankTwoTensor &  pk2_dev,
const RankTwoTensor &  ce 
) const
protected

Definition at line 134 of file HEVPFlowRatePowerLawJ2.C.

Referenced by computeDerivative(), computeDirection(), computeTensorDerivative(), and computeValue().

136 {
137  RankTwoTensor sdev = pk2_dev * ce;
138  Real val = sdev.doubleContraction(sdev.transpose());
139  return std::sqrt(1.5 * val);
140 }

◆ computePK2Deviatoric()

RankTwoTensor HEVPFlowRatePowerLawJ2::computePK2Deviatoric ( const RankTwoTensor &  pk2,
const RankTwoTensor &  ce 
) const
protected

Definition at line 127 of file HEVPFlowRatePowerLawJ2.C.

Referenced by computeDerivative(), computeDirection(), computeTensorDerivative(), and computeValue().

129 {
130  return pk2 - (pk2.doubleContraction(ce) * ce.inverse()) / 3.0;
131 }

◆ computeTensorDerivative()

bool HEVPFlowRatePowerLawJ2::computeTensorDerivative ( unsigned int  qp,
const std::string &  coupled_var_name,
RankTwoTensor &  val 
) const
virtual

Implements HEVPFlowRateUOBase.

Definition at line 87 of file HEVPFlowRatePowerLawJ2.C.

90 {
91  val.zero();
92 
93  if (_pk2_prop_name == coupled_var_name)
94  {
95  RankTwoTensor pk2_dev = computePK2Deviatoric(_pk2[qp], _ce[qp]);
96  Real eqv_stress = computeEqvStress(pk2_dev, _ce[qp]);
97  Real dflowrate_dseqv = _ref_flow_rate * _flow_rate_exponent *
98  std::pow(eqv_stress / _strength[qp], _flow_rate_exponent - 1.0) /
99  _strength[qp];
100 
101  RankTwoTensor tau = pk2_dev * _ce[qp];
102  RankTwoTensor dseqv_dpk2dev;
103 
104  dseqv_dpk2dev.zero();
105  if (eqv_stress > 0.0)
106  dseqv_dpk2dev = 1.5 / eqv_stress * tau * _ce[qp];
107 
108  RankTwoTensor ce_inv = _ce[qp].inverse();
109 
110  RankFourTensor dpk2dev_dpk2;
111  for (unsigned int i = 0; i < LIBMESH_DIM; ++i)
112  for (unsigned int j = 0; j < LIBMESH_DIM; ++j)
113  for (unsigned int k = 0; k < LIBMESH_DIM; ++k)
114  for (unsigned int l = 0; l < LIBMESH_DIM; ++l)
115  {
116  dpk2dev_dpk2(i, j, k, l) = 0.0;
117  if (i == k && j == l)
118  dpk2dev_dpk2(i, j, k, l) = 1.0;
119  dpk2dev_dpk2(i, j, k, l) -= ce_inv(i, j) * _ce[qp](k, l) / 3.0;
120  }
121  val = dflowrate_dseqv * dpk2dev_dpk2.transposeMajor() * dseqv_dpk2dev;
122  }
123  return true;
124 }
std::string _pk2_prop_name
const MaterialProperty< Real > & _strength
const MaterialProperty< RankTwoTensor > & _pk2
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
Real computeEqvStress(const RankTwoTensor &, const RankTwoTensor &) const
RankTwoTensor computePK2Deviatoric(const RankTwoTensor &, const RankTwoTensor &) const
const MaterialProperty< RankTwoTensor > & _ce

◆ computeValue()

bool HEVPFlowRatePowerLawJ2::computeValue ( unsigned int  qp,
Real &  val 
) const
virtual

Implements HEVPFlowRateUOBase.

Definition at line 38 of file HEVPFlowRatePowerLawJ2.C.

39 {
40  RankTwoTensor pk2_dev = computePK2Deviatoric(_pk2[qp], _ce[qp]);
41  Real eqv_stress = computeEqvStress(pk2_dev, _ce[qp]);
42  val = std::pow(eqv_stress / _strength[qp], _flow_rate_exponent) * _ref_flow_rate;
43 
44  if (val > _flow_rate_tol)
45  {
46 #ifdef DEBUG
47  mooseWarning(
48  "Flow rate greater than ", _flow_rate_tol, " ", val, " ", eqv_stress, " ", _strength[qp]);
49 #endif
50  return false;
51  }
52  return true;
53 }
const MaterialProperty< Real > & _strength
const MaterialProperty< RankTwoTensor > & _pk2
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
Real computeEqvStress(const RankTwoTensor &, const RankTwoTensor &) const
RankTwoTensor computePK2Deviatoric(const RankTwoTensor &, const RankTwoTensor &) const
const MaterialProperty< RankTwoTensor > & _ce

Member Data Documentation

◆ _base_name

std::string HEVPFlowRateUOBase::_base_name
protectedinherited

Definition at line 39 of file HEVPFlowRateUOBase.h.

◆ _ce

const MaterialProperty<RankTwoTensor>& HEVPFlowRateUOBase::_ce
protectedinherited

◆ _flow_rate_exponent

Real HEVPFlowRatePowerLawJ2::_flow_rate_exponent
protected

◆ _flow_rate_tol

Real HEVPFlowRatePowerLawJ2::_flow_rate_tol
protected

Definition at line 38 of file HEVPFlowRatePowerLawJ2.h.

Referenced by computeValue().

◆ _pk2

const MaterialProperty<RankTwoTensor>& HEVPFlowRateUOBase::_pk2
protectedinherited

◆ _pk2_prop_name

std::string HEVPFlowRateUOBase::_pk2_prop_name
protectedinherited

Definition at line 41 of file HEVPFlowRateUOBase.h.

Referenced by computeTensorDerivative().

◆ _ref_flow_rate

Real HEVPFlowRatePowerLawJ2::_ref_flow_rate
protected

◆ _strength

const MaterialProperty<Real>& HEVPFlowRateUOBase::_strength
protectedinherited

Definition at line 40 of file HEVPFlowRateUOBase.h.

Referenced by computeDerivative(), computeTensorDerivative(), and computeValue().

◆ _strength_prop_name

std::string HEVPFlowRateUOBase::_strength_prop_name
protectedinherited

Definition at line 38 of file HEVPFlowRateUOBase.h.

Referenced by computeDerivative().


The documentation for this class was generated from the following files: