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

Total free energy (both the bulk and gradient parts), where the bulk free energy has been defined in a material and called f_name. More...

#include <TotalFreeEnergy.h>

Inheritance diagram for TotalFreeEnergy:
[legend]

Public Member Functions

 TotalFreeEnergy (const InputParameters &parameters)
 

Protected Member Functions

virtual Real computeValue ()
 

Protected Attributes

const MaterialProperty< Real > & _F
 Bulk free energy material property. 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

Total free energy (both the bulk and gradient parts), where the bulk free energy has been defined in a material and called f_name.

Definition at line 25 of file TotalFreeEnergy.h.

Constructor & Destructor Documentation

◆ TotalFreeEnergy()

TotalFreeEnergy::TotalFreeEnergy ( const InputParameters &  parameters)

Definition at line 30 of file TotalFreeEnergy.C.

31  : TotalFreeEnergyBase(parameters), _F(getMaterialProperty<Real>("f_name")), _kappas(_nkappas)
32 {
33  // Error check to ensure size of interfacial_vars is the same as kappa_names
34  if (_nvars != _nkappas)
35  mooseError(
36  "Size of interfacial_vars is not equal to the size of kappa_names in TotalFreeEnergy");
37 
38  // Assign kappa values
39  for (unsigned int i = 0; i < _nkappas; ++i)
40  _kappas[i] = &getMaterialPropertyByName<Real>(_kappa_names[i]);
41 }
unsigned int _nvars
Coupled interface variables.
const MaterialProperty< Real > & _F
Bulk free energy material property.
std::vector< const MaterialProperty< Real > * > _kappas
Gradient interface free energy coefficients.
TotalFreeEnergyBase(const InputParameters &parameters)
std::vector< MaterialPropertyName > _kappa_names
Gradient free energy prefactor kappa.

Member Function Documentation

◆ computeValue()

Real TotalFreeEnergy::computeValue ( )
protectedvirtual

Implements TotalFreeEnergyBase.

Definition at line 44 of file TotalFreeEnergy.C.

45 {
46  // Include bulk energy contribution and additional contributions
47  Real total_energy = _F[_qp] + _additional_free_energy[_qp];
48 
49  // Calculate interfacial energy of each variable
50  for (unsigned int i = 0; i < _nvars; ++i)
51  total_energy += (*_kappas[i])[_qp] / 2.0 * (*_grad_vars[i])[_qp].norm_sq();
52 
53  return total_energy;
54 }
unsigned int _nvars
Coupled interface variables.
const VariableValue & _additional_free_energy
Additional free energy contribution.
const MaterialProperty< Real > & _F
Bulk free energy material property.
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

Member Data Documentation

◆ _additional_free_energy

const VariableValue& TotalFreeEnergyBase::_additional_free_energy
protectedinherited

◆ _F

const MaterialProperty<Real>& TotalFreeEnergy::_F
protected

Bulk free energy material property.

Definition at line 34 of file TotalFreeEnergy.h.

Referenced by computeValue().

◆ _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> *> TotalFreeEnergy::_kappas
protected

Gradient interface free energy coefficients.

Definition at line 37 of file TotalFreeEnergy.h.

Referenced by computeValue(), and TotalFreeEnergy().

◆ _nkappas

unsigned int TotalFreeEnergyBase::_nkappas
protectedinherited

◆ _nvars

unsigned int TotalFreeEnergyBase::_nvars
protectedinherited

◆ _vars

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

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