www.mooseframework.org
VanDerWaalsFreeEnergy.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
8 
9 template <>
10 InputParameters
12 {
13  InputParameters params = validParams<GasFreeEnergyBase>();
14  params.addClassDescription("Free energy of a Van der Waals gas.");
15  params.addRequiredParam<Real>("a",
16  "Van der Waals coeefficient a (default mass_unit_conversion "
17  "requires this to be in [eV*Ang^3])");
18  params.addRequiredParam<Real>("b",
19  "Van der Waals molecular exclusion volume b (default "
20  "mass_unit_conversion requires this to be in [Ang^3])");
21  params.addParam<Real>("log_tol",
22  0.1,
23  "The logarithm in the free energy is evaluated using a Taylor expansion "
24  "below this value. This allows formulating free energies for systems where "
25  "the molecular volume is smaller than the exclusion volume b.");
26  return params;
27 }
28 
29 VanDerWaalsFreeEnergy::VanDerWaalsFreeEnergy(const InputParameters & parameters)
30  : GasFreeEnergyBase(parameters),
31  _a(getParam<Real>("a")),
32  _b(getParam<Real>("b")),
33  _log_tol(getParam<Real>("log_tol"))
34 {
35  // Definition of the free energy for the expression builder
36  EBFunction free_energy;
37  free_energy(_c, _T) =
38  -_n * _kB * _T * (plog(_nq * (1.0 / _n - _b), _log_tol) + 1.0) - _n * _n * _a;
39 
40  // Parse function for automatic differentiation
41  functionParse(free_energy);
42 }
const Real _a
Van der Waals coefficient a in [eV*Ang^3] (default units)
InputParameters validParams< VanDerWaalsFreeEnergy >()
const EBTerm _n
gas number density n = N/V = c/Omega (where Omega is the lattice site volume)
VanDerWaalsFreeEnergy(const InputParameters &parameters)
const EBTerm _nq
quantum concentration
User facing host object for a function. This combines a term with an argument list.
InputParameters validParams< GasFreeEnergyBase >()
const EBTerm _T
Coupled variable value for the Temperature.
const Real _log_tol
Taylor expansion threshold for the logarithm in the free energy.
void functionParse(const std::string &function_expression)
Material class that provides the free energy of an ideal gas with the expression builder and uses aut...
const EBTerm _c
Coupled variable value for the concentration .