2015-05-28 22:32:23 +05:30
|
|
|
!--------------------------------------------------------------------------------------------------
|
|
|
|
!> @author Pratheek Shanthraj, Max-Planck-Institut für Eisenforschung GmbH
|
|
|
|
!> @brief material subroutine for locally evolving damage field
|
|
|
|
!--------------------------------------------------------------------------------------------------
|
|
|
|
module damage_local
|
2019-06-11 13:18:07 +05:30
|
|
|
use prec
|
2020-06-17 20:49:21 +05:30
|
|
|
use IO
|
2019-06-11 13:18:07 +05:30
|
|
|
use material
|
|
|
|
use config
|
2020-06-17 20:49:21 +05:30
|
|
|
use YAML_types
|
2020-07-09 04:31:08 +05:30
|
|
|
use constitutive
|
2019-12-10 11:44:39 +05:30
|
|
|
use results
|
2019-06-11 13:18:07 +05:30
|
|
|
|
|
|
|
implicit none
|
|
|
|
private
|
|
|
|
|
|
|
|
type :: tParameters
|
2020-02-28 15:36:21 +05:30
|
|
|
character(len=pStringLen), allocatable, dimension(:) :: &
|
|
|
|
output
|
2019-06-11 13:18:07 +05:30
|
|
|
end type tParameters
|
2020-02-28 15:36:21 +05:30
|
|
|
|
2020-06-24 20:01:45 +05:30
|
|
|
type, private :: tNumerics
|
|
|
|
real(pReal) :: &
|
|
|
|
residualStiffness !< non-zero residual damage
|
|
|
|
end type tNumerics
|
|
|
|
|
2019-06-11 13:18:07 +05:30
|
|
|
type(tparameters), dimension(:), allocatable :: &
|
|
|
|
param
|
2020-02-28 15:36:21 +05:30
|
|
|
|
2020-06-24 20:01:45 +05:30
|
|
|
type(tNumerics), private :: num
|
|
|
|
|
2019-06-11 13:18:07 +05:30
|
|
|
public :: &
|
|
|
|
damage_local_init, &
|
|
|
|
damage_local_updateState, &
|
2020-02-28 15:36:21 +05:30
|
|
|
damage_local_results
|
2015-05-28 22:32:23 +05:30
|
|
|
|
|
|
|
contains
|
|
|
|
|
|
|
|
!--------------------------------------------------------------------------------------------------
|
2019-03-09 03:46:56 +05:30
|
|
|
!> @brief module initialization
|
|
|
|
!> @details reads in material parameters, allocates arrays, and does sanity checks
|
2015-05-28 22:32:23 +05:30
|
|
|
!--------------------------------------------------------------------------------------------------
|
2019-03-09 03:46:56 +05:30
|
|
|
subroutine damage_local_init
|
2015-05-28 22:32:23 +05:30
|
|
|
|
2020-10-28 02:03:30 +05:30
|
|
|
integer :: Ninstances,Nmaterialpoints,h
|
2020-08-15 19:32:10 +05:30
|
|
|
class(tNode), pointer :: &
|
|
|
|
num_generic, &
|
|
|
|
material_homogenization, &
|
|
|
|
homog, &
|
|
|
|
homogDamage
|
2020-02-28 15:36:21 +05:30
|
|
|
|
2020-09-22 16:39:12 +05:30
|
|
|
print'(/,a)', ' <<<+- damage_local init -+>>>'; flush(IO_STDOUT)
|
2015-05-28 22:32:23 +05:30
|
|
|
|
2020-06-24 20:01:45 +05:30
|
|
|
!----------------------------------------------------------------------------------------------
|
|
|
|
! read numerics parameter and do sanity check
|
2020-09-13 14:09:17 +05:30
|
|
|
num_generic => config_numerics%get('generic',defaultVal=emptyDict)
|
2020-06-24 20:01:45 +05:30
|
|
|
num%residualStiffness = num_generic%get_asFloat('residualStiffness', defaultVal=1.0e-6_pReal)
|
|
|
|
if (num%residualStiffness < 0.0_pReal) call IO_error(301,ext_msg='residualStiffness')
|
|
|
|
|
2020-10-28 02:03:30 +05:30
|
|
|
Ninstances = count(damage_type == DAMAGE_local_ID)
|
|
|
|
allocate(param(Ninstances))
|
2020-02-28 15:36:21 +05:30
|
|
|
|
2020-09-13 14:09:17 +05:30
|
|
|
material_homogenization => config_material%get('homogenization')
|
2020-08-15 19:32:10 +05:30
|
|
|
do h = 1, material_homogenization%length
|
2019-06-11 13:18:07 +05:30
|
|
|
if (damage_type(h) /= DAMAGE_LOCAL_ID) cycle
|
2020-08-15 19:32:10 +05:30
|
|
|
homog => material_homogenization%get(h)
|
|
|
|
homogDamage => homog%get('damage')
|
|
|
|
associate(prm => param(damage_typeInstance(h)))
|
2020-02-28 15:36:21 +05:30
|
|
|
|
2020-08-15 19:32:10 +05:30
|
|
|
#if defined (__GFORTRAN__)
|
|
|
|
prm%output = output_asStrings(homogDamage)
|
|
|
|
#else
|
|
|
|
prm%output = homogDamage%get_asStrings('output',defaultVal=emptyStringArray)
|
|
|
|
#endif
|
2019-06-11 13:18:07 +05:30
|
|
|
|
2020-10-28 02:03:30 +05:30
|
|
|
Nmaterialpoints = count(material_homogenizationAt == h)
|
2019-12-21 15:25:11 +05:30
|
|
|
damageState(h)%sizeState = 1
|
2020-10-28 02:03:30 +05:30
|
|
|
allocate(damageState(h)%state0 (1,Nmaterialpoints), source=damage_initialPhi(h))
|
|
|
|
allocate(damageState(h)%subState0(1,Nmaterialpoints), source=damage_initialPhi(h))
|
|
|
|
allocate(damageState(h)%state (1,Nmaterialpoints), source=damage_initialPhi(h))
|
2020-02-28 15:36:21 +05:30
|
|
|
|
2019-12-21 15:25:11 +05:30
|
|
|
nullify(damageMapping(h)%p)
|
2020-01-23 17:18:18 +05:30
|
|
|
damageMapping(h)%p => material_homogenizationMemberAt
|
2019-12-21 15:25:11 +05:30
|
|
|
deallocate(damage(h)%p)
|
|
|
|
damage(h)%p => damageState(h)%state(1,:)
|
2020-02-28 15:36:21 +05:30
|
|
|
|
2019-06-11 13:18:07 +05:30
|
|
|
end associate
|
|
|
|
enddo
|
2015-05-28 22:32:23 +05:30
|
|
|
|
|
|
|
end subroutine damage_local_init
|
|
|
|
|
2019-06-11 13:18:07 +05:30
|
|
|
|
2015-05-28 22:32:23 +05:30
|
|
|
!--------------------------------------------------------------------------------------------------
|
2020-02-28 15:36:21 +05:30
|
|
|
!> @brief calculates local change in damage field
|
2015-05-28 22:32:23 +05:30
|
|
|
!--------------------------------------------------------------------------------------------------
|
|
|
|
function damage_local_updateState(subdt, ip, el)
|
2020-02-28 15:36:21 +05:30
|
|
|
|
2019-06-11 13:18:07 +05:30
|
|
|
integer, intent(in) :: &
|
|
|
|
ip, & !< integration point number
|
|
|
|
el !< element number
|
|
|
|
real(pReal), intent(in) :: &
|
|
|
|
subdt
|
|
|
|
logical, dimension(2) :: &
|
|
|
|
damage_local_updateState
|
|
|
|
integer :: &
|
|
|
|
homog, &
|
|
|
|
offset
|
|
|
|
real(pReal) :: &
|
2020-06-24 20:01:45 +05:30
|
|
|
phi, phiDot, dPhiDot_dPhi
|
2020-06-17 20:49:21 +05:30
|
|
|
|
2019-06-11 13:18:07 +05:30
|
|
|
homog = material_homogenizationAt(el)
|
2020-01-23 17:18:18 +05:30
|
|
|
offset = material_homogenizationMemberAt(ip,el)
|
2019-06-11 13:18:07 +05:30
|
|
|
phi = damageState(homog)%subState0(1,offset)
|
|
|
|
call damage_local_getSourceAndItsTangent(phiDot, dPhiDot_dPhi, phi, ip, el)
|
2020-06-24 20:01:45 +05:30
|
|
|
phi = max(num%residualStiffness,min(1.0_pReal,phi + subdt*phiDot))
|
2020-02-28 15:36:21 +05:30
|
|
|
|
2019-06-11 13:18:07 +05:30
|
|
|
damage_local_updateState = [ abs(phi - damageState(homog)%state(1,offset)) &
|
2020-06-16 21:23:14 +05:30
|
|
|
<= 1.0e-2_pReal &
|
2019-06-11 13:18:07 +05:30
|
|
|
.or. abs(phi - damageState(homog)%state(1,offset)) &
|
2020-06-16 21:23:14 +05:30
|
|
|
<= 1.0e-6_pReal*abs(damageState(homog)%state(1,offset)), &
|
2019-06-11 13:18:07 +05:30
|
|
|
.true.]
|
2015-05-28 22:32:23 +05:30
|
|
|
|
2020-02-28 15:36:21 +05:30
|
|
|
damageState(homog)%state(1,offset) = phi
|
2015-05-28 22:32:23 +05:30
|
|
|
|
|
|
|
end function damage_local_updateState
|
|
|
|
|
2019-06-11 13:18:07 +05:30
|
|
|
|
2015-05-28 22:32:23 +05:30
|
|
|
!--------------------------------------------------------------------------------------------------
|
2020-02-28 15:36:21 +05:30
|
|
|
!> @brief calculates homogenized local damage driving forces
|
2015-05-28 22:32:23 +05:30
|
|
|
!--------------------------------------------------------------------------------------------------
|
|
|
|
subroutine damage_local_getSourceAndItsTangent(phiDot, dPhiDot_dPhi, phi, ip, el)
|
2020-02-28 15:36:21 +05:30
|
|
|
|
2019-06-11 13:18:07 +05:30
|
|
|
integer, intent(in) :: &
|
|
|
|
ip, & !< integration point number
|
|
|
|
el !< element number
|
|
|
|
real(pReal), intent(in) :: &
|
|
|
|
phi
|
|
|
|
real(pReal) :: &
|
2020-07-09 04:31:08 +05:30
|
|
|
phiDot, dPhiDot_dPhi
|
2019-06-11 13:18:07 +05:30
|
|
|
|
|
|
|
phiDot = 0.0_pReal
|
|
|
|
dPhiDot_dPhi = 0.0_pReal
|
2020-07-09 04:31:08 +05:30
|
|
|
|
2020-07-15 18:05:21 +05:30
|
|
|
call constitutive_damage_getRateAndItsTangents(phiDot, dPhiDot_dPhi, phi, ip, el)
|
2020-02-28 15:36:21 +05:30
|
|
|
|
2020-10-28 01:57:26 +05:30
|
|
|
phiDot = phiDot/real(homogenization_Nconstituents(material_homogenizationAt(el)),pReal)
|
|
|
|
dPhiDot_dPhi = dPhiDot_dPhi/real(homogenization_Nconstituents(material_homogenizationAt(el)),pReal)
|
2020-02-28 15:36:21 +05:30
|
|
|
|
2015-05-28 22:32:23 +05:30
|
|
|
end subroutine damage_local_getSourceAndItsTangent
|
|
|
|
|
2019-05-17 02:44:47 +05:30
|
|
|
|
2019-12-10 11:44:39 +05:30
|
|
|
!--------------------------------------------------------------------------------------------------
|
|
|
|
!> @brief writes results to HDF5 output file
|
|
|
|
!--------------------------------------------------------------------------------------------------
|
2019-12-10 21:55:51 +05:30
|
|
|
subroutine damage_local_results(homog,group)
|
2019-12-10 11:44:39 +05:30
|
|
|
|
|
|
|
integer, intent(in) :: homog
|
|
|
|
character(len=*), intent(in) :: group
|
2020-02-28 15:36:21 +05:30
|
|
|
|
2019-12-21 15:06:42 +05:30
|
|
|
integer :: o
|
2019-12-10 11:44:39 +05:30
|
|
|
|
2020-02-28 15:36:21 +05:30
|
|
|
associate(prm => param(damage_typeInstance(homog)))
|
|
|
|
outputsLoop: do o = 1,size(prm%output)
|
|
|
|
select case(prm%output(o))
|
2020-08-15 19:32:10 +05:30
|
|
|
case ('phi')
|
|
|
|
call results_writeDataset(group,damage(homog)%p,prm%output(o),&
|
2019-12-10 11:44:39 +05:30
|
|
|
'damage indicator','-')
|
|
|
|
end select
|
|
|
|
enddo outputsLoop
|
|
|
|
end associate
|
|
|
|
|
|
|
|
end subroutine damage_local_results
|
|
|
|
|
|
|
|
|
2015-05-28 22:32:23 +05:30
|
|
|
end module damage_local
|