Line data Source code
1 : //* This file is part of the MOOSE framework 2 : //* https://www.mooseframework.org 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("TensorMechanicsApp", ComputeCosseratIncrementalSmallStrain); 18 : 19 : InputParameters 20 348 : ComputeCosseratIncrementalSmallStrain::validParams() 21 : { 22 348 : InputParameters params = ComputeIncrementalStrainBase::validParams(); 23 348 : params.addClassDescription("Compute incremental small Cosserat strains"); 24 696 : params.addRequiredCoupledVar("Cosserat_rotations", "The 3 Cosserat rotation variables"); 25 348 : return params; 26 0 : } 27 : 28 261 : ComputeCosseratIncrementalSmallStrain::ComputeCosseratIncrementalSmallStrain( 29 261 : const InputParameters & parameters) 30 : : ComputeIncrementalStrainBase(parameters), 31 261 : _curvature(declareProperty<RankTwoTensor>("curvature")), 32 261 : _nrots(coupledComponents("Cosserat_rotations")), 33 261 : _wc(coupledValues("Cosserat_rotations")), 34 261 : _wc_old(coupledValuesOld("Cosserat_rotations")), 35 261 : _grad_wc(coupledGradients("Cosserat_rotations")), 36 261 : _grad_wc_old(coupledGradientsOld("Cosserat_rotations")), 37 522 : _curvature_old(getMaterialPropertyOld<RankTwoTensor>("curvature")), 38 522 : _curvature_increment(declareProperty<RankTwoTensor>("curvature_increment")) 39 : { 40 261 : 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 261 : } 44 : 45 : void 46 41344 : ComputeCosseratIncrementalSmallStrain::initQpStatefulProperties() 47 : { 48 41344 : ComputeIncrementalStrainBase::initQpStatefulProperties(); 49 : 50 41344 : _curvature[_qp].zero(); 51 41344 : } 52 : 53 : void 54 100304 : ComputeCosseratIncrementalSmallStrain::computeQpProperties() 55 : { 56 : auto strain = RankTwoTensor::initializeFromRows( 57 100304 : (*_grad_disp[0])[_qp], (*_grad_disp[1])[_qp], (*_grad_disp[2])[_qp]); 58 : auto strain_old = RankTwoTensor::initializeFromRows( 59 100304 : (*_grad_disp_old[0])[_qp], (*_grad_disp_old[1])[_qp], (*_grad_disp_old[2])[_qp]); 60 100304 : RealVectorValue wc_vector((*_wc[0])[_qp], (*_wc[1])[_qp], (*_wc[2])[_qp]); 61 100304 : RealVectorValue wc_vector_old((*_wc_old[0])[_qp], (*_wc_old[1])[_qp], (*_wc_old[2])[_qp]); 62 : 63 401216 : for (unsigned i = 0; i < LIBMESH_DIM; ++i) 64 1203648 : for (unsigned j = 0; j < LIBMESH_DIM; ++j) 65 3610944 : for (unsigned k = 0; k < LIBMESH_DIM; ++k) 66 : { 67 2708208 : strain(i, j) += PermutationTensor::eps(i, j, k) * wc_vector(k); 68 2708208 : strain_old(i, j) += PermutationTensor::eps(i, j, k) * wc_vector_old(k); 69 : } 70 : 71 : // Gauss point deformation gradient 72 100304 : _deformation_gradient[_qp] = strain; 73 100304 : _deformation_gradient[_qp].addIa(1.0); 74 : 75 100304 : const RankTwoTensor total_strain_increment = strain - strain_old; 76 : 77 100304 : _strain_increment[_qp] = total_strain_increment; 78 : 79 : // Remove the eigenstrain increment 80 100304 : subtractEigenstrainIncrementFromStrain(_strain_increment[_qp]); 81 : 82 100304 : _strain_rate[_qp] = _strain_increment[_qp] / _dt; 83 : 84 100304 : _total_strain[_qp] = _total_strain_old[_qp] + total_strain_increment; 85 100304 : _mechanical_strain[_qp] = _mechanical_strain_old[_qp] + _strain_increment[_qp]; 86 : 87 : auto curv = RankTwoTensor::initializeFromRows( 88 100304 : (*_grad_wc[0])[_qp], (*_grad_wc[1])[_qp], (*_grad_wc[2])[_qp]); 89 : auto curv_old = RankTwoTensor::initializeFromRows( 90 100304 : (*_grad_wc_old[0])[_qp], (*_grad_wc_old[1])[_qp], (*_grad_wc_old[2])[_qp]); 91 100304 : _curvature_increment[_qp] = curv - curv_old; 92 100304 : _curvature[_qp] = _curvature_old[_qp] + _curvature_increment[_qp]; 93 : 94 : // incremental small strain does not include rotation 95 100304 : _rotation_increment[_qp].setToIdentity(); 96 100304 : }