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

Compute the free energy in the multi-phase KKS Model \( F = \sum_i h_i F_i + + wg_i + \frac{\kappa}{2}|\eta_i|^2 \). More...

#include <KKSMultiFreeEnergy.h>

Inheritance diagram for KKSMultiFreeEnergy:
[legend]

Public Member Functions

 KKSMultiFreeEnergy (const InputParameters &parameters)
 

Protected Member Functions

virtual Real computeValue ()
 

Protected Attributes

std::vector< MaterialPropertyName > _Fj_names
 Names of free energy functions for each phase \( F_j \). More...
 
const unsigned int _num_j
 
std::vector< const MaterialProperty< Real > * > _prop_Fj
 Values of the free energy functions for each phase \( F_j \). More...
 
std::vector< MaterialPropertyName > _hj_names
 Switching function names. More...
 
std::vector< const MaterialProperty< Real > * > _prop_hj
 Values of the switching functions for each phase \( h_j \). More...
 
std::vector< MaterialPropertyName > _gj_names
 Barrier function names. More...
 
std::vector< const MaterialProperty< Real > * > _prop_gj
 Values of the barrier functions for each phase \( g_j \). More...
 
const Real _w
 Barrier term height. More...
 
std::vector< const MaterialProperty< Real > * > _kappas
 Gradient interface free energy coefficients. More...
 
unsigned int _nvars
 Coupled interface variables. More...
 
std::vector< const VariableValue * > _vars
 
std::vector< const VariableGradient * > _grad_vars
 
std::vector< MaterialPropertyName > _kappa_names
 Gradient free energy prefactor kappa. More...
 
unsigned int _nkappas
 
const VariableValue & _additional_free_energy
 Additional free energy contribution. More...
 

Detailed Description

Compute the free energy in the multi-phase KKS Model \( F = \sum_i h_i F_i + + wg_i + \frac{\kappa}{2}|\eta_i|^2 \).

Definition at line 23 of file KKSMultiFreeEnergy.h.

Constructor & Destructor Documentation

KKSMultiFreeEnergy::KKSMultiFreeEnergy ( const InputParameters &  parameters)

Definition at line 34 of file KKSMultiFreeEnergy.C.

35  : TotalFreeEnergyBase(parameters),
36  _Fj_names(getParam<std::vector<MaterialPropertyName>>("Fj_names")),
37  _num_j(_Fj_names.size()),
39  _hj_names(getParam<std::vector<MaterialPropertyName>>("hj_names")),
41  _gj_names(getParam<std::vector<MaterialPropertyName>>("gj_names")),
43  _w(getParam<Real>("w")),
45 {
46  // Check that same number of Fj, hj, and gj are passed in
47  if (_hj_names.size() != _num_j)
48  mooseError("Size of hj_names is not equal to size of Fj_names in KKSMultiFreeEnergy AuxKernel ",
49  name());
50  if (_gj_names.size() != _num_j)
51  mooseError("Size of gj_names is not equal to size of Fj_names in KKSMultiFreeEnergy AuxKernel ",
52  name());
53 
54  // get bulk properties
55  for (unsigned int i = 0; i < _num_j; ++i)
56  {
57  _prop_Fj[i] = &getMaterialPropertyByName<Real>(_Fj_names[i]);
58  _prop_hj[i] = &getMaterialPropertyByName<Real>(_hj_names[i]);
59  _prop_gj[i] = &getMaterialPropertyByName<Real>(_gj_names[i]);
60  }
61 
62  // Check to ensure size of interfacial_vars is the same as kappa_names
63  if (_nvars != _nkappas)
64  mooseError("Size of interfacial_vars is not equal to the size of kappa_names in "
65  "KKSMultiFreeEnergy AuxKernel ",
66  name());
67 
68  // Assign kappa values
69  for (unsigned int i = 0; i < _nkappas; ++i)
70  _kappas[i] = &getMaterialPropertyByName<Real>(_kappa_names[i]);
71 }
const unsigned int _num_j
unsigned int _nvars
Coupled interface variables.
std::vector< const MaterialProperty< Real > * > _prop_hj
Values of the switching functions for each phase .
std::vector< MaterialPropertyName > _Fj_names
Names of free energy functions for each phase .
const Real _w
Barrier term height.
std::vector< const MaterialProperty< Real > * > _prop_gj
Values of the barrier functions for each phase .
std::vector< const MaterialProperty< Real > * > _prop_Fj
Values of the free energy functions for each phase .
std::vector< const MaterialProperty< Real > * > _kappas
Gradient interface free energy coefficients.
std::vector< MaterialPropertyName > _gj_names
Barrier function names.
TotalFreeEnergyBase(const InputParameters &parameters)
std::vector< MaterialPropertyName > _kappa_names
Gradient free energy prefactor kappa.
std::vector< MaterialPropertyName > _hj_names
Switching function names.

