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

Multi phase free energy material that combines an arbitrary number of phase free energies to a global free energy. More...

#include <DerivativeMultiPhaseMaterial.h>

Inheritance diagram for DerivativeMultiPhaseMaterial:
[legend]

Public Member Functions

 DerivativeMultiPhaseMaterial (const InputParameters &parameters)
 
virtual void initialSetup ()
 

Protected Member Functions

virtual Real computeDF (unsigned int i_var)
 
virtual Real computeD2F (unsigned int i_var, unsigned int j_var)
 
virtual Real computeD3F (unsigned int i_var, unsigned int j_var, unsigned int k_var)
 
virtual Real computeF ()
 

Protected Attributes

std::vector< const MaterialProperty< Real > * > _dhi
 Function value of the i phase. More...
 
std::vector< const MaterialProperty< Real > * > _d2hi
 
std::vector< const MaterialProperty< Real > * > _d3hi
 
std::vector< int > _eta_index
 If the variable a non-conserved OP this array holds the index into the etas parameter vector for a given arg index, otherwise it holds -1. More...
 
std::vector< VariableValue * > _etas
 Phase parameter (0=A-phase, 1=B-phase) More...
 
unsigned int _num_etas
 name of the order parameter variable More...
 
std::vector< VariableName > _eta_names
 
std::vector< unsigned int > _eta_vars
 
std::vector< MaterialPropertyName > _fi_names
 phase derivative material names More...
 
unsigned int _num_fi
 
std::vector< const MaterialProperty< Real > * > _prop_Fi
 Function value of the i phase. More...
 
std::vector< std::vector< const MaterialProperty< Real > * > > _prop_dFi
 Derivatives of Fi w.r.t. arg[i]. More...
 
std::vector< std::vector< std::vector< const MaterialProperty< Real > * > > > _prop_d2Fi
 Second derivatives of Fi. More...
 
std::vector< std::vector< std::vector< std::vector< const MaterialProperty< Real > * > > > > _prop_d3Fi
 Third derivatives of Fi. More...
 
std::vector< MaterialPropertyName > _hi_names
 phase switching function names More...
 
unsigned int _num_hi
 
std::vector< const MaterialProperty< Real > * > _hi
 Switching functions. More...
 
MaterialPropertyName _g_name
 Barrier function name. More...
 
const MaterialProperty< Real > & _g
 Barrier function \( g(\eta_0, \eta_1, \dots, \eta_{n-1}) \). More...
 
std::vector< const MaterialProperty< Real > * > _dg
 Barrier function derivatives. More...
 
std::vector< std::vector< const MaterialProperty< Real > * > > _d2g
 
std::vector< std::vector< std::vector< const MaterialProperty< Real > * > > > _d3g
 
Real _W
 Phase transformation energy barrier. More...
 

Detailed Description

Multi phase free energy material that combines an arbitrary number of phase free energies to a global free energy.

All switching functions are assumed to depend only on their respective order parameter.

Definition at line 25 of file DerivativeMultiPhaseMaterial.h.

Constructor & Destructor Documentation

◆ DerivativeMultiPhaseMaterial()

DerivativeMultiPhaseMaterial::DerivativeMultiPhaseMaterial ( const InputParameters &  parameters)

Definition at line 26 of file DerivativeMultiPhaseMaterial.C.

28 {
29  // verify that the user supplied one less eta than the number of phases
30  if (_num_hi != _num_etas)
31  paramError("hi_names", "The number of hi_names must be equal to the number of coupled etas");
32 
33  for (unsigned int i = 0; i < _num_etas; ++i)
34  {
35  _dhi[i] = &getMaterialPropertyDerivative<Real>(_hi_names[i], _eta_names[i]);
36  _d2hi[i] = &getMaterialPropertyDerivative<Real>(_hi_names[i], _eta_names[i], _eta_names[i]);
37 
38  if (_third_derivatives)
39  _d3hi[i] = &getMaterialPropertyDerivative<Real>(
40  _hi_names[i], _eta_names[i], _eta_names[i], _eta_names[i]);
41  }
42 }
std::vector< const MaterialProperty< Real > * > _d2hi
std::vector< MaterialPropertyName > _hi_names
phase switching function names
unsigned int _num_etas
name of the order parameter variable
std::vector< const MaterialProperty< Real > * > _d3hi
std::vector< VariableName > _eta_names
DerivativeMultiPhaseBase(const InputParameters &parameters)
std::vector< const MaterialProperty< Real > * > _dhi
Function value of the i phase.

Member Function Documentation

◆ computeD2F()

Real DerivativeMultiPhaseMaterial::computeD2F ( unsigned int  i_var,
unsigned int  j_var 
)
protectedvirtual

Definition at line 62 of file DerivativeMultiPhaseMaterial.C.

