needs rework

This commit is contained in:
Martin Diehl 2021-04-14 19:58:58 +02:00
parent 0e6cb127df
commit 34dc4fda13
3 changed files with 2 additions and 162 deletions

View File

@ -40,7 +40,6 @@
#include "phase_damage_isobrittle.f90"
#include "phase_damage_isoductile.f90"
#include "phase_damage_anisobrittle.f90"
#include "phase_damage_anisoductile.f90"
#include "homogenization.f90"
#include "homogenization_mechanical.f90"
#include "homogenization_mechanical_pass.f90"

View File

@ -12,8 +12,7 @@ submodule(phase) damage
DAMAGE_UNDEFINED_ID, &
DAMAGE_ISOBRITTLE_ID, &
DAMAGE_ISODUCTILE_ID, &
DAMAGE_ANISOBRITTLE_ID, &
DAMAGE_ANISODUCTILE_ID
DAMAGE_ANISOBRITTLE_ID
end enum
@ -34,10 +33,6 @@ submodule(phase) damage
logical, dimension(:), allocatable :: mySources
end function anisobrittle_init
module function anisoductile_init() result(mySources)
logical, dimension(:), allocatable :: mySources
end function anisoductile_init
module function isobrittle_init() result(mySources)
logical, dimension(:), allocatable :: mySources
end function isobrittle_init
@ -62,10 +57,6 @@ submodule(phase) damage
S
end subroutine anisobrittle_dotState
module subroutine anisoductile_dotState(ph,me)
integer, intent(in) :: ph,me
end subroutine anisoductile_dotState
module subroutine isoductile_dotState(ph,me)
integer, intent(in) :: ph,me
end subroutine isoductile_dotState
@ -75,11 +66,6 @@ submodule(phase) damage
character(len=*), intent(in) :: group
end subroutine anisobrittle_results
module subroutine anisoductile_results(phase,group)
integer, intent(in) :: phase
character(len=*), intent(in) :: group
end subroutine anisoductile_results
module subroutine isobrittle_results(phase,group)
integer, intent(in) :: phase
character(len=*), intent(in) :: group
@ -146,7 +132,6 @@ module subroutine damage_init
where(isobrittle_init() ) phase_source = DAMAGE_ISOBRITTLE_ID
where(isoductile_init() ) phase_source = DAMAGE_ISODUCTILE_ID
where(anisobrittle_init()) phase_source = DAMAGE_ANISOBRITTLE_ID
where(anisoductile_init()) phase_source = DAMAGE_ANISODUCTILE_ID
endif
end subroutine damage_init
@ -171,7 +156,7 @@ module function phase_f_phi(phi,co,ce) result(f)
en = material_phaseEntry(co,ce)
select case(phase_source(ph))
case(DAMAGE_ISOBRITTLE_ID,DAMAGE_ISODUCTILE_ID,DAMAGE_ANISOBRITTLE_ID,DAMAGE_ANISODUCTILE_ID)
case(DAMAGE_ISOBRITTLE_ID,DAMAGE_ISODUCTILE_ID,DAMAGE_ANISOBRITTLE_ID)
f = 1.0_pReal &
- phi*damageState(ph)%state(1,en)
case default
@ -304,9 +289,6 @@ module subroutine damage_results(group,ph)
case (DAMAGE_ANISOBRITTLE_ID) sourceType
call anisobrittle_results(ph,group//'damage/')
case (DAMAGE_ANISODUCTILE_ID) sourceType
call anisoductile_results(ph,group//'damage/')
end select sourceType
end subroutine damage_results
@ -332,9 +314,6 @@ function phase_damage_collectDotState(ph,me) result(broken)
case (DAMAGE_ISODUCTILE_ID) sourceType
call isoductile_dotState(ph,me)
case (DAMAGE_ANISODUCTILE_ID) sourceType
call anisoductile_dotState(ph,me)
case (DAMAGE_ANISOBRITTLE_ID) sourceType
call anisobrittle_dotState(mechanical_S(ph,me), ph,me) ! correct stress?

View File

@ -1,138 +0,0 @@
!--------------------------------------------------------------------------------------------------
!> @author Luv Sharma, Max-Planck-Institut für Eisenforschung GmbH
!> @author Pratheek Shanthraj, Max-Planck-Institut für Eisenforschung GmbH
!> @brief material subroutine incorporating anisotropic ductile damage source mechanism
!> @details to be done
!--------------------------------------------------------------------------------------------------
submodule(phase:damage) anisoductile
type :: tParameters !< container type for internal constitutive parameters
real(pReal) :: &
q !< damage rate sensitivity
real(pReal), dimension(:), allocatable :: &
gamma_crit !< critical plastic strain per slip system
character(len=pStringLen), allocatable, dimension(:) :: &
output
end type tParameters
type(tParameters), dimension(:), allocatable :: param !< containers of constitutive parameters
contains
!--------------------------------------------------------------------------------------------------
!> @brief module initialization
!> @details reads in material parameters, allocates arrays, and does sanity checks
!--------------------------------------------------------------------------------------------------
module function anisoductile_init() result(mySources)
logical, dimension(:), allocatable :: mySources
class(tNode), pointer :: &
phases, &
phase, &
mech, &
pl, &
sources, &
src
integer :: Ninstances,Nmembers,ph
integer, dimension(:), allocatable :: N_sl
character(len=pStringLen) :: extmsg = ''
mySources = source_active('anisoductile')
if(count(mySources) == 0) return
print'(/,a)', ' <<<+- phase:damage:anisoductile init -+>>>'
print'(a,i0)', ' # phases: ',count(mySources); flush(IO_STDOUT)
phases => config_material%get('phase')
allocate(param(phases%length))
do ph = 1, phases%length
if(mySources(ph)) then
phase => phases%get(ph)
mech => phase%get('mechanical')
pl => mech%get('plastic')
sources => phase%get('damage')
associate(prm => param(ph))
src => sources%get(1)
N_sl = pl%get_as1dInt('N_sl',defaultVal=emptyIntArray)
prm%q = src%get_asFloat('q')
prm%gamma_crit = src%get_as1dFloat('gamma_crit',requiredSize=size(N_sl))
! expand: family => system
prm%gamma_crit = math_expand(prm%gamma_crit,N_sl)
#if defined (__GFORTRAN__)
prm%output = output_as1dString(src)
#else
prm%output = src%get_as1dString('output',defaultVal=emptyStringArray)
#endif
! sanity checks
if (prm%q <= 0.0_pReal) extmsg = trim(extmsg)//' q'
if (any(prm%gamma_crit < 0.0_pReal)) extmsg = trim(extmsg)//' gamma_crit'
Nmembers=count(material_phaseID==ph)
call phase_allocateState(damageState(ph),Nmembers,1,1,0)
damageState(ph)%atol = src%get_asFloat('anisoDuctile_atol',defaultVal=1.0e-3_pReal)
if(any(damageState(ph)%atol < 0.0_pReal)) extmsg = trim(extmsg)//' anisoductile_atol'
end associate
!--------------------------------------------------------------------------------------------------
! exit if any parameter is out of range
if (extmsg /= '') call IO_error(211,ext_msg=trim(extmsg)//'(damage_anisoDuctile)')
endif
enddo
end function anisoductile_init
!--------------------------------------------------------------------------------------------------
!> @brief calculates derived quantities from state
!--------------------------------------------------------------------------------------------------
module subroutine anisoductile_dotState(ph,me)
integer, intent(in) :: &
ph, &
me
associate(prm => param(ph))
damageState(ph)%dotState(1,me) = sum(plasticState(ph)%slipRate(:,me)/(damage_phi(ph,me)**prm%q)/prm%gamma_crit)
end associate
end subroutine anisoductile_dotState
!--------------------------------------------------------------------------------------------------
!> @brief writes results to HDF5 output file
!--------------------------------------------------------------------------------------------------
module subroutine anisoductile_results(phase,group)
integer, intent(in) :: phase
character(len=*), intent(in) :: group
integer :: o
associate(prm => param(phase), stt => damageState(phase)%state)
outputsLoop: do o = 1,size(prm%output)
select case(trim(prm%output(o)))
case ('f_phi')
call results_writeDataset(group,stt,trim(prm%output(o)),'driving force','J/m³')
end select
enddo outputsLoop
end associate
end subroutine anisoductile_results
end submodule anisoductile