Line data Source code
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 : 10 : #include "ComputeExtraStressVDWGas.h" 11 : 12 : registerMooseObject("SolidMechanicsApp", ComputeExtraStressVDWGas); 13 : 14 : InputParameters 15 0 : ComputeExtraStressVDWGas::validParams() 16 : { 17 0 : InputParameters params = ComputeExtraStressBase::validParams(); 18 0 : 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 0 : params.addRequiredParam<MaterialPropertyName>( 22 : "b", "Hard-sphere exclusion volume of van der Waals gas atoms in nm^3"); 23 0 : params.addRequiredParam<MaterialPropertyName>("Va", "Atomic volume of lattice atoms in nm^3"); 24 0 : params.addRequiredParam<MaterialPropertyName>("T", "Temperature in K"); 25 0 : params.addRequiredCoupledVar("cg", "Gas concentration (relative to lattice atoms)"); 26 0 : params.addParam<Real>("nondim_factor", 27 0 : 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 0 : return params; 32 0 : } 33 : 34 0 : ComputeExtraStressVDWGas::ComputeExtraStressVDWGas(const InputParameters & parameters) 35 : : ComputeExtraStressBase(parameters), 36 0 : _b(getMaterialProperty<Real>("b")), 37 0 : _Va(getMaterialProperty<Real>("Va")), 38 0 : _T(getMaterialProperty<Real>("T")), 39 0 : _cg(coupledValue("cg")), 40 0 : _nondim_factor(getParam<Real>("nondim_factor")), 41 0 : _kB(1.38064852e-23) // Boltzmann constant in J/K 42 : { 43 0 : } 44 : 45 : void 46 0 : ComputeExtraStressVDWGas::computeQpExtraStress() 47 : { 48 0 : _extra_stress[_qp].zero(); 49 0 : _extra_stress[_qp].addIa(-_kB * _T[_qp] / (_Va[_qp] / _cg[_qp] - _b[_qp]) * 1.0e27 / 50 0 : _nondim_factor); 51 0 : }