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 "LinearElasticTruss.h" 11 : 12 : registerMooseObject("SolidMechanicsApp", LinearElasticTruss); 13 : 14 : InputParameters 15 178 : LinearElasticTruss::validParams() 16 : { 17 178 : InputParameters params = TrussMaterial::validParams(); 18 178 : params.addClassDescription("Computes the linear elastic strain for a truss element"); 19 356 : params.addParam<Real>("thermal_expansion_coeff", 0.0, "Thermal expansion coefficient in 1/K"); 20 356 : params.addParam<Real>("temperature_ref", 273, "Reference temperature for thermal expansion in K"); 21 356 : params.addCoupledVar("temperature", 273, "Temperature in Kelvin"); 22 178 : return params; 23 0 : } 24 : 25 134 : LinearElasticTruss::LinearElasticTruss(const InputParameters & parameters) 26 : : TrussMaterial(parameters), 27 134 : _T(coupledValue("temperature")), 28 268 : _T0(getParam<Real>("temperature_ref")), 29 402 : _thermal_expansion_coeff(getParam<Real>("thermal_expansion_coeff")) 30 : { 31 134 : } 32 : 33 : void 34 11364 : LinearElasticTruss::computeQpStrain() 35 : { 36 11364 : _total_stretch[_qp] = _current_length / _origin_length - 1.0; 37 11364 : _elastic_stretch[_qp] = _total_stretch[_qp] - _thermal_expansion_coeff * (_T[_qp] - _T0); 38 11364 : } 39 : 40 : void 41 11364 : LinearElasticTruss::computeQpStress() 42 : { 43 11364 : _axial_stress[_qp] = _youngs_modulus[_qp] * _elastic_stretch[_qp]; 44 11364 : }