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

AsymmetricCrossTermBarrierFunctionMaterial adds a free energy contribution on the interfaces between arbitrary pairs of phases in an asymmetric way, allowing to tune the magnitude of the free energy density cotribution on both sides of the interface independently. More...

#include <AsymmetricCrossTermBarrierFunctionMaterial.h>

Inheritance diagram for AsymmetricCrossTermBarrierFunctionMaterial:
[legend]

Public Member Functions

 AsymmetricCrossTermBarrierFunctionMaterial (const InputParameters &parameters)
 

Protected Member Functions

virtual void computeQpProperties ()
 

Protected Attributes

std::string _function_name
 name of the function of eta (used to generate the material property names) More...
 
unsigned int _g_order
 polynomial order of the switching function \( g(\eta) \) More...
 
std::vector< Real > _W_ij
 barrier function height matrix More...
 
unsigned int _num_eta
 order parameters More...
 
std::vector< VariableName > _eta_names
 
std::vector< const VariableValue * > _eta
 
std::vector< const MaterialProperty< Real > * > _h
 Switching functions and their drivatives. More...
 
std::vector< const MaterialProperty< Real > * > _dh
 
std::vector< const MaterialProperty< Real > * > _d2h
 
MaterialProperty< Real > & _prop_g
 Barrier function and its derivatives. More...
 
std::vector< MaterialProperty< Real > * > _prop_dg
 
std::vector< std::vector< MaterialProperty< Real > * > > _prop_d2g
 

Detailed Description

AsymmetricCrossTermBarrierFunctionMaterial adds a free energy contribution on the interfaces between arbitrary pairs of phases in an asymmetric way, allowing to tune the magnitude of the free energy density cotribution on both sides of the interface independently.

Definition at line 23 of file AsymmetricCrossTermBarrierFunctionMaterial.h.

Constructor & Destructor Documentation

AsymmetricCrossTermBarrierFunctionMaterial::AsymmetricCrossTermBarrierFunctionMaterial ( const InputParameters &  parameters)

Definition at line 21 of file AsymmetricCrossTermBarrierFunctionMaterial.C.

24 {
25  // switching functions
26  const std::vector<MaterialPropertyName> & hi_names =
27  getParam<std::vector<MaterialPropertyName>>("hi_names");
28  if (hi_names.size() != _num_eta)
29  mooseError("The number of coupled etas must be equal to the number of hi_names in "
30  "AsymmetricCrossTermBarrierFunctionMaterial ",
31  name());
32 
33  for (unsigned int i = 0; i < _num_eta; ++i)
34  {
35  _h[i] = &getMaterialProperty<Real>(hi_names[i]);
36  _dh[i] = &getMaterialPropertyDerivative<Real>(hi_names[i], _eta_names[i]);
37  _d2h[i] = &getMaterialPropertyDerivative<Real>(hi_names[i], _eta_names[i], _eta_names[i]);
38  }
39 }
unsigned int _num_eta
order parameters
std::vector< const MaterialProperty< Real > * > _h
Switching functions and their drivatives.
std::vector< VariableName > _eta_names
std::vector< const MaterialProperty< Real > * > _d2h
CrossTermBarrierFunctionBase(const InputParameters &parameters)
std::vector< const MaterialProperty< Real > * > _dh

Member Function Documentation

void AsymmetricCrossTermBarrierFunctionMaterial::computeQpProperties ( )
protectedvirtual

Reimplemented from CrossTermBarrierFunctionBase.

Definition at line 42 of file AsymmetricCrossTermBarrierFunctionMaterial.C.

