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 "ComputeCosseratIncrementalSmallStrain.h" 11 : 12 : // MOOSE includes 13 : #include "PermutationTensor.h" 14 : 15 : #include "libmesh/quadrature.h" 16 : 17 : registerMooseObject("SolidMechanicsApp", ComputeCosseratIncrementalSmallStrain); 18 : 19 : InputParameters 20 720 : ComputeCosseratIncrementalSmallStrain::validParams() 21 : { 22 720 : InputParameters params = ComputeIncrementalStrainBase::validParams(); 23 720 : params.addClassDescription("Compute incremental small Cosserat strains"); 24 1440 : params.addRequiredCoupledVar("Cosserat_rotations", "The 3 Cosserat rotation variables"); 25 720 : return params; 26 0 : } 27 : 28 540 : ComputeCosseratIncrementalSmallStrain::ComputeCosseratIncrementalSmallStrain( 29 540 : const InputParameters & parameters) 30 : : ComputeIncrementalStrainBase(parameters), 31 540 : _curvature(declareProperty<RankTwoTensor>("curvature")), 32 540 : _nrots(coupledComponents("Cosserat_rotations")), 33 540 : _wc(coupledValues("Cosserat_rotations")), 34 540 : _wc_old(coupledValuesOld("Cosserat_rotations")), 35 540 : _grad_wc(coupledGradients("Cosserat_rotations")), 36 540 : _grad_wc_old(coupledGradientsOld("Cosserat_rotations")), 37 1080 : _curvature_old(getMaterialPropertyOld<RankTwoTensor>("curvature")), 38 1080 : _curvature_increment(declareProperty<RankTwoTensor>("curvature_increment")) 39 : { 40 540 : if (_nrots != 3) 41 0 : mooseError("ComputeCosseratSmallStrain: This Material is only defined for 3-dimensional " 42 : "simulations so 3 Cosserat rotation variables are needed"); 43 540 : } 44 : 45 : void 46 9504 : ComputeCosseratIncrementalSmallStrain::initQpStatefulProperties() 47 : { 48 9504 : ComputeIncrementalStrainBase::initQpStatefulProperties(); 49 : 50 9504 : _curvature[_qp].zero(); 51 9504 : } 52 : 53 : void 54 53328 : ComputeCosseratIncrementalSmallStrain::computeQpProperties() 55 : { 56 : auto strain = RankTwoTensor::initializeFromRows( 57 53328 : (*_grad_disp[0])[_qp], (*_grad_disp[1])[_qp], (*_grad_disp[2])[_qp]); 58 : auto strain_old = RankTwoTensor::initializeFromRows( 59 53328 : (*_grad_disp_old[0])[_qp], (*_grad_disp_old[1])[_qp], (*_grad_disp_old[2])[_qp]); 60 53328 : RealVectorValue wc_vector((*_wc[0])[_qp], (*_wc[1])[_qp], (*_wc[2])[_qp]); 61 53328 : RealVectorValue wc_vector_old((*_wc_old[0])[_qp], (*_wc_old[1])[_qp], (*_wc_old[2])[_qp]); 62 : 63 213312 : for (unsigned i = 0; i < LIBMESH_DIM; ++i) 64 639936 : for (unsigned j = 0; j < LIBMESH_DIM; ++j) 65 1919808 : for (unsigned k = 0; k < LIBMESH_DIM; ++k) 66 : { 67 1439856 : strain(i, j) += PermutationTensor::eps(i, j, k) * wc_vector(k); 68 1439856 : strain_old(i, j) += PermutationTensor::eps(i, j, k) * wc_vector_old(k); 69 : } 70 : 71 : // Gauss point deformation gradient 72 53328 : _deformation_gradient[_qp] = strain; 73 53328 : _deformation_gradient[_qp].addIa(1.0); 74 : 75 53328 : const RankTwoTensor total_strain_increment = strain - strain_old; 76 : 77 53328 : _strain_increment[_qp] = total_strain_increment; 78 : 79 : // Remove the eigenstrain increment 80 53328 : subtractEigenstrainIncrementFromStrain(_strain_increment[_qp]); 81 : 82 53328 : _strain_rate[_qp] = _strain_increment[_qp] / _dt; 83 : 84 53328 : _total_strain[_qp] = _total_strain_old[_qp] + total_strain_increment; 85 53328 : _mechanical_strain[_qp] = _mechanical_strain_old[_qp] + _strain_increment[_qp]; 86 : 87 : auto curv = RankTwoTensor::initializeFromRows( 88 53328 : (*_grad_wc[0])[_qp], (*_grad_wc[1])[_qp], (*_grad_wc[2])[_qp]); 89 : auto curv_old = RankTwoTensor::initializeFromRows( 90 53328 : (*_grad_wc_old[0])[_qp], (*_grad_wc_old[1])[_qp], (*_grad_wc_old[2])[_qp]); 91 53328 : _curvature_increment[_qp] = curv - curv_old; 92 53328 : _curvature[_qp] = _curvature_old[_qp] + _curvature_increment[_qp]; 93 : 94 : // incremental small strain does not include rotation 95 53328 : _rotation_increment[_qp].setToIdentity(); 96 53328 : }