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

Calculate Grand Potential interface parameters for a specified interfacial free energy and width. More...

#include <GrandPotentialInterface.h>

Inheritance diagram for GrandPotentialInterface:
[legend]

Public Member Functions

 GrandPotentialInterface (const InputParameters &parameters)
 

Protected Member Functions

virtual void computeQpProperties () override
 

Protected Attributes

const std::vector< Real > _sigma
 list of interfacial free energies More...
 
const Real _width
 Interface width for the interface with the median interfacial free energy. More...
 
const unsigned int _n_pair
 number of interface pairs More...
 
std::vector< MaterialPropertyName > _gamma_name
 gamma material property names More...
 
std::vector< Real > _gamma
 Calculated gamma parameter values. More...
 
Real _kappa
 
Real _mu
 
std::vector< MaterialProperty< Real > * > _gamma_prop
 Material properties for all interface pairs. More...
 
MaterialProperty< Real > & _kappa_prop
 
MaterialProperty< Real > & _mu_prop
 

Detailed Description

Calculate Grand Potential interface parameters for a specified interfacial free energy and width.

Definition at line 23 of file GrandPotentialInterface.h.

Constructor & Destructor Documentation

◆ GrandPotentialInterface()

GrandPotentialInterface::GrandPotentialInterface ( const InputParameters &  parameters)

Definition at line 39 of file GrandPotentialInterface.C.

40  : Material(parameters),
41  _sigma(getParam<std::vector<Real>>("sigma")),
42  _width(getParam<Real>("width")),
43  _n_pair(_sigma.size()),
44  _gamma(_n_pair),
45  _gamma_name(getParam<std::vector<MaterialPropertyName>>("gamma_names")),
47  _kappa_prop(declareProperty<Real>(getParam<MaterialPropertyName>("kappa_name"))),
48  _mu_prop(declareProperty<Real>(getParam<MaterialPropertyName>("mu_name")))
49 {
50  // error check parameters
51  if (_n_pair == 0)
52  paramError("sigma", "Specify at least one interfacial energy");
53 
54  if (_gamma_name.size() != 0 && _gamma_name.size() != _n_pair)
55  paramError("gamma_names",
56  "Specify either as many entries are sigma values or none at all for auto-naming the "
57  "gamma material properties.");
58 
59  // automatic names for the gamma properties
60  if (_gamma_name.size() == 0)
61  for (unsigned int i = 0; i < _n_pair; i++)
62  _gamma_name[i] = "gamma" + Moose::stringify(i);
63 
64  // declare gamma material properties
65  for (unsigned int i = 0; i < _n_pair; i++)
66  _gamma_prop[i] = &declareProperty<Real>(_gamma_name[i]);
67 
68  // determine median interfacial free energy (or use explicit user choice)
69  unsigned int median;
70  if (isParamValid("sigma_index"))
71  median = getParam<unsigned int>("sigma_index");
72  else
73  {
74  std::vector<size_t> indices;
75  Moose::indirectSort(_sigma.begin(), _sigma.end(), indices);
76  median = indices[(indices.size() - 1) / 2];
77  }
78 
79  // set the median gamma to 1.5 and use analytical expression for kappa and mu (m)
80  _gamma[median] = 1.5;
81  _kappa = 3.0 / 4.0 * _sigma[median] * _width;
82  _mu = 6.0 * _sigma[median] / _width;
83 
84  // set all other gammas
85  for (unsigned int i = 0; i < _n_pair; ++i)
86  {
87  // skip the already calculated median value
88  if (i == median)
89  continue;
90 
91  const Real g = _sigma[i] / std::sqrt(_mu * _kappa);
92 
93  // estimate for gamma from polynomial expansion
94  Real gamma = 1.0 / (-5.288 * Utility::pow<8>(g) - 0.09364 * Utility::pow<6>(g) +
95  9.965 * Utility::pow<4>(g) - 8.183 * Utility::pow<2>(g) + 2.007);
96 
97  _gamma[i] = gamma;
98  }
99 }
std::vector< MaterialPropertyName > _gamma_name
gamma material property names
MaterialProperty< Real > & _kappa_prop
const unsigned int _n_pair
number of interface pairs
std::vector< Real > _gamma
Calculated gamma parameter values.
std::vector< MaterialProperty< Real > * > _gamma_prop
Material properties for all interface pairs.
const Real _width
Interface width for the interface with the median interfacial free energy.
MaterialProperty< Real > & _mu_prop
const std::vector< Real > _sigma
list of interfacial free energies

Member Function Documentation

◆ computeQpProperties()

void GrandPotentialInterface::computeQpProperties ( )
overrideprotectedvirtual

Definition at line 102 of file GrandPotentialInterface.C.

103 {
104  _kappa_prop[_qp] = _kappa;
105  _mu_prop[_qp] = _mu;
106  for (unsigned int i = 0; i < _n_pair; ++i)
107  (*_gamma_prop[i])[_qp] = _gamma[i];
108 }
MaterialProperty< Real > & _kappa_prop
const unsigned int _n_pair
number of interface pairs
std::vector< Real > _gamma
Calculated gamma parameter values.
std::vector< MaterialProperty< Real > * > _gamma_prop
Material properties for all interface pairs.
MaterialProperty< Real > & _mu_prop

Member Data Documentation

◆ _gamma

std::vector<Real> GrandPotentialInterface::_gamma
protected

Calculated gamma parameter values.

Definition at line 41 of file GrandPotentialInterface.h.

Referenced by computeQpProperties(), and GrandPotentialInterface().

◆ _gamma_name

std::vector<MaterialPropertyName> GrandPotentialInterface::_gamma_name
protected

gamma material property names

Definition at line 47 of file GrandPotentialInterface.h.

Referenced by GrandPotentialInterface().

◆ _gamma_prop

std::vector<MaterialProperty<Real> *> GrandPotentialInterface::_gamma_prop
protected

Material properties for all interface pairs.

Definition at line 50 of file GrandPotentialInterface.h.

Referenced by computeQpProperties(), and GrandPotentialInterface().

◆ _kappa

Real GrandPotentialInterface::_kappa
protected

Definition at line 42 of file GrandPotentialInterface.h.

Referenced by computeQpProperties(), and GrandPotentialInterface().

◆ _kappa_prop

MaterialProperty<Real>& GrandPotentialInterface::_kappa_prop
protected

Definition at line 51 of file GrandPotentialInterface.h.

Referenced by computeQpProperties().

◆ _mu

Real GrandPotentialInterface::_mu
protected

Definition at line 43 of file GrandPotentialInterface.h.

Referenced by computeQpProperties(), and GrandPotentialInterface().

◆ _mu_prop

MaterialProperty<Real>& GrandPotentialInterface::_mu_prop
protected

Definition at line 52 of file GrandPotentialInterface.h.

Referenced by computeQpProperties().

◆ _n_pair

const unsigned int GrandPotentialInterface::_n_pair
protected

number of interface pairs

Definition at line 38 of file GrandPotentialInterface.h.

Referenced by computeQpProperties(), and GrandPotentialInterface().

◆ _sigma

const std::vector<Real> GrandPotentialInterface::_sigma
protected

list of interfacial free energies

Definition at line 32 of file GrandPotentialInterface.h.

Referenced by GrandPotentialInterface().

◆ _width

const Real GrandPotentialInterface::_width
protected

Interface width for the interface with the median interfacial free energy.

Definition at line 35 of file GrandPotentialInterface.h.

Referenced by GrandPotentialInterface().


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