https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
SLKKSChemicalPotential Class Reference

Enforce the equality of the chemical potentials in sublattices of the same phase D. More...

#include <SLKKSChemicalPotential.h>

Inheritance diagram for SLKKSChemicalPotential:
[legend]

Public Types

typedef DerivativeMaterialPropertyNameInterface::SymbolName SymbolName
 

Public Member Functions

 SLKKSChemicalPotential (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 Real computeQpResidual ()
 
virtual Real computeQpJacobian ()
 
virtual Real computeQpOffDiagJacobian (unsigned int jvar)
 
virtual void initialSetup ()
 

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
 
unsigned int _cs_var
 coupled variable for the other sublattice concentration cs
 
VariableName _cs_name
 
const MaterialProperty< Real > & _dFdu
 chemical potentials and their derivatives w.r.t. the two sublattice concentrations
 
const MaterialProperty< Real > & _dFdcs
 
const MaterialProperty< Real > & _d2Fdu2
 
const MaterialProperty< Real > & _d2Fdcsu
 
const Real _a_u
 sublattice site fractions
 
const Real _a_cs
 
std::vector< const MaterialProperty< Real > * > _d2Fdudarg
 free energy derivatives
 
std::vector< const MaterialProperty< Real > * > _d2Fdcsdarg
 

Detailed Description

Enforce the equality of the chemical potentials in sublattices of the same phase D.

Schwen et al. https://doi.org/10.1016/j.commatsci.2021.110466

See also
SLKKSPhaseConcentration

Definition at line 22 of file SLKKSChemicalPotential.h.

Constructor & Destructor Documentation

◆ SLKKSChemicalPotential()

SLKKSChemicalPotential::SLKKSChemicalPotential ( const InputParameters parameters)

Definition at line 34 of file SLKKSChemicalPotential.C.

36 _cs_var(coupled("cs")),
37 _cs_name(coupledName("cs", 0)),
38 // first derivatives
39 _dFdu(getMaterialPropertyDerivative<Real>("F", _var.name())),
40 _dFdcs(getMaterialPropertyDerivative<Real>("F", _cs_name)),
41 // second derivatives d2F/dx*dca for jacobian diagonal elements
42 _d2Fdu2(getMaterialPropertyDerivative<Real>("F", _var.name(), _var.name())),
43 _d2Fdcsu(getMaterialPropertyDerivative<Real>("F", _cs_name, _var.name())),
44 // site fractions
45 _a_u(getParam<Real>("a")),
46 _a_cs(getParam<Real>("as"))
47{
48 const auto nvar = _coupled_moose_vars.size();
49 _d2Fdudarg.resize(nvar);
50 _d2Fdcsdarg.resize(nvar);
51
52 for (std::size_t i = 0; i < nvar; ++i)
53 {
54 // get the moose variable
55 const auto & arg_name = _coupled_moose_vars[i]->name();
56
57 // lookup table for the material properties representing the derivatives
58 // needed for the off-diagonal Jacobian
59 _d2Fdudarg[i] = &getMaterialPropertyDerivative<Real>("F", _var.name(), arg_name);
60 _d2Fdcsdarg[i] = &getMaterialPropertyDerivative<Real>("F", _cs_name, arg_name);
61 }
62}
virtual unsigned int size() const override final
std::vector< const MaterialProperty< Real > * > _d2Fdudarg
free energy derivatives
std::vector< const MaterialProperty< Real > * > _d2Fdcsdarg
const Real _a_u
sublattice site fractions
const MaterialProperty< Real > & _d2Fdu2
unsigned int _cs_var
coupled variable for the other sublattice concentration cs
const MaterialProperty< Real > & _dFdu
chemical potentials and their derivatives w.r.t. the two sublattice concentrations
const MaterialProperty< Real > & _dFdcs
const MaterialProperty< Real > & _d2Fdcsu

Member Function Documentation

◆ computeQpJacobian()

Real SLKKSChemicalPotential::computeQpJacobian ( )
protectedvirtual

Definition at line 77 of file SLKKSChemicalPotential.C.

78{
79 return _test[_i][_qp] * _phi[_j][_qp] * (_d2Fdu2[_qp] / _a_u - _d2Fdcsu[_qp] / _a_cs);
80}

◆ computeQpOffDiagJacobian()

Real SLKKSChemicalPotential::computeQpOffDiagJacobian ( unsigned int  jvar)
protectedvirtual

Definition at line 83 of file SLKKSChemicalPotential.C.

84{
85 // get the coupled variable jvar is referring to
86 const unsigned int cvar = mapJvarToCvar(jvar);
87
88 return _test[_i][_qp] * _phi[_j][_qp] *
89 ((*_d2Fdudarg[cvar])[_qp] / _a_u - (*_d2Fdcsdarg[cvar])[_qp] / _a_cs);
90}

◆ computeQpResidual()

Real SLKKSChemicalPotential::computeQpResidual ( )
protectedvirtual

Definition at line 71 of file SLKKSChemicalPotential.C.

72{
73 return _test[_i][_qp] * (_dFdu[_qp] / _a_u - _dFdcs[_qp] / _a_cs);
74}

◆ initialSetup()

void SLKKSChemicalPotential::initialSetup ( )
protectedvirtual

Definition at line 65 of file SLKKSChemicalPotential.C.

66{
67 validateNonlinearCoupling<Real>("F");
68}

◆ validParams()

InputParameters SLKKSChemicalPotential::validParams ( )
static

Definition at line 18 of file SLKKSChemicalPotential.C.

19{
22 "SLKKS model kernel to enforce the pointwise equality of sublattice chemical "
23 "potentials in the same phase.");
24 params.addRequiredCoupledVar("cs", "other sublattice concentration in the same phase");
25 params.addRequiredParam<Real>("a", "sublattice site fraction for the kernel variable");
26 params.addRequiredParam<Real>("as", "other sublattice site fraction in the same phase");
27 params.addRequiredParam<MaterialPropertyName>("F", "Base name of the free energy function");
28 params.addCoupledVar("coupled_variables",
29 "Vector of variable arguments to the free energy function");
30
31 return params;
32}
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
void addCoupledVar(const std::string &name, const std::string &doc_string)
static InputParameters validParams()
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

