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