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 26 of file AsymmetricCrossTermBarrierFunctionMaterial.h.

Constructor & Destructor Documentation

◆ AsymmetricCrossTermBarrierFunctionMaterial()

AsymmetricCrossTermBarrierFunctionMaterial::AsymmetricCrossTermBarrierFunctionMaterial ( const InputParameters &  parameters)

Definition at line 26 of file AsymmetricCrossTermBarrierFunctionMaterial.C.

29 {
30  // switching functions
31  const std::vector<MaterialPropertyName> & hi_names =
32  getParam<std::vector<MaterialPropertyName>>("hi_names");
33  if (hi_names.size() != _num_eta)
34  paramError("hi_names", "The number of hi_names must be equal to the number of coupled etas");
35 
36  for (unsigned int i = 0; i < _num_eta; ++i)
37  {
38  _h[i] = &getMaterialProperty<Real>(hi_names[i]);
39  _dh[i] = &getMaterialPropertyDerivative<Real>(hi_names[i], _eta_names[i]);
40  _d2h[i] = &getMaterialPropertyDerivative<Real>(hi_names[i], _eta_names[i], _eta_names[i]);
41  }
42 }
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

◆ computeQpProperties()

void AsymmetricCrossTermBarrierFunctionMaterial::computeQpProperties ( )
protectedvirtual

Reimplemented from CrossTermBarrierFunctionBase.

Definition at line 45 of file AsymmetricCrossTermBarrierFunctionMaterial.C.

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

◆ _d2h

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

◆ _dh

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

◆ _eta

std::vector<const VariableValue *> CrossTermBarrierFunctionBase::_eta
protectedinherited

◆ _eta_names

std::vector<VariableName> CrossTermBarrierFunctionBase::_eta_names
protectedinherited

◆ _function_name

std::string CrossTermBarrierFunctionBase::_function_name
protectedinherited

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

Definition at line 35 of file CrossTermBarrierFunctionBase.h.

Referenced by CrossTermBarrierFunctionBase::CrossTermBarrierFunctionBase().

◆ _g_order

unsigned int CrossTermBarrierFunctionBase::_g_order
protectedinherited

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

Definition at line 38 of file CrossTermBarrierFunctionBase.h.

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

◆ _h

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

Switching functions and their drivatives.

Definition at line 35 of file AsymmetricCrossTermBarrierFunctionMaterial.h.

Referenced by AsymmetricCrossTermBarrierFunctionMaterial(), and computeQpProperties().

◆ _num_eta

unsigned int CrossTermBarrierFunctionBase::_num_eta
protectedinherited

◆ _prop_d2g

std::vector<std::vector<MaterialProperty<Real> *> > CrossTermBarrierFunctionBase::_prop_d2g
protectedinherited

◆ _prop_dg

std::vector<MaterialProperty<Real> *> CrossTermBarrierFunctionBase::_prop_dg
protectedinherited

◆ _prop_g

MaterialProperty<Real>& CrossTermBarrierFunctionBase::_prop_g
protectedinherited

◆ _W_ij

std::vector<Real> CrossTermBarrierFunctionBase::_W_ij
protectedinherited

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