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 "ComputeMeanThermalExpansionEigenstrainBase.h" 11 : #include "Function.h" 12 : 13 : template <bool is_ad> 14 : InputParameters 15 408 : ComputeMeanThermalExpansionEigenstrainBaseTempl<is_ad>::validParams() 16 : { 17 408 : InputParameters params = ComputeThermalExpansionEigenstrainBaseTempl<is_ad>::validParams(); 18 408 : params.addClassDescription("Base class for models that compute eigenstrain due to mean" 19 : "thermal expansion as a function of temperature"); 20 816 : params.addParam<Real>("thermal_expansion_scale_factor", 21 816 : 1.0, 22 : "Scaling factor on the thermal expansion strain. This input parameter can " 23 : "be used to perform sensitivity analysis on thermal expansion."); 24 816 : params.addParamNamesToGroup("thermal_expansion_scale_factor", "Advanced"); 25 : 26 408 : return params; 27 0 : } 28 : 29 : template <bool is_ad> 30 306 : ComputeMeanThermalExpansionEigenstrainBaseTempl< 31 : is_ad>::ComputeMeanThermalExpansionEigenstrainBaseTempl(const InputParameters & parameters) 32 : : ComputeThermalExpansionEigenstrainBaseTempl<is_ad>(parameters), 33 612 : _thermal_expansion_scale_factor(this->template getParam<Real>("thermal_expansion_scale_factor")) 34 : { 35 306 : } 36 : 37 : template <bool is_ad> 38 : ValueAndDerivative<is_ad> 39 2215136 : ComputeMeanThermalExpansionEigenstrainBaseTempl<is_ad>::computeThermalStrain() 40 : { 41 2215136 : const auto reference_temperature = referenceTemperature(); 42 : 43 2215136 : const auto current_alphabar = meanThermalExpansionCoefficient(this->_temperature[_qp]); 44 2215136 : const auto thexp_T = current_alphabar * (this->_temperature[_qp] - reference_temperature); 45 : 46 : // Mean linear thermal expansion coefficient relative to the reference temperature 47 : // evaluated at stress_free_temperature. This is 48 : // \f$\bar{\alpha} = (\delta L(T_{sf}) / L) / (T_{sf} - T_{ref})\f$ 49 : // where \f$T_sf\f$ is the stress-free temperature and \f$T_{ref}\f$ is the reference temperature. 50 2215136 : const auto alphabar_stress_free_temperature = 51 2215136 : meanThermalExpansionCoefficient(this->_stress_free_temperature[_qp]); 52 : 53 : // Thermal expansion relative to the reference temperature evaluated at stress_free_temperature 54 : // \f$(\delta L(T_sf) / L)\f$, where \f$T_sf\f$ is the stress-free temperature. 55 : const auto thexp_stress_free_temperature = 56 : alphabar_stress_free_temperature * 57 2215136 : (this->_stress_free_temperature[_qp] - referenceTemperature()); 58 : 59 : // Per M. Niffenegger and K. Reichlin (2012), thermal_strain should be divided 60 : // by (1.0 + thexp_stress_free_temperature) to account for the ratio of 61 : // the length at the stress-free temperature to the length at the reference 62 : // temperature. It can be neglected because it is very close to 1, 63 : // but we include it for completeness here. 64 : 65 2215136 : auto thermal_strain = 66 2094816 : (thexp_T - thexp_stress_free_temperature) / (1.0 + thexp_stress_free_temperature); 67 : 68 2215136 : return _thermal_expansion_scale_factor * thermal_strain; 69 : } 70 : 71 : template class ComputeMeanThermalExpansionEigenstrainBaseTempl<false>; 72 : template class ComputeMeanThermalExpansionEigenstrainBaseTempl<true>;