43 {
44  // Initialize properties to zero before accumulating
46 
47  // Sum the components of our W_ij matrix to get constant used in our g function
48  for (unsigned int i = 0; i < _num_eta; ++i)
49  for (unsigned int j = i + 1; j < _num_eta; ++j)
50  {
51  // readable aliases
52  const Real ni = (*_eta[i])[_qp];
53  const Real nj = (*_eta[j])[_qp];
54 
55  const Real Wij = _W_ij[_num_eta * i + j];
56  const Real Wji = _W_ij[_num_eta * j + i];
57 
58  const Real hi = (*_h[i])[_qp];
59  const Real hj = (*_h[j])[_qp];
60  const Real dhi = (*_dh[i])[_qp];
61  const Real dhj = (*_dh[j])[_qp];
62  const Real d2hi = (*_d2h[i])[_qp];
63  const Real d2hj = (*_d2h[j])[_qp];
64 
65  // raw barrier term and derivatives
66  Real B, dBi, dBj, d2Bii, d2Bjj, d2Bij;
67  switch (_g_order)
68  {
69  case 0: // SIMPLE
70  B = 16.0 * ni * ni * nj * nj;
71  dBi = 16.0 * 2.0 * ni * nj * nj;
72  dBj = 16.0 * 2.0 * ni * ni * nj;
73  d2Bii = 16.0 * 2.0 * nj * nj;
74  d2Bjj = 16.0 * 2.0 * ni * ni;
75  d2Bij = 16.0 * 4.0 * ni * nj;
76  break;
77 
78  case 1: // LOW
79  B = 4.0 * ni * nj;
80  dBi = 4.0 * nj;
81  dBj = 4.0 * ni;
82  d2Bii = 0.0;
83  d2Bjj = 0.0;
84  d2Bij = 4.0;
85  break;
86 
87  default:
88  mooseError("Internal error");
89  }
90 
91  _prop_g[_qp] += (Wij * hi + Wji * hj) * B;
92  // first derivatives
93  (*_prop_dg[i])[_qp] += (Wij * hi + Wji * hj) * dBi + (Wij * dhi) * B;
94  (*_prop_dg[j])[_qp] += (Wij * hi + Wji * hj) * dBj + (Wji * dhj) * B;
95  // second derivatives (diagonal)
96  (*_prop_d2g[i][i])[_qp] +=
97  (Wij * hi + Wji * hj) * d2Bii + 2 * (Wij * dhi) * dBi + (Wij * d2hi) * B;
98  (*_prop_d2g[j][j])[_qp] +=
99  (Wij * hi + Wji * hj) * d2Bjj + 2 * (Wji * dhj) * dBj + (Wji * d2hj) * B;
100  // second derivatives (off-diagonal)
101  (*_prop_d2g[i][j])[_qp] =
102  (Wij * hi + Wji * hj) * (d2Bij) + (Wji * dhj) * dBi + (Wij * dhi) * dBj;
103  }
104 }
std::vector< Real > _W_ij
barrier function height matrix
std::vector< std::vector< MaterialProperty< Real > * > > _prop_d2g
unsigned int _num_eta
order parameters
std::vector< const MaterialProperty< Real > * > _h
Switching functions and their drivatives.
std::vector< MaterialProperty< Real > * > _prop_dg
std::vector< const MaterialProperty< Real > * > _d2h
std::vector< const MaterialProperty< Real > * > _dh
MaterialProperty< Real > & _prop_g
Barrier function and its derivatives.
std::vector< const VariableValue * > _eta
unsigned int _g_order
polynomial order of the switching function

Member Data Documentation

std::vector<const MaterialProperty<Real> *> AsymmetricCrossTermBarrierFunctionMaterial::_d2h
protected
std::vector<const MaterialProperty<Real> *> AsymmetricCrossTermBarrierFunctionMaterial::_dh
protected
std::vector<const VariableValue *> CrossTermBarrierFunctionBase::_eta
protectedinherited
std::vector<VariableName> CrossTermBarrierFunctionBase::_eta_names
protectedinherited
std::string CrossTermBarrierFunctionBase::_function_name
protectedinherited

name of the function of eta (used to generate the material property names)

Definition at line 32 of file CrossTermBarrierFunctionBase.h.

Referenced by CrossTermBarrierFunctionBase::CrossTermBarrierFunctionBase().

unsigned int CrossTermBarrierFunctionBase::_g_order
protectedinherited

polynomial order of the switching function \( g(\eta) \)

Definition at line 35 of file CrossTermBarrierFunctionBase.h.

Referenced by CrossTermBarrierFunctionMaterial::computeQpProperties(), and computeQpProperties().

std::vector<const MaterialProperty<Real> *> AsymmetricCrossTermBarrierFunctionMaterial::_h
protected

Switching functions and their drivatives.

Definition at line 32 of file AsymmetricCrossTermBarrierFunctionMaterial.h.

Referenced by AsymmetricCrossTermBarrierFunctionMaterial(), and computeQpProperties().

unsigned int CrossTermBarrierFunctionBase::_num_eta
protectedinherited
std::vector<std::vector<MaterialProperty<Real> *> > CrossTermBarrierFunctionBase::_prop_d2g
protectedinherited
std::vector<MaterialProperty<Real> *> CrossTermBarrierFunctionBase::_prop_dg
protectedinherited
MaterialProperty<Real>& CrossTermBarrierFunctionBase::_prop_g
protectedinherited
std::vector<Real> CrossTermBarrierFunctionBase::_W_ij
protectedinherited

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