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 26 of file KKSGlobalFreeEnergy.h.

Constructor & Destructor Documentation

◆ KKSGlobalFreeEnergy()

KKSGlobalFreeEnergy::KKSGlobalFreeEnergy ( const InputParameters &  parameters)

Definition at line 43 of file KKSGlobalFreeEnergy.C.

44  : TotalFreeEnergyBase(parameters),
45  _prop_fa(getMaterialProperty<Real>("fa_name")),
46  _prop_fb(getMaterialProperty<Real>("fb_name")),
47  _prop_h(getMaterialProperty<Real>("h_name")),
48  _prop_g(getMaterialProperty<Real>("g_name")),
49  _w(getParam<Real>("w")),
51 {
52  // Error check to ensure size of interfacial_vars is the same as kappa_names
53  if (_nvars != _nkappas)
54  mooseError(
55  "Size of interfacial_vars is not equal to the size of kappa_names in KKSGlobalFreeEnergy");
56 
57  // Assign kappa values
58  for (unsigned int i = 0; i < _nkappas; ++i)
59  _kappas[i] = &getMaterialPropertyByName<Real>(_kappa_names[i]);
60 }
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

◆ computeValue()

Real KKSGlobalFreeEnergy::computeValue ( )
protectedvirtual

Implements TotalFreeEnergyBase.

Definition at line 63 of file KKSGlobalFreeEnergy.C.

64 {
65  const Real h = _prop_h[_qp];
66 
67  // Include bulk energy and additional contributions
68  Real total_energy = _prop_fa[_qp] * (1.0 - h) + _prop_fb[_qp] * h + _w * _prop_g[_qp] +
70 
71  // Calculate interfacial energy of each variable
72  for (unsigned int i = 0; i < _nvars; ++i)
73  total_energy += (*_kappas[i])[_qp] / 2.0 * (*_grad_vars[i])[_qp].norm_sq();
74 
75  return total_energy;
76 }
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:21
std::vector< const VariableGradient * > _grad_vars
const MaterialProperty< Real > & _prop_fa
const MaterialProperty< Real > & _prop_h

Member Data Documentation

◆ _additional_free_energy

const VariableValue& TotalFreeEnergyBase::_additional_free_energy
protectedinherited

◆ _grad_vars

std::vector<const VariableGradient *> TotalFreeEnergyBase::_grad_vars
protectedinherited

◆ _kappa_names

std::vector<MaterialPropertyName> TotalFreeEnergyBase::_kappa_names
protectedinherited

◆ _kappas

std::vector<const MaterialProperty<Real> *> KKSGlobalFreeEnergy::_kappas
protected

Gradient interface free energy coefficients.

Definition at line 43 of file KKSGlobalFreeEnergy.h.

Referenced by computeValue(), and KKSGlobalFreeEnergy().

◆ _nkappas

unsigned int TotalFreeEnergyBase::_nkappas
protectedinherited

◆ _nvars

unsigned int TotalFreeEnergyBase::_nvars
protectedinherited

◆ _prop_fa

const MaterialProperty<Real>& KKSGlobalFreeEnergy::_prop_fa
protected

Definition at line 34 of file KKSGlobalFreeEnergy.h.

Referenced by computeValue().

◆ _prop_fb

const MaterialProperty<Real>& KKSGlobalFreeEnergy::_prop_fb
protected

Definition at line 35 of file KKSGlobalFreeEnergy.h.

Referenced by computeValue().

◆ _prop_g

const MaterialProperty<Real>& KKSGlobalFreeEnergy::_prop_g
protected

Definition at line 37 of file KKSGlobalFreeEnergy.h.

Referenced by computeValue().

◆ _prop_h

const MaterialProperty<Real>& KKSGlobalFreeEnergy::_prop_h
protected

Definition at line 36 of file KKSGlobalFreeEnergy.h.

Referenced by computeValue().

◆ _vars

std::vector<const VariableValue *> TotalFreeEnergyBase::_vars
protectedinherited

◆ _w

const Real KKSGlobalFreeEnergy::_w
protected

Barrier term height.

Definition at line 40 of file KKSGlobalFreeEnergy.h.

Referenced by computeValue().


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