63 {
64  const unsigned int i = argIndex(i_var);
65  const int i_eta = _eta_index[i];
66  const unsigned int j = argIndex(j_var);
67  const int j_eta = _eta_index[j];
68 
69  // all arguments are eta-variables
70 
71  if (i_eta >= 0 && j_eta >= 0)
72  {
73  // if the derivatives are taken w.r.t. a single eta the d2hi term for eta_i appears, otherwise
74  // it drops out
75  // because we assume that hi _only_ depends on eta_i
76  Real d2F = (i_eta == j_eta) ? (*_d2hi[i_eta])[_qp] * (*_prop_Fi[i_eta])[_qp] : 0.0;
77 
78  return d2F + _W * (*_d2g[i_eta][j_eta])[_qp];
79  }
80 
81  // one argument is an eta-variable
82 
83  if (i_eta >= 0)
84  return (*_dhi[i_eta])[_qp] * (*_prop_dFi[i_eta][j])[_qp];
85 
86  if (j_eta >= 0)
87  return (*_dhi[j_eta])[_qp] * (*_prop_dFi[j_eta][i])[_qp];
88 
89  // no arguments are eta-variables
90 
91  Real d2F = 0.0;
92  for (unsigned n = 0; n < _num_fi; ++n)
93  d2F += (*_hi[n])[_qp] * (*_prop_d2Fi[n][i][j])[_qp];
94  return d2F;
95 }
std::vector< std::vector< std::vector< const MaterialProperty< Real > * > > > _prop_d2Fi
Second derivatives of Fi.
std::vector< const MaterialProperty< Real > * > _d2hi
Real _W
Phase transformation energy barrier.
std::vector< const MaterialProperty< Real > * > _hi
Switching functions.
std::vector< std::vector< const MaterialProperty< Real > * > > _d2g
std::vector< int > _eta_index
If the variable a non-conserved OP this array holds the index into the etas parameter vector for a gi...
std::vector< const MaterialProperty< Real > * > _prop_Fi
Function value of the i phase.
std::vector< std::vector< const MaterialProperty< Real > * > > _prop_dFi
Derivatives of Fi w.r.t. arg[i].
std::vector< const MaterialProperty< Real > * > _dhi
Function value of the i phase.

◆ computeD3F()

Real DerivativeMultiPhaseMaterial::computeD3F ( unsigned int  i_var,
unsigned int  j_var,
unsigned int  k_var 
)
protectedvirtual

Definition at line 98 of file DerivativeMultiPhaseMaterial.C.

99 {
100  const unsigned int i = argIndex(i_var);
101  const int i_eta = _eta_index[i];
102  const unsigned int j = argIndex(j_var);
103  const int j_eta = _eta_index[j];
104  const unsigned int k = argIndex(k_var);
105  const int k_eta = _eta_index[k];
106 
107  // all arguments are eta-variables
108 
109  if (i_eta >= 0 && j_eta >= 0 && k_eta >= 0)
110  {
111  // if the derivatives are taken w.r.t. a single eta the d3hi term for eta_i appears, otherwise
112  // it drops out
113  // because we assume that hi _only_ depends on eta_i
114  Real d3F =
115  (i_eta == j_eta && j_eta == k_eta) ? (*_d3hi[i_eta])[_qp] * (*_prop_Fi[i_eta])[_qp] : 0.0;
116 
117  return d3F + _W * (*_d3g[i_eta][j_eta][k_eta])[_qp];
118  }
119 
120  // two arguments are eta-variables
121 
122  if (i_eta >= 0 && j_eta >= 0)
123  return (i_eta == j_eta) ? (*_d2hi[i_eta])[_qp] * (*_prop_dFi[i_eta][k])[_qp] : 0.0;
124 
125  if (j_eta >= 0 && k_eta >= 0)
126  return (j_eta == k_eta) ? (*_d2hi[j_eta])[_qp] * (*_prop_dFi[j_eta][i])[_qp] : 0.0;
127 
128  if (k_eta >= 0 && i_eta >= 0)
129  return (k_eta == i_eta) ? (*_d2hi[k_eta])[_qp] * (*_prop_dFi[k_eta][j])[_qp] : 0.0;
130 
131  // one argument is an eta-variable
132 
133  if (i_eta >= 0)
134  return (*_dhi[i_eta])[_qp] * (*_prop_d2Fi[i_eta][j][k])[_qp];
135 
136  if (j_eta >= 0)
137  return (*_dhi[j_eta])[_qp] * (*_prop_d2Fi[j_eta][i][k])[_qp];
138 
139  if (k_eta >= 0)
140  return (*_dhi[k_eta])[_qp] * (*_prop_d2Fi[k_eta][i][j])[_qp];
141 
142  // no arguments are eta-variables
143 
144  Real d3F = 0.0;
145  for (unsigned n = 0; n < _num_fi; ++n)
146  d3F += (*_hi[n])[_qp] * (*_prop_d3Fi[n][i][j][k])[_qp];
147  return d3F;
148 }
std::vector< std::vector< std::vector< const MaterialProperty< Real > * > > > _prop_d2Fi
Second derivatives of Fi.
std::vector< std::vector< std::vector< const MaterialProperty< Real > * > > > _d3g
std::vector< const MaterialProperty< Real > * > _d2hi
std::vector< std::vector< std::vector< std::vector< const MaterialProperty< Real > * > > > > _prop_d3Fi
Third derivatives of Fi.
Real _W
Phase transformation energy barrier.
std::vector< const MaterialProperty< Real > * > _hi
Switching functions.
std::vector< const MaterialProperty< Real > * > _d3hi
std::vector< int > _eta_index
If the variable a non-conserved OP this array holds the index into the etas parameter vector for a gi...
std::vector< const MaterialProperty< Real > * > _prop_Fi
Function value of the i phase.
std::vector< std::vector< const MaterialProperty< Real > * > > _prop_dFi
Derivatives of Fi w.r.t. arg[i].
std::vector< const MaterialProperty< Real > * > _dhi
Function value of the i phase.