Member Data Documentation

◆ _a_cs

const Real SLKKSChemicalPotential::_a_cs
private

◆ _a_u

const Real SLKKSChemicalPotential::_a_u
private

sublattice site fractions

Definition at line 49 of file SLKKSChemicalPotential.h.

Referenced by computeQpJacobian(), computeQpOffDiagJacobian(), and computeQpResidual().

◆ _cs_name

VariableName SLKKSChemicalPotential::_cs_name
private

Definition at line 38 of file SLKKSChemicalPotential.h.

Referenced by SLKKSChemicalPotential().

◆ _cs_var

unsigned int SLKKSChemicalPotential::_cs_var
private

coupled variable for the other sublattice concentration cs

Definition at line 37 of file SLKKSChemicalPotential.h.

◆ _d2Fdcsdarg

std::vector<const MaterialProperty<Real> *> SLKKSChemicalPotential::_d2Fdcsdarg
private

Definition at line 55 of file SLKKSChemicalPotential.h.

Referenced by computeQpOffDiagJacobian(), and SLKKSChemicalPotential().

◆ _d2Fdcsu

const MaterialProperty<Real>& SLKKSChemicalPotential::_d2Fdcsu
private

Definition at line 45 of file SLKKSChemicalPotential.h.

Referenced by computeQpJacobian().

◆ _d2Fdu2

const MaterialProperty<Real>& SLKKSChemicalPotential::_d2Fdu2
private

Definition at line 44 of file SLKKSChemicalPotential.h.

Referenced by computeQpJacobian().

◆ _d2Fdudarg

std::vector<const MaterialProperty<Real> *> SLKKSChemicalPotential::_d2Fdudarg
private

free energy derivatives

Definition at line 54 of file SLKKSChemicalPotential.h.

Referenced by computeQpOffDiagJacobian(), and SLKKSChemicalPotential().

◆ _dFdcs

const MaterialProperty<Real>& SLKKSChemicalPotential::_dFdcs
private

Definition at line 43 of file SLKKSChemicalPotential.h.

Referenced by computeQpResidual().

◆ _dFdu

const MaterialProperty<Real>& SLKKSChemicalPotential::_dFdu
private

chemical potentials and their derivatives w.r.t. the two sublattice concentrations

Definition at line 42 of file SLKKSChemicalPotential.h.

Referenced by computeQpResidual().


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