DAMASK_EICMD/src/phase_mechanical_elastic.f90

103 lines
4.2 KiB
Fortran
Raw Normal View History

2021-03-16 21:50:24 +05:30
submodule(phase:mechanical) elastic
enum, bind(c); enumerator :: &
ELASTICITY_UNDEFINED_ID, &
2021-05-20 02:07:36 +05:30
ELASTICITY_HOOKE_ID
2021-03-16 21:50:24 +05:30
end enum
integer(kind(ELASTICITY_UNDEFINED_ID)), dimension(:), allocatable :: &
phase_elasticity !< elasticity of each phase
contains
2021-03-18 21:34:20 +05:30
2021-03-16 21:50:24 +05:30
module subroutine elastic_init(phases)
class(tNode), pointer :: &
phases
integer :: &
2021-05-20 02:07:36 +05:30
ph
2021-03-16 21:50:24 +05:30
class(tNode), pointer :: &
phase, &
mech, &
2021-05-20 02:07:36 +05:30
elastic
2021-03-16 21:50:24 +05:30
print'(/,a)', ' <<<+- phase:mechanical:elastic init -+>>>'
allocate(phase_elasticity(phases%length), source = ELASTICITY_undefined_ID)
do ph = 1, phases%length
phase => phases%get(ph)
mech => phase%get('mechanical')
elastic => mech%get('elastic')
2021-04-29 02:59:57 +05:30
if(IO_lc(elastic%get_asString('type')) == 'hooke') then ! accept small letter h for the moment
2021-03-16 21:50:24 +05:30
phase_elasticity(ph) = ELASTICITY_HOOKE_ID
else
call IO_error(200,ext_msg=elastic%get_asString('type'))
endif
enddo
end subroutine elastic_init
!--------------------------------------------------------------------------------------------------
!> @brief returns the 2nd Piola-Kirchhoff stress tensor and its tangent with respect to
!> the elastic and intermediate deformation gradients using Hooke's law
!--------------------------------------------------------------------------------------------------
module subroutine phase_hooke_SandItsTangents(S, dS_dFe, dS_dFi, &
2021-04-29 02:59:57 +05:30
Fe, Fi, ph, en)
2021-03-16 21:50:24 +05:30
integer, intent(in) :: &
ph, &
2021-04-29 02:59:57 +05:30
en
2021-03-16 21:50:24 +05:30
real(pReal), intent(in), dimension(3,3) :: &
Fe, & !< elastic deformation gradient
Fi !< intermediate deformation gradient
real(pReal), intent(out), dimension(3,3) :: &
S !< 2nd Piola-Kirchhoff stress tensor in lattice configuration
real(pReal), intent(out), dimension(3,3,3,3) :: &
dS_dFe, & !< derivative of 2nd P-K stress with respect to elastic deformation gradient
dS_dFi !< derivative of 2nd P-K stress with respect to intermediate deformation gradient
real(pReal), dimension(3,3) :: E
real(pReal), dimension(3,3,3,3) :: C
integer :: &
d, & !< counter in degradation loop
i, j
2021-04-29 02:59:57 +05:30
C = math_66toSym3333(phase_homogenizedC(ph,en))
C = phase_damage_C(C,ph,en)
2021-03-16 21:50:24 +05:30
E = 0.5_pReal*(matmul(transpose(Fe),Fe)-math_I3) !< Green-Lagrange strain in unloaded configuration
S = math_mul3333xx33(C,matmul(matmul(transpose(Fi),E),Fi)) !< 2PK stress in lattice configuration in work conjugate with GL strain pulled back to lattice configuration
do i =1, 3;do j=1,3
dS_dFe(i,j,1:3,1:3) = matmul(Fe,matmul(matmul(Fi,C(i,j,1:3,1:3)),transpose(Fi))) !< dS_ij/dFe_kl = C_ijmn * Fi_lm * Fi_on * Fe_ko
dS_dFi(i,j,1:3,1:3) = 2.0_pReal*matmul(matmul(E,Fi),C(i,j,1:3,1:3)) !< dS_ij/dFi_kl = C_ijln * E_km * Fe_mn
enddo; enddo
end subroutine phase_hooke_SandItsTangents
2021-04-29 19:46:51 +05:30
!--------------------------------------------------------------------------------------------------
!> @brief returns the homogenized elasticity matrix
!> ToDo: homogenizedC66 would be more consistent
!--------------------------------------------------------------------------------------------------
module function phase_homogenizedC(ph,en) result(C)
real(pReal), dimension(6,6) :: C
integer, intent(in) :: ph, en
plasticType: select case (phase_plasticity(ph))
case (PLASTICITY_DISLOTWIN_ID) plasticType
C = plastic_dislotwin_homogenizedC(ph,en)
case default plasticType
C = lattice_C66(1:6,1:6,ph)
end select plasticType
end function phase_homogenizedC
2021-03-16 21:50:24 +05:30
end submodule elastic