◆ computeDF()

Real DerivativeMultiPhaseMaterial::computeDF ( unsigned int  i_var)
protectedvirtual

Definition at line 45 of file DerivativeMultiPhaseMaterial.C.

46 {
47  const unsigned int i = argIndex(i_var);
48  const int i_eta = _eta_index[i];
49 
50  if (i_eta >= 0)
51  return (*_dhi[i_eta])[_qp] * (*_prop_Fi[i_eta])[_qp] + _W * (*_dg[i_eta])[_qp];
52  else
53  {
54  Real dF = 0.0;
55  for (unsigned n = 0; n < _num_fi; ++n)
56  dF += (*_hi[n])[_qp] * (*_prop_dFi[n][i])[_qp];
57  return dF;
58  }
59 }
std::vector< const MaterialProperty< Real > * > _dg
Barrier function derivatives.
Real _W
Phase transformation energy barrier.
std::vector< const MaterialProperty< Real > * > _hi
Switching functions.
std::vector< int > _eta_index
If the variable a non-conserved OP this array holds the index into the etas parameter vector for a gi...
std::vector< const MaterialProperty< Real > * > _prop_Fi
Function value of the i phase.
std::vector< std::vector< const MaterialProperty< Real > * > > _prop_dFi
Derivatives of Fi w.r.t. arg[i].
std::vector< const MaterialProperty< Real > * > _dhi
Function value of the i phase.

◆ computeF()

Real DerivativeMultiPhaseBase::computeF ( )
protectedvirtualinherited

Definition at line 140 of file DerivativeMultiPhaseBase.C.

141 {
142  Real F = 0.0;
143  for (unsigned n = 0; n < _num_fi; ++n)
144  F += (*_hi[n])[_qp] * (*_prop_Fi[n])[_qp];
145  return F + _W * _g[_qp];
146 }
const MaterialProperty< Real > & _g
Barrier function .
Real _W
Phase transformation energy barrier.
std::vector< const MaterialProperty< Real > * > _hi
Switching functions.
std::vector< const MaterialProperty< Real > * > _prop_Fi
Function value of the i phase.

◆ initialSetup()

void DerivativeMultiPhaseBase::initialSetup ( )
virtualinherited

Definition at line 133 of file DerivativeMultiPhaseBase.C.

134 {
135  for (unsigned int n = 0; n < _num_fi; ++n)
136  validateCoupling<Real>(_fi_names[n]);
137 }
std::vector< MaterialPropertyName > _fi_names
phase derivative material names

Member Data Documentation

◆ _d2g

std::vector<std::vector<const MaterialProperty<Real> *> > DerivativeMultiPhaseBase::_d2g
protectedinherited

◆ _d2hi

std::vector<const MaterialProperty<Real> *> DerivativeMultiPhaseMaterial::_d2hi
protected

◆ _d3g

std::vector<std::vector<std::vector<const MaterialProperty<Real> *> > > DerivativeMultiPhaseBase::_d3g
protectedinherited

◆ _d3hi

std::vector<const MaterialProperty<Real> *> DerivativeMultiPhaseMaterial::_d3hi
protected

Definition at line 36 of file DerivativeMultiPhaseMaterial.h.

Referenced by computeD3F(), and DerivativeMultiPhaseMaterial().

◆ _dg

std::vector<const MaterialProperty<Real> *> DerivativeMultiPhaseBase::_dg
protectedinherited

Barrier function derivatives.

Definition at line 81 of file DerivativeMultiPhaseBase.h.

Referenced by computeDF(), and DerivativeMultiPhaseBase::DerivativeMultiPhaseBase().

◆ _dhi

