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

Compute the global free energy in the KKS Model \( F = hF_a + (1-h)F_b + wg + \frac{\kappa}{2}|\eta|^2 \). More...

#include <KKSGlobalFreeEnergy.h>

Inheritance diagram for KKSGlobalFreeEnergy:
[legend]

Public Member Functions

 KKSGlobalFreeEnergy (const InputParameters &parameters)
 

Protected Member Functions

virtual Real computeValue ()
 

Protected Attributes

const MaterialProperty< Real > & _prop_fa
 
const MaterialProperty< Real > & _prop_fb
 
const MaterialProperty< Real > & _prop_h
 
const MaterialProperty< Real > & _prop_g
 
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 global free energy in the KKS Model \( F = hF_a + (1-h)F_b + wg + \frac{\kappa}{2}|\eta|^2 \).

Definition at line 23 of file KKSGlobalFreeEnergy.h.

Constructor & Destructor Documentation

KKSGlobalFreeEnergy::KKSGlobalFreeEnergy ( const InputParameters &  parameters)

Definition at line 38 of file KKSGlobalFreeEnergy.C.

39  : TotalFreeEnergyBase(parameters),
40  _prop_fa(getMaterialProperty<Real>("fa_name")),
41  _prop_fb(getMaterialProperty<Real>("fb_name")),
42  _prop_h(getMaterialProperty<Real>("h_name")),
43  _prop_g(getMaterialProperty<Real>("g_name")),
44  _w(getParam<Real>("w")),
46 {
47  // Error check to ensure size of interfacial_vars is the same as kappa_names
48  if (_nvars != _nkappas)
49  mooseError(
50  "Size of interfacial_vars is not equal to the size of kappa_names in KKSGlobalFreeEnergy");
51 
52  // Assign kappa values
53  for (unsigned int i = 0; i < _nkappas; ++i)
54  _kappas[i] = &getMaterialPropertyByName<Real>(_kappa_names[i]);
55 }
unsigned int _nvars
Coupled interface variables.
const MaterialProperty< Real > & _prop_g
const Real _w
Barrier term height.
const MaterialProperty< Real > & _prop_fb
std::vector< const MaterialProperty< Real > * > _kappas
Gradient interface free energy coefficients.
TotalFreeEnergyBase(const InputParameters &parameters)
const MaterialProperty< Real > & _prop_fa
const MaterialProperty< Real > & _prop_h
std::vector< MaterialPropertyName > _kappa_names
Gradient free energy prefactor kappa.

Member Function Documentation

Real KKSGlobalFreeEnergy::computeValue ( )
protectedvirtual

Implements TotalFreeEnergyBase.

Definition at line 58 of file KKSGlobalFreeEnergy.C.

59 {
60  const Real h = _prop_h[_qp];
61 
62  // Include bulk energy and additional contributions
63  Real total_energy = _prop_fa[_qp] * h + _prop_fb[_qp] * (1.0 - h) + _w * _prop_g[_qp] +
65 
66  // Calculate interfacial energy of each variable
67  for (unsigned int i = 0; i < _nvars; ++i)
68  total_energy += (*_kappas[i])[_qp] / 2.0 * (*_grad_vars[i])[_qp].norm_sq();
69 
70  return total_energy;
71 }
unsigned int _nvars
Coupled interface variables.
const MaterialProperty< Real > & _prop_g
const Real _w
Barrier term height.
const VariableValue & _additional_free_energy
Additional free energy contribution.
const MaterialProperty< Real > & _prop_fb
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
const MaterialProperty< Real > & _prop_fa
const MaterialProperty< Real > & _prop_h

Member Data Documentation

const VariableValue& TotalFreeEnergyBase::_additional_free_energy
protectedinherited
std::vector<const VariableGradient *> TotalFreeEnergyBase::_grad_vars
protectedinherited
std::vector<MaterialPropertyName> TotalFreeEnergyBase::_kappa_names
protectedinherited
std::vector<const MaterialProperty<Real> *> KKSGlobalFreeEnergy::_kappas
protected

Gradient interface free energy coefficients.

Definition at line 40 of file KKSGlobalFreeEnergy.h.

Referenced by computeValue(), and KKSGlobalFreeEnergy().

unsigned int TotalFreeEnergyBase::_nkappas
protectedinherited
unsigned int TotalFreeEnergyBase::_nvars
protectedinherited
const MaterialProperty<Real>& KKSGlobalFreeEnergy::_prop_fa
protected

Definition at line 31 of file KKSGlobalFreeEnergy.h.

Referenced by computeValue().

const MaterialProperty<Real>& KKSGlobalFreeEnergy::_prop_fb
protected

Definition at line 32 of file KKSGlobalFreeEnergy.h.

Referenced by computeValue().

const MaterialProperty<Real>& KKSGlobalFreeEnergy::_prop_g
protected

Definition at line 34 of file KKSGlobalFreeEnergy.h.

Referenced by computeValue().

const MaterialProperty<Real>& KKSGlobalFreeEnergy::_prop_h
protected

Definition at line 33 of file KKSGlobalFreeEnergy.h.

Referenced by computeValue().

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

Barrier term height.

Definition at line 37 of file KKSGlobalFreeEnergy.h.

Referenced by computeValue().


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