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

Cross term gradient free energy contribution used by ACMultiInterface. More...

#include <CrossTermGradientFreeEnergy.h>

Inheritance diagram for CrossTermGradientFreeEnergy:
[legend]

Public Member Functions

 CrossTermGradientFreeEnergy (const InputParameters &parameters)
 

Protected Member Functions

virtual Real computeValue ()
 

Protected Attributes

std::vector< std::vector< const MaterialProperty< Real > * > > _kappas
 
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

Cross term gradient free energy contribution used by ACMultiInterface.

Definition at line 21 of file CrossTermGradientFreeEnergy.h.

Constructor & Destructor Documentation

CrossTermGradientFreeEnergy::CrossTermGradientFreeEnergy ( const InputParameters &  parameters)

Definition at line 22 of file CrossTermGradientFreeEnergy.C.

23  : TotalFreeEnergyBase(parameters), _kappas(_nvars)
24 {
25  // Error check to ensure size of interfacial_vars is the same as kappa_names
26  if (_nvars * _nvars != _nkappas)
27  mooseError("Size of interfacial_vars squared is not equal to the size of kappa_names in "
28  "CrossTermGradientFreeEnergy");
29 
30  // Assign kappa values
31  for (unsigned int i = 0; i < _nvars; ++i)
32  {
33  _kappas[i].resize(_nvars);
34 
35  for (unsigned int j = 0; j < _nvars; ++j)
36  _kappas[i][j] = &getMaterialPropertyByName<Real>(_kappa_names[i * _nvars + j]);
37  }
38 }
unsigned int _nvars
Coupled interface variables.
std::vector< std::vector< const MaterialProperty< Real > * > > _kappas
TotalFreeEnergyBase(const InputParameters &parameters)
std::vector< MaterialPropertyName > _kappa_names
Gradient free energy prefactor kappa.

Member Function Documentation

Real CrossTermGradientFreeEnergy::computeValue ( )
protectedvirtual

Implements TotalFreeEnergyBase.

Definition at line 41 of file CrossTermGradientFreeEnergy.C.

42 {
43  // This kernel does _not_ include the bulk energy contribution.
44  // It is to be used as an additional free energy component in TotalFreeEnergy.
45  // additional_free_energy can be used to daisy chain contributions!
47 
48  // Calculate interfacial energy of each variable combination
49  for (unsigned int i = 0; i < _nvars; ++i)
50  for (unsigned int j = 0; j < i; ++j)
51  {
52  const RealGradient cross =
53  (*_vars[i])[_qp] * (*_grad_vars[j])[_qp] + (*_vars[j])[_qp] * (*_grad_vars[i])[_qp];
54  total_energy += (*_kappas[i][j])[_qp] / 2.0 * cross * cross;
55  }
56  return total_energy;
57 }
unsigned int _nvars
Coupled interface variables.
const VariableValue & _additional_free_energy
Additional free energy contribution.
std::vector< std::vector< const MaterialProperty< Real > * > > _kappas
const std::string total_energy
Definition: NS.h:19
std::vector< const VariableGradient * > _grad_vars
std::vector< const VariableValue * > _vars

Member Data Documentation

const VariableValue& TotalFreeEnergyBase::_additional_free_energy
protectedinherited

Additional free energy contribution.

Definition at line 40 of file TotalFreeEnergyBase.h.

Referenced by computeValue(), TotalFreeEnergy::computeValue(), KKSMultiFreeEnergy::computeValue(), and KKSGlobalFreeEnergy::computeValue().

std::vector<const VariableGradient *> TotalFreeEnergyBase::_grad_vars
protectedinherited
std::vector<MaterialPropertyName> TotalFreeEnergyBase::_kappa_names
protectedinherited
std::vector<std::vector<const MaterialProperty<Real> *> > CrossTermGradientFreeEnergy::_kappas
protected

Definition at line 29 of file CrossTermGradientFreeEnergy.h.

Referenced by computeValue(), and CrossTermGradientFreeEnergy().

unsigned int TotalFreeEnergyBase::_nkappas
protectedinherited
unsigned int TotalFreeEnergyBase::_nvars
protectedinherited
std::vector<const VariableValue *> TotalFreeEnergyBase::_vars
protectedinherited

Definition at line 32 of file TotalFreeEnergyBase.h.

Referenced by computeValue(), and TotalFreeEnergyBase::TotalFreeEnergyBase().


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