std::vector<const MaterialProperty<Real> *> DerivativeMultiPhaseMaterial::_dhi
protected

Function value of the i phase.

Definition at line 36 of file DerivativeMultiPhaseMaterial.h.

Referenced by computeD2F(), computeD3F(), computeDF(), and DerivativeMultiPhaseMaterial().

◆ _eta_index

std::vector<int> DerivativeMultiPhaseBase::_eta_index
protectedinherited

If the variable a non-conserved OP this array holds the index into the etas parameter vector for a given arg index, otherwise it holds -1.

Definition at line 41 of file DerivativeMultiPhaseBase.h.

Referenced by computeD2F(), computeD3F(), computeDF(), and DerivativeMultiPhaseBase::DerivativeMultiPhaseBase().

◆ _eta_names

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

◆ _eta_vars

std::vector<unsigned int> DerivativeMultiPhaseBase::_eta_vars
protectedinherited

◆ _etas

std::vector<VariableValue *> DerivativeMultiPhaseBase::_etas
protectedinherited

Phase parameter (0=A-phase, 1=B-phase)

Definition at line 44 of file DerivativeMultiPhaseBase.h.

◆ _fi_names

std::vector<MaterialPropertyName> DerivativeMultiPhaseBase::_fi_names
protectedinherited

phase derivative material names

Definition at line 52 of file DerivativeMultiPhaseBase.h.

Referenced by DerivativeMultiPhaseBase::DerivativeMultiPhaseBase(), and DerivativeMultiPhaseBase::initialSetup().

◆ _g

const MaterialProperty<Real>& DerivativeMultiPhaseBase::_g
protectedinherited

Barrier function \( g(\eta_0, \eta_1, \dots, \eta_{n-1}) \).

Definition at line 78 of file DerivativeMultiPhaseBase.h.

Referenced by DerivativeMultiPhaseBase::computeF().

◆ _g_name

MaterialPropertyName DerivativeMultiPhaseBase::_g_name
protectedinherited

Barrier function name.

Definition at line 75 of file DerivativeMultiPhaseBase.h.

◆ _hi

std::vector<const MaterialProperty<Real> *> DerivativeMultiPhaseBase::_hi
protectedinherited

◆ _hi_names

std::vector<MaterialPropertyName> DerivativeMultiPhaseBase::_hi_names
protectedinherited

phase switching function names

Definition at line 68 of file DerivativeMultiPhaseBase.h.

Referenced by DerivativeMultiPhaseBase::DerivativeMultiPhaseBase(), and DerivativeMultiPhaseMaterial().

◆ _num_etas

unsigned int DerivativeMultiPhaseBase::_num_etas
protectedinherited

name of the order parameter variable

Definition at line 47 of file DerivativeMultiPhaseBase.h.

Referenced by DerivativeMultiPhaseBase::DerivativeMultiPhaseBase(), and DerivativeMultiPhaseMaterial().

◆ _num_fi

unsigned int DerivativeMultiPhaseBase::_num_fi
protectedinherited

◆ _num_hi

unsigned int DerivativeMultiPhaseBase::_num_hi
protectedinherited

◆ _prop_d2Fi

std::vector<std::vector<std::vector<const MaterialProperty<Real> *> > > DerivativeMultiPhaseBase::_prop_d2Fi
protectedinherited

Second derivatives of Fi.

Definition at line 62 of file DerivativeMultiPhaseBase.h.

Referenced by computeD2F(), computeD3F(), and DerivativeMultiPhaseBase::DerivativeMultiPhaseBase().

◆ _prop_d3Fi

std::vector<std::vector<std::vector<std::vector<const MaterialProperty<Real> *> > > > DerivativeMultiPhaseBase::_prop_d3Fi
protectedinherited

Third derivatives of Fi.

Definition at line 65 of file DerivativeMultiPhaseBase.h.

Referenced by computeD3F(), and DerivativeMultiPhaseBase::DerivativeMultiPhaseBase().

◆ _prop_dFi

std::vector<std::vector<const MaterialProperty<Real> *> > DerivativeMultiPhaseBase::_prop_dFi
protectedinherited

Derivatives of Fi w.r.t. arg[i].

Definition at line 59 of file DerivativeMultiPhaseBase.h.

Referenced by computeD2F(), computeD3F(), computeDF(), and DerivativeMultiPhaseBase::DerivativeMultiPhaseBase().

◆ _prop_Fi

std::vector<const MaterialProperty<Real> *> DerivativeMultiPhaseBase::_prop_Fi
protectedinherited

◆ _W

Real DerivativeMultiPhaseBase::_W
protectedinherited

Phase transformation energy barrier.

Definition at line 86 of file DerivativeMultiPhaseBase.h.

Referenced by computeD2F(), computeD3F(), computeDF(), and DerivativeMultiPhaseBase::computeF().


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