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
SLKKSMultiPhaseConcentration Class Reference

Enforce sum of phase sublattice concentrations to be the real concentration. More...

#include <SLKKSMultiPhaseConcentration.h>

Inheritance diagram for SLKKSMultiPhaseConcentration:
[legend]

Public Types

typedef DerivativeMaterialPropertyNameInterface::SymbolName SymbolName
 

Public Member Functions

 SLKKSMultiPhaseConcentration (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 precomputeQpResidual ()
 
virtual Real precomputeQpJacobian ()
 
virtual Real computeQpOffDiagJacobian (unsigned int jvar)
 

Protected Attributes

int _l
 Position of the nonlinear variable in the cs list.
 
std::vector< unsigned int_ns
 Number of sublattices per phase.
 
std::vector< Real > _a_cs
 Sublattice site numbers.
 
std::vector< unsigned int_phase
 phase index of each cs entry
 
const VariableValue_c
 Physical concentration.
 
const unsigned int _c_var
 
std::vector< const MaterialProperty< Real > * > _prop_h
 Switching functions for each phase and their derivatives w.r.t. all etas.
 
std::vector< std::vector< const MaterialProperty< Real > * > > _prop_dhdeta
 
const std::size_t _ncs
 Sublattice concentrations.
 
std::vector< const VariableValue * > _cs
 
const JvarMap & _cs_map
 
const std::size_t _neta
 Order parameters for each phase \( \eta_j \).
 
std::vector< VariableName > _eta_names
 
const JvarMap & _eta_map
 
std::vector< MaterialPropertyName > _h_names
 Switching function names.
 
const std::size_t _nh
 

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

Enforce sum of phase sublattice concentrations to be the real concentration.

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

See also
SLKKSPhaseChemicalPotential

Definition at line 20 of file SLKKSMultiPhaseConcentration.h.

Constructor & Destructor Documentation

◆ SLKKSMultiPhaseConcentration()

SLKKSMultiPhaseConcentration::SLKKSMultiPhaseConcentration ( const InputParameters parameters)

Definition at line 26 of file SLKKSMultiPhaseConcentration.C.

27 : SLKKSMultiPhaseBase(parameters), _l(-1), _prop_h(_nh), _prop_dhdeta(_nh)
28{
29 // Fetch switching functions and their derivatives
30 for (std::size_t i = 0; i < _nh; ++i)
31 {
32 _prop_h[i] = &getMaterialPropertyByName<Real>(_h_names[i]);
33 _prop_dhdeta[i].resize(_neta);
34
35 // Get derivatives of switching functions w.r.t. order parameters
36 for (std::size_t j = 0; j < _neta; ++j)
37 _prop_dhdeta[i][j] = &getMaterialPropertyDerivativeByName<Real>(_h_names[i], _eta_names[j]);
38 }
39
40 // Determine position of the nonlinear variable
41 for (std::size_t i = 0; i < _ncs; ++i)
42 if (coupled("cs", i) == _var.number())
43 _l = i;
44
45 // Check to make sure the nonlinear variable is in the cs list
46 if (_l < 0)
47 paramError("cs", "One of the listed variables must be the kernel variable");
48}
Enforce sum of phase sublattice concentrations to be the real concentration.
const std::size_t _neta
Order parameters for each phase .
std::vector< MaterialPropertyName > _h_names
Switching function names.
const std::size_t _nh
const std::size_t _ncs
Sublattice concentrations.
std::vector< VariableName > _eta_names
int _l
Position of the nonlinear variable in the cs list.
std::vector< std::vector< const MaterialProperty< Real > * > > _prop_dhdeta
std::vector< const MaterialProperty< Real > * > _prop_h
Switching functions for each phase and their derivatives w.r.t. all etas.

Member Function Documentation

◆ computeQpOffDiagJacobian()

Real SLKKSMultiPhaseConcentration::computeQpOffDiagJacobian ( unsigned int  jvar)
protectedvirtual

Definition at line 77 of file SLKKSMultiPhaseConcentration.C.

78{
79 if (jvar == _c_var)
80 return -_test[_i][_qp] * _phi[_j][_qp];
81
82 auto csvar = mapJvarToCvar(jvar, _cs_map);
83 if (csvar >= 0)
84 return _test[_i][_qp] * (*_prop_h[_phase[csvar]])[_qp] * _phi[_j][_qp] * _a_cs[csvar];
85
86 auto etavar = mapJvarToCvar(jvar, _eta_map);
87 if (etavar >= 0)
88 {
89 Real sum = 0.0;
90 for (unsigned int i = 0; i < _ncs; ++i)
91 sum += (*_prop_dhdeta[_phase[i]][etavar])[_qp] * (*_cs[i])[_qp] * _a_cs[i];
92
93 return _test[_i][_qp] * sum * _phi[_j][_qp];
94 }
95
96 return 0.0;
97}
std::vector< const VariableValue * > _cs
const unsigned int _c_var
std::vector< unsigned int > _phase
phase index of each cs entry
std::vector< Real > _a_cs
Sublattice site numbers.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ precomputeQpJacobian()

Real SLKKSMultiPhaseConcentration::precomputeQpJacobian ( )
protectedvirtual

Definition at line 71 of file SLKKSMultiPhaseConcentration.C.

72{
73 return (*_prop_h[_phase[_l]])[_qp] * _phi[_j][_qp] * _a_cs[_l];
74}

◆ precomputeQpResidual()

Real SLKKSMultiPhaseConcentration::precomputeQpResidual ( )
protectedvirtual

Definition at line 51 of file SLKKSMultiPhaseConcentration.C.

52{
53 // sum over phases
54 std::size_t k = 0;
55 Real sum = 0.0;
56 for (std::size_t i = 0; i < _nh; ++i)
57 {
58 // sum sublattice concentrations
59 Real csum = 0.0;
60 for (unsigned int j = 0; j < _ns[i]; ++j)
61 {
62 csum += (*_cs[k])[_qp] * _a_cs[k];
63 k++;
64 }
65 sum += (*_prop_h[i])[_qp] * csum;
66 }
67 return sum - _c[_qp];
68}
const VariableValue & _c
Physical concentration.
std::vector< unsigned int > _ns
Number of sublattices per phase.

◆ validParams()

InputParameters SLKKSMultiPhaseConcentration::validParams ( )
static

Definition at line 15 of file SLKKSMultiPhaseConcentration.C.

16{
18 params.addClassDescription(
19 "SLKKS multi-phase model kernel to enforce $c_i = \\sum_j h_j\\sum_k a_{jk} c_{ijk}$. "
20 "The non-linear variable of this kernel is a phase's sublattice concentration");
21 params.addRequiredCoupledVar("c", "Physical concentration");
22 return params;
23}
static InputParameters validParams()

Member Data Documentation

◆ _a_cs

std::vector<Real> SLKKSMultiPhaseBase::_a_cs
protectedinherited

◆ _c

const VariableValue& SLKKSMultiPhaseBase::_c
protectedinherited

Physical concentration.

Definition at line 57 of file SLKKSMultiPhaseBase.h.

Referenced by precomputeQpResidual().

◆ _c_var

const unsigned int SLKKSMultiPhaseBase::_c_var
protectedinherited

◆ _cs

std::vector<const VariableValue *> SLKKSMultiPhaseBase::_cs
protectedinherited

◆ _cs_map

const JvarMap& SLKKSMultiPhaseBase::_cs_map
protectedinherited

◆ _eta_map

const JvarMap& SLKKSMultiPhaseBase::_eta_map
protectedinherited

◆ _eta_names

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

◆ _h_names

std::vector<MaterialPropertyName> SLKKSMultiPhaseBase::_h_names
protectedinherited

Switching function names.

Definition at line 49 of file SLKKSMultiPhaseBase.h.

Referenced by SLKKSMultiACBulkC::SLKKSMultiACBulkC(), and SLKKSMultiPhaseConcentration().

◆ _l

int SLKKSMultiPhaseConcentration::_l
protected

Position of the nonlinear variable in the cs list.

Definition at line 33 of file SLKKSMultiPhaseConcentration.h.

Referenced by precomputeQpJacobian(), and SLKKSMultiPhaseConcentration().

◆ _ncs

const std::size_t SLKKSMultiPhaseBase::_ncs
protectedinherited

◆ _neta

const std::size_t SLKKSMultiPhaseBase::_neta
protectedinherited

Order parameters for each phase \( \eta_j \).

Definition at line 40 of file SLKKSMultiPhaseBase.h.

Referenced by SLKKSMultiACBulkC::SLKKSMultiACBulkC(), SLKKSMultiPhaseBase::SLKKSMultiPhaseBase(), and SLKKSMultiPhaseConcentration().

◆ _nh

const std::size_t SLKKSMultiPhaseBase::_nh
protectedinherited

◆ _ns

std::vector<unsigned int> SLKKSMultiPhaseBase::_ns
protectedinherited

◆ _phase

std::vector<unsigned int> SLKKSMultiPhaseBase::_phase
protectedinherited

◆ _prop_dhdeta

std::vector<std::vector<const MaterialProperty<Real> *> > SLKKSMultiPhaseConcentration::_prop_dhdeta
protected

◆ _prop_h

std::vector<const MaterialProperty<Real> *> SLKKSMultiPhaseConcentration::_prop_h
protected

Switching functions for each phase and their derivatives w.r.t. all etas.

Definition at line 36 of file SLKKSMultiPhaseConcentration.h.

Referenced by computeQpOffDiagJacobian(), precomputeQpJacobian(), precomputeQpResidual(), and SLKKSMultiPhaseConcentration().


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