www.mooseframework.org
VanDerWaalsFreeEnergy.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #include "VanDerWaalsFreeEnergy.h"
11 
13 
16 {
18  params.addClassDescription("Free energy of a Van der Waals gas.");
19  params.addRequiredParam<Real>("a",
20  "Van der Waals coefficient a (default mass_unit_conversion "
21  "requires this to be in [eV*Ang^3])");
22  params.addRequiredParam<Real>("b",
23  "Van der Waals molecular exclusion volume b (default "
24  "mass_unit_conversion requires this to be in [Ang^3])");
25  params.addParam<Real>("log_tol",
26  0.1,
27  "The logarithm in the free energy is evaluated using a Taylor expansion "
28  "below this value. This allows formulating free energies for systems where "
29  "the molecular volume is smaller than the exclusion volume b.");
30  return params;
31 }
32 
34  : GasFreeEnergyBase(parameters),
35  _a(getParam<Real>("a")),
36  _b(getParam<Real>("b")),
37  _log_tol(getParam<Real>("log_tol"))
38 {
39  // Definition of the free energy for the expression builder
40  EBFunction free_energy;
41  free_energy(_c, _T) =
42  -_n * _kB * _T * (plog(_nq * (1.0 / _n - _b), _log_tol) + 1.0) - _n * _n * _a;
43 
44  // Parse function for automatic differentiation
45  functionParse(free_energy);
46 }
const Real _a
Van der Waals coefficient a in [eV*Ang^3] (default units)
Material class that provides the free energy of a Van der Waals gas with the expression builder and u...
const EBTerm _n
gas number density n = N/V = c/Omega (where Omega is the lattice site volume)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
VanDerWaalsFreeEnergy(const InputParameters &parameters)
static InputParameters validParams()
void addRequiredParam(const std::string &name, const std::string &doc_string)
const EBTerm _nq
quantum concentration
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
User facing host object for a function. This combines a term with an argument list.
void addClassDescription(const std::string &doc_string)
const EBTerm _T
Coupled variable value for the Temperature.
const Real _log_tol
Taylor expansion threshold for the logarithm in the free energy.
Material class that provides the free energy of an ideal gas with the expression builder and uses aut...
registerMooseObject("PhaseFieldApp", VanDerWaalsFreeEnergy)
const EBTerm _c
Coupled variable value for the concentration .
void functionParse(const std::string &function_expression)
static InputParameters validParams()