https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private 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 Types

typedef DerivativeMaterialPropertyNameInterface::SymbolName SymbolName
 

Public Member Functions

 AsymmetricCrossTermBarrierFunctionMaterial (const InputParameters &parameters)
 
const GenericMaterialProperty< U, is_ad > & getDefaultMaterialProperty (const std::string &name)
 
const GenericMaterialProperty< U, is_ad > & getDefaultMaterialPropertyByName (const std::string &name)
 
void validateDerivativeMaterialPropertyBase (const std::string &base)
 
const MaterialPropertyName derivativePropertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName derivativePropertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName derivativePropertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName derivativePropertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, unsigned int v2, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, unsigned int v1, unsigned int v2=libMesh::invalid_uint, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, unsigned int v2, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, unsigned int v1, unsigned int v2=libMesh::invalid_uint, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
void validateCoupling (const MaterialPropertyName &base, const std::vector< VariableName > &c, bool validate_aux=true)
 
void validateCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateCoupling (const MaterialPropertyName &base, const std::vector< VariableName > &c, bool validate_aux=true)
 
void validateCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateNonlinearCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateNonlinearCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
const MaterialPropertyName propertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName propertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName propertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName propertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName propertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName propertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName propertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 
const MaterialPropertyName propertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 

Static Public Member Functions

static InputParameters validParams ()
 

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)
 
unsigned int _g_order
 polynomial order of the switching function \( g(\eta) \)
 
std::vector< Real > _W_ij
 barrier function height matrix
 
unsigned int _num_eta
 order parameters
 
const std::vector< VariableName > _eta_names
 
const std::vector< const VariableValue * > _eta
 
std::vector< const MaterialProperty< Real > * > _h
 Switching functions and their drivatives.
 
std::vector< const MaterialProperty< Real > * > _dh
 
std::vector< const MaterialProperty< Real > * > _d2h
 
MaterialProperty< Real > & _prop_g
 Barrier function and its derivatives.
 
std::vector< MaterialProperty< Real > * > _prop_dg
 
std::vector< std::vector< MaterialProperty< Real > * > > _prop_d2g
 

Private Member Functions

bool haveMaterialProperty (const std::string &prop_name)
 
std::vector< VariableName > buildVariableVector (const VariableName &c1, const VariableName &c2, const VariableName &c3)
 
void validateCouplingHelper (const MaterialPropertyName &base, const std::vector< VariableName > &c, const System &system, std::vector< VariableName > &missing)
 
bool isNotObjectVariable (const VariableName &name)
 

Private Attributes

FEProblemBase_dmi_fe_problem
 

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

Constructor & Destructor Documentation

◆ AsymmetricCrossTermBarrierFunctionMaterial()

AsymmetricCrossTermBarrierFunctionMaterial::AsymmetricCrossTermBarrierFunctionMaterial ( const InputParameters parameters)

Definition at line 25 of file AsymmetricCrossTermBarrierFunctionMaterial.C.

28{
29 // switching functions
30 const std::vector<MaterialPropertyName> & hi_names =
31 getParam<std::vector<MaterialPropertyName>>("hi_names");
32 if (hi_names.size() != _num_eta)
33 paramError("hi_names", "The number of hi_names must be equal to the number of coupled etas");
34
35 for (unsigned int i = 0; i < _num_eta; ++i)
36 {
37 _h[i] = &getMaterialProperty<Real>(hi_names[i]);
38 _dh[i] = &getMaterialPropertyDerivative<Real>(hi_names[i], _eta_names[i]);
39 _d2h[i] = &getMaterialPropertyDerivative<Real>(hi_names[i], _eta_names[i], _eta_names[i]);
40 }
41}
std::vector< const MaterialProperty< Real > * > _h
Switching functions and their drivatives.
CrossTermBarrierFunctionBase is the base to a set of free energy penalties that set the phase interfa...
unsigned int _num_eta
order parameters
const std::vector< VariableName > _eta_names

Member Function Documentation

◆ computeQpProperties()

void AsymmetricCrossTermBarrierFunctionMaterial::computeQpProperties ( )
protectedvirtual

Reimplemented from CrossTermBarrierFunctionBase.

Definition at line 44 of file AsymmetricCrossTermBarrierFunctionMaterial.C.

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

◆ validParams()

InputParameters AsymmetricCrossTermBarrierFunctionMaterial::validParams ( )
static

Definition at line 15 of file AsymmetricCrossTermBarrierFunctionMaterial.C.

16{
19 "Free energy contribution asymmetric across interfaces between arbitrary pairs of phases.");
20 params.addParam<std::vector<MaterialPropertyName>>(
21 "hi_names", "Switching Function Materials that provide h(eta_i)");
22 return params;
23}
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)

Member Data Documentation

◆ _d2h

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

◆ _dh

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

◆ _eta

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

◆ _eta_names

const 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 32 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 35 of file CrossTermBarrierFunctionBase.h.

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

◆ _h

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().

◆ _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: