www.mooseframework.org
Public Member Functions | Static 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
 

Static Public Member Functions

static InputParameters validParams ()
 

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

Constructor & Destructor Documentation

◆ HEVPFlowRatePowerLawJ2()

HEVPFlowRatePowerLawJ2::HEVPFlowRatePowerLawJ2 ( const InputParameters &  parameters)

Definition at line 30 of file HEVPFlowRatePowerLawJ2.C.

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

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 70 of file HEVPFlowRatePowerLawJ2.C.

73 {
74  val = 0.0;
75 
76  if (_strength_prop_name == coupled_var_name)
77  {
78  RankTwoTensor pk2_dev = computePK2Deviatoric(_pk2[qp], _ce[qp]);
79  Real eqv_stress = computeEqvStress(pk2_dev, _ce[qp]);
81  std::pow(eqv_stress / _strength[qp], _flow_rate_exponent) / _strength[qp];
82  }
83 
84  return true;
85 }

◆ computeDirection()

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

Implements HEVPFlowRateUOBase.

Definition at line 57 of file HEVPFlowRatePowerLawJ2.C.

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

◆ computeEqvStress()

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

Definition at line 135 of file HEVPFlowRatePowerLawJ2.C.

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

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

◆ computePK2Deviatoric()

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

Definition at line 128 of file HEVPFlowRatePowerLawJ2.C.

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

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

◆ computeTensorDerivative()

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

Implements HEVPFlowRateUOBase.

Definition at line 88 of file HEVPFlowRatePowerLawJ2.C.

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

◆ computeValue()

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

Implements HEVPFlowRateUOBase.

Definition at line 39 of file HEVPFlowRatePowerLawJ2.C.

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

◆ validParams()

InputParameters HEVPFlowRatePowerLawJ2::validParams ( )
static

Definition at line 17 of file HEVPFlowRatePowerLawJ2.C.

18 {
19  InputParameters params = HEVPFlowRateUOBase::validParams();
20  params.addParam<Real>(
21  "reference_flow_rate", 0.001, "Reference flow rate for rate dependent flow");
22  params.addParam<Real>("flow_rate_exponent", 10.0, "Power law exponent in flow rate equation");
23  params.addParam<Real>("flow_rate_tol", 1e3, "Tolerance for flow rate");
24  params.addClassDescription(
25  "User object to evaluate power law flow rate and flow direction based on J2");
26 
27  return params;
28 }

Member Data Documentation

◆ _base_name

const std::string HEVPFlowRateUOBase::_base_name
protectedinherited

Definition at line 40 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 39 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 42 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 41 of file HEVPFlowRateUOBase.h.

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

◆ _strength_prop_name

std::string HEVPFlowRateUOBase::_strength_prop_name
protectedinherited

Definition at line 39 of file HEVPFlowRateUOBase.h.

Referenced by computeDerivative().


The documentation for this class was generated from the following files:
pow
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
Definition: ExpressionBuilder.h:673
HEVPFlowRateUOBase::HEVPFlowRateUOBase
HEVPFlowRateUOBase(const InputParameters &parameters)
Definition: HEVPFlowRateUOBase.C:27
HEVPFlowRatePowerLawJ2::_flow_rate_tol
Real _flow_rate_tol
Definition: HEVPFlowRatePowerLawJ2.h:39
HEVPFlowRatePowerLawJ2::_ref_flow_rate
Real _ref_flow_rate
Definition: HEVPFlowRatePowerLawJ2.h:37
HEVPFlowRatePowerLawJ2::computeEqvStress
Real computeEqvStress(const RankTwoTensor &, const RankTwoTensor &) const
Definition: HEVPFlowRatePowerLawJ2.C:135
HEVPFlowRatePowerLawJ2::computePK2Deviatoric
RankTwoTensor computePK2Deviatoric(const RankTwoTensor &, const RankTwoTensor &) const
Definition: HEVPFlowRatePowerLawJ2.C:128
HEVPFlowRateUOBase::validParams
static InputParameters validParams()
Definition: HEVPFlowRateUOBase.C:15
HEVPFlowRateUOBase::_strength_prop_name
std::string _strength_prop_name
Definition: HEVPFlowRateUOBase.h:39
HEVPFlowRateUOBase::_strength
const MaterialProperty< Real > & _strength
Definition: HEVPFlowRateUOBase.h:41
RankFourTensorTempl
Definition: ACGrGrElasticDrivingForce.h:20
HEVPFlowRateUOBase::_ce
const MaterialProperty< RankTwoTensor > & _ce
Definition: HEVPFlowRateUOBase.h:44
HEVPFlowRateUOBase::_pk2
const MaterialProperty< RankTwoTensor > & _pk2
Definition: HEVPFlowRateUOBase.h:43
HEVPFlowRateUOBase::_pk2_prop_name
std::string _pk2_prop_name
Definition: HEVPFlowRateUOBase.h:42
RankTwoTensorTempl< Real >
HEVPFlowRatePowerLawJ2::_flow_rate_exponent
Real _flow_rate_exponent
Definition: HEVPFlowRatePowerLawJ2.h:38