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 "ADStressDivergenceRSphericalTensors.h" 11 : #include "ElasticityTensorTools.h" 12 : #include "FEProblem.h" 13 : #include "MooseMesh.h" 14 : #include "Assembly.h" 15 : 16 : registerMooseObject("SolidMechanicsApp", ADStressDivergenceRSphericalTensors); 17 : 18 : InputParameters 19 144 : ADStressDivergenceRSphericalTensors::validParams() 20 : { 21 144 : InputParameters params = ADStressDivergenceTensors::validParams(); 22 144 : params.addClassDescription( 23 : "Calculate stress divergence for a spherically symmetric 1D problem in polar coordinates."); 24 144 : params.set<unsigned int>("component") = 0; 25 144 : return params; 26 0 : } 27 : 28 72 : ADStressDivergenceRSphericalTensors::ADStressDivergenceRSphericalTensors( 29 72 : const InputParameters & parameters) 30 72 : : ADStressDivergenceTensors(parameters) 31 : { 32 72 : if (_component != 0) 33 0 : mooseError("Invalid component for this 1D RSpherical problem."); 34 72 : } 35 : 36 : void 37 72 : ADStressDivergenceRSphericalTensors::initialSetup() 38 : { 39 72 : if (getBlockCoordSystem() != Moose::COORD_RSPHERICAL) 40 0 : mooseError("The coordinate system in the Problem block must be set to RSPHERICAL for 1D " 41 : "spherically symmetric geometries."); 42 72 : } 43 : 44 : ADReal 45 12336 : ADStressDivergenceRSphericalTensors::computeQpResidual() 46 : { 47 12336 : return _grad_test[_i][_qp](0) * _stress[_qp](0, 0) + // stress_{rr} part 1 48 12336 : (_test[_i][_qp] / _ad_q_point[_qp](0)) * _stress[_qp](1, 1) + // stress_{\theta \theta} 49 24672 : (_test[_i][_qp] / _ad_q_point[_qp](0)) * _stress[_qp](2, 2); // stress_{\phi \phi} 50 : }