https://mooseframework.inl.gov
ComputeExtraStressVDWGas.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
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 
11 
12 registerMooseObject("SolidMechanicsApp", ComputeExtraStressVDWGas);
13 
16 {
18  params.addClassDescription(
19  "Computes a hydrostatic stress corresponding to the pressure of a van der Waals gas that is "
20  "added as an extra_stress to the stress computed by the constitutive model");
21  params.addRequiredParam<MaterialPropertyName>(
22  "b", "Hard-sphere exclusion volume of van der Waals gas atoms in nm^3");
23  params.addRequiredParam<MaterialPropertyName>("Va", "Atomic volume of lattice atoms in nm^3");
24  params.addRequiredParam<MaterialPropertyName>("T", "Temperature in K");
25  params.addRequiredCoupledVar("cg", "Gas concentration (relative to lattice atoms)");
26  params.addParam<Real>("nondim_factor",
27  1.0,
28  "Optional factor to non-dimensionalize pressure (pressure is calculated in "
29  "Pa, set this factor to characteristic energy density used for "
30  "non-dimensionalization if desired)");
31  return params;
32 }
33 
35  : ComputeExtraStressBase(parameters),
36  _b(getMaterialProperty<Real>("b")),
37  _Va(getMaterialProperty<Real>("Va")),
38  _T(getMaterialProperty<Real>("T")),
39  _cg(coupledValue("cg")),
40  _nondim_factor(getParam<Real>("nondim_factor")),
41  _kB(1.38064852e-23) // Boltzmann constant in J/K
42 {
43 }
44 
45 void
47 {
48  _extra_stress[_qp].zero();
49  _extra_stress[_qp].addIa(-_kB * _T[_qp] / (_Va[_qp] / _cg[_qp] - _b[_qp]) * 1.0e27 /
51 }
Computes a concentration-dependent ExtraStress bases on the van der Waals equation of state that is a...
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
ComputeExtraStressBase is the base class for extra_stress, which is added to stress calculated by the...
const MaterialProperty< Real > & _b
registerMooseObject("SolidMechanicsApp", ComputeExtraStressVDWGas)
void addRequiredParam(const std::string &name, const std::string &doc_string)
const MaterialProperty< Real > & _T
unsigned int _qp
static InputParameters validParams()
static InputParameters validParams()
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
MaterialProperty< RankTwoTensor > & _extra_stress
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)
ComputeExtraStressVDWGas(const InputParameters &parameters)
const MaterialProperty< Real > & _Va