Member Function Documentation

Real KKSMultiFreeEnergy::computeValue ( )
protectedvirtual

Implements TotalFreeEnergyBase.

Definition at line 74 of file KKSMultiFreeEnergy.C.

75 {
76  // Start with any additional energy contribution, which is 0 if not supplied
78  // Add bulk energy contributions
79  for (unsigned int i = 0; i < _num_j; ++i)
80  total_energy += (*_prop_hj[i])[_qp] * (*_prop_Fj[i])[_qp] + _w * (*_prop_gj[i])[_qp];
81 
82  // Add interfacial energy of each variable
83  for (unsigned int i = 0; i < _nvars; ++i)
84  total_energy += (*_kappas[i])[_qp] / 2.0 * (*_grad_vars[i])[_qp].norm_sq();
85 
86  return total_energy;
87 }
const unsigned int _num_j
unsigned int _nvars
Coupled interface variables.
const VariableValue & _additional_free_energy
Additional free energy contribution.
std::vector< const MaterialProperty< Real > * > _prop_hj
Values of the switching functions for each phase .
const Real _w
Barrier term height.
std::vector< const MaterialProperty< Real > * > _prop_gj
Values of the barrier functions for each phase .
std::vector< const MaterialProperty< Real > * > _prop_Fj
Values of the free energy functions for each phase .
std::vector< const MaterialProperty< Real > * > _kappas
Gradient interface free energy coefficients.
const std::string total_energy
Definition: NS.h:19
std::vector< const VariableGradient * > _grad_vars

Member Data Documentation

const VariableValue& TotalFreeEnergyBase::_additional_free_energy
protectedinherited
std::vector<MaterialPropertyName> KKSMultiFreeEnergy::_Fj_names
protected

Names of free energy functions for each phase \( F_j \).

Definition at line 32 of file KKSMultiFreeEnergy.h.

Referenced by KKSMultiFreeEnergy().

std::vector<MaterialPropertyName> KKSMultiFreeEnergy::_gj_names
protected

Barrier function names.

Definition at line 45 of file KKSMultiFreeEnergy.h.

Referenced by KKSMultiFreeEnergy().

std::vector<const VariableGradient *> TotalFreeEnergyBase::_grad_vars
protectedinherited
std::vector<MaterialPropertyName> KKSMultiFreeEnergy::_hj_names
protected

Switching function names.

Definition at line 39 of file KKSMultiFreeEnergy.h.

Referenced by KKSMultiFreeEnergy().

std::vector<MaterialPropertyName> TotalFreeEnergyBase::_kappa_names
protectedinherited
std::vector<const MaterialProperty<Real> *> KKSMultiFreeEnergy::_kappas
protected

Gradient interface free energy coefficients.

Definition at line 54 of file KKSMultiFreeEnergy.h.

Referenced by computeValue(), and KKSMultiFreeEnergy().

unsigned int TotalFreeEnergyBase::_nkappas
protectedinherited
const unsigned int KKSMultiFreeEnergy::_num_j
protected

Definition at line 33 of file KKSMultiFreeEnergy.h.

Referenced by computeValue(), and KKSMultiFreeEnergy().

unsigned int TotalFreeEnergyBase::_nvars
protectedinherited
std::vector<const MaterialProperty<Real> *> KKSMultiFreeEnergy::_prop_Fj
protected

Values of the free energy functions for each phase \( F_j \).

Definition at line 36 of file KKSMultiFreeEnergy.h.

Referenced by computeValue(), and KKSMultiFreeEnergy().

std::vector<const MaterialProperty<Real> *> KKSMultiFreeEnergy::_prop_gj
protected

Values of the barrier functions for each phase \( g_j \).

Definition at line 48 of file KKSMultiFreeEnergy.h.

Referenced by computeValue(), and KKSMultiFreeEnergy().

std::vector<const MaterialProperty<Real> *> KKSMultiFreeEnergy::_prop_hj
protected

Values of the switching functions for each phase \( h_j \).

Definition at line 42 of file KKSMultiFreeEnergy.h.

Referenced by computeValue(), and KKSMultiFreeEnergy().

std::vector<const VariableValue *> TotalFreeEnergyBase::_vars
protectedinherited
const Real KKSMultiFreeEnergy::_w
protected

Barrier term height.

Definition at line 51 of file KKSMultiFreeEnergy.h.

Referenced by computeValue().


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