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 22 of file HEVPFlowRatePowerLawJ2.h.

Constructor & Destructor Documentation

HEVPFlowRatePowerLawJ2::HEVPFlowRatePowerLawJ2 ( const InputParameters &  parameters)

Definition at line 24 of file HEVPFlowRatePowerLawJ2.C.

25  : HEVPFlowRateUOBase(parameters),
26  _ref_flow_rate(getParam<Real>("reference_flow_rate")),
27  _flow_rate_exponent(getParam<Real>("flow_rate_exponent")),
28  _flow_rate_tol(getParam<Real>("flow_rate_tol"))
29 {
30 }
HEVPFlowRateUOBase(const InputParameters &parameters)

Member Function Documentation

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

Implements HEVPFlowRateUOBase.

Definition at line 64 of file HEVPFlowRatePowerLawJ2.C.

67 {
68  val = 0.0;
69 
70  if (_strength_prop_name == coupled_var_name)
71  {
72  RankTwoTensor pk2_dev = computePK2Deviatoric(_pk2[qp], _ce[qp]);
73  Real eqv_stress = computeEqvStress(pk2_dev, _ce[qp]);
75  std::pow(eqv_stress / _strength[qp], _flow_rate_exponent) / _strength[qp];
76  }
77 
78  return true;
79 }
Real computeEqvStress(const RankTwoTensor &, const RankTwoTensor &) const
RankTwoTensor computePK2Deviatoric(const RankTwoTensor &, const RankTwoTensor &) const
const MaterialProperty< Real > & _strength
const MaterialProperty< RankTwoTensor > & _pk2
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const MaterialProperty< RankTwoTensor > & _ce
std::string _strength_prop_name
bool HEVPFlowRatePowerLawJ2::computeDirection ( unsigned int  qp,
RankTwoTensor &  val 
) const
virtual

Implements HEVPFlowRateUOBase.

Definition at line 51 of file HEVPFlowRatePowerLawJ2.C.

52 {
53  RankTwoTensor pk2_dev = computePK2Deviatoric(_pk2[qp], _ce[qp]);
54  Real eqv_stress = computeEqvStress(pk2_dev, _ce[qp]);
55 
56  val.zero();
57  if (eqv_stress > 0.0)
58  val = 1.5 / eqv_stress * _ce[qp] * pk2_dev * _ce[qp];
59 
60  return true;
61 }
Real computeEqvStress(const RankTwoTensor &, const RankTwoTensor &) const
RankTwoTensor computePK2Deviatoric(const RankTwoTensor &, const RankTwoTensor &) const
const MaterialProperty< RankTwoTensor > & _pk2
const MaterialProperty< RankTwoTensor > & _ce
Real HEVPFlowRatePowerLawJ2::computeEqvStress ( const RankTwoTensor &  pk2_dev,
const RankTwoTensor &  ce 
) const
protected

Definition at line 129 of file HEVPFlowRatePowerLawJ2.C.

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

131 {
132  RankTwoTensor sdev = pk2_dev * ce;
133  Real val = sdev.doubleContraction(sdev.transpose());
134  return std::sqrt(1.5 * val);
135 }
RankTwoTensor HEVPFlowRatePowerLawJ2::computePK2Deviatoric ( const RankTwoTensor &  pk2,
const RankTwoTensor &  ce 
) const
protected

Definition at line 122 of file HEVPFlowRatePowerLawJ2.C.

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

124 {
125  return pk2 - (pk2.doubleContraction(ce) * ce.inverse()) / 3.0;
126 }
bool HEVPFlowRatePowerLawJ2::computeTensorDerivative ( unsigned int  qp,
const std::string &  coupled_var_name,
RankTwoTensor &  val 
) const
virtual

Implements HEVPFlowRateUOBase.

Definition at line 82 of file HEVPFlowRatePowerLawJ2.C.

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

Implements HEVPFlowRateUOBase.

Definition at line 33 of file HEVPFlowRatePowerLawJ2.C.

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

Member Data Documentation

std::string HEVPFlowRateUOBase::_base_name
protectedinherited

Definition at line 36 of file HEVPFlowRateUOBase.h.

const MaterialProperty<RankTwoTensor>& HEVPFlowRateUOBase::_ce
protectedinherited
Real HEVPFlowRatePowerLawJ2::_flow_rate_exponent
protected
Real HEVPFlowRatePowerLawJ2::_flow_rate_tol
protected

Definition at line 35 of file HEVPFlowRatePowerLawJ2.h.

Referenced by computeValue().

const MaterialProperty<RankTwoTensor>& HEVPFlowRateUOBase::_pk2
protectedinherited
std::string HEVPFlowRateUOBase::_pk2_prop_name
protectedinherited

Definition at line 38 of file HEVPFlowRateUOBase.h.

Referenced by computeTensorDerivative().

Real HEVPFlowRatePowerLawJ2::_ref_flow_rate
protected
const MaterialProperty<Real>& HEVPFlowRateUOBase::_strength
protectedinherited

Definition at line 37 of file HEVPFlowRateUOBase.h.

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

std::string HEVPFlowRateUOBase::_strength_prop_name
protectedinherited

Definition at line 35 of file HEVPFlowRateUOBase.h.

Referenced by computeDerivative().


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