2015-05-28 22:32:23 +05:30
|
|
|
!--------------------------------------------------------------------------------------------------
|
|
|
|
!> @author Pratheek Shanthraj, Max-Planck-Institut für Eisenforschung GmbH
|
|
|
|
!> @brief material subroutine for thermal source due to plastic dissipation
|
|
|
|
!> @details to be done
|
|
|
|
!--------------------------------------------------------------------------------------------------
|
|
|
|
module source_thermal_dissipation
|
|
|
|
use prec, only: &
|
|
|
|
pReal, &
|
|
|
|
pInt
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
private
|
|
|
|
integer(pInt), dimension(:), allocatable, public, protected :: &
|
|
|
|
source_thermal_dissipation_sizePostResults, & !< cumulative size of post results
|
|
|
|
source_thermal_dissipation_offset, & !< which source is my current thermal dissipation mechanism?
|
|
|
|
source_thermal_dissipation_instance !< instance of thermal dissipation source mechanism
|
|
|
|
|
|
|
|
integer(pInt), dimension(:,:), allocatable, target, public :: &
|
|
|
|
source_thermal_dissipation_sizePostResult !< size of each post result output
|
|
|
|
|
|
|
|
character(len=64), dimension(:,:), allocatable, target, public :: &
|
|
|
|
source_thermal_dissipation_output !< name of each post result output
|
|
|
|
|
|
|
|
integer(pInt), dimension(:), allocatable, target, public :: &
|
|
|
|
source_thermal_dissipation_Noutput !< number of outputs per instance of this source
|
|
|
|
|
|
|
|
real(pReal), dimension(:), allocatable, private :: &
|
|
|
|
source_thermal_dissipation_coldworkCoeff
|
|
|
|
|
2018-12-31 01:28:38 +05:30
|
|
|
|
|
|
|
type, private :: tParameters !< container type for internal constitutive parameters
|
|
|
|
real(pReal) :: &
|
|
|
|
coldworkCoeff
|
|
|
|
end type tParameters
|
|
|
|
|
|
|
|
type(tParameters), dimension(:), allocatable, private :: param !< containers of constitutive parameters (len Ninstance)
|
|
|
|
|
|
|
|
|
2015-05-28 22:32:23 +05:30
|
|
|
public :: &
|
|
|
|
source_thermal_dissipation_init, &
|
|
|
|
source_thermal_dissipation_getRateAndItsTangent
|
|
|
|
|
|
|
|
contains
|
|
|
|
|
|
|
|
|
|
|
|
!--------------------------------------------------------------------------------------------------
|
|
|
|
!> @brief module initialization
|
|
|
|
!> @details reads in material parameters, allocates arrays, and does sanity checks
|
|
|
|
!--------------------------------------------------------------------------------------------------
|
2019-02-22 20:07:42 +05:30
|
|
|
subroutine source_thermal_dissipation_init
|
2015-05-28 22:32:23 +05:30
|
|
|
use debug, only: &
|
|
|
|
debug_level,&
|
|
|
|
debug_constitutive,&
|
|
|
|
debug_levelBasic
|
|
|
|
use material, only: &
|
2019-02-22 20:07:42 +05:30
|
|
|
material_allocateSourceState, &
|
2015-05-28 22:32:23 +05:30
|
|
|
phase_source, &
|
|
|
|
phase_Nsources, &
|
|
|
|
phase_Noutput, &
|
|
|
|
SOURCE_thermal_dissipation_label, &
|
|
|
|
SOURCE_thermal_dissipation_ID, &
|
|
|
|
material_phase, &
|
2018-06-10 21:31:52 +05:30
|
|
|
sourceState
|
2018-06-14 10:09:49 +05:30
|
|
|
use config, only: &
|
2018-12-31 01:28:38 +05:30
|
|
|
config_phase, &
|
2018-06-10 21:31:52 +05:30
|
|
|
material_Nphase, &
|
2015-05-28 22:32:23 +05:30
|
|
|
MATERIAL_partPhase
|
|
|
|
|
|
|
|
implicit none
|
2019-02-22 20:07:42 +05:30
|
|
|
integer(pInt) :: Ninstance,instance,source,sourceOffset
|
2018-12-31 01:28:38 +05:30
|
|
|
integer(pInt) :: NofMyPhase,p
|
2015-05-28 22:32:23 +05:30
|
|
|
|
2016-07-25 23:42:00 +05:30
|
|
|
write(6,'(/,a)') ' <<<+- source_'//SOURCE_thermal_dissipation_label//' init -+>>>'
|
2019-02-22 20:07:42 +05:30
|
|
|
|
2015-05-28 22:32:23 +05:30
|
|
|
|
2018-12-31 01:28:38 +05:30
|
|
|
Ninstance = int(count(phase_source == SOURCE_thermal_dissipation_ID),pInt)
|
|
|
|
if (Ninstance == 0_pInt) return
|
2015-05-28 22:32:23 +05:30
|
|
|
if (iand(debug_level(debug_constitutive),debug_levelBasic) /= 0_pInt) &
|
2018-12-31 01:28:38 +05:30
|
|
|
write(6,'(a16,1x,i5,/)') '# instances:',Ninstance
|
2015-05-28 22:32:23 +05:30
|
|
|
|
|
|
|
allocate(source_thermal_dissipation_offset(material_Nphase), source=0_pInt)
|
|
|
|
allocate(source_thermal_dissipation_instance(material_Nphase), source=0_pInt)
|
2019-02-22 20:07:42 +05:30
|
|
|
do p = 1, material_Nphase
|
|
|
|
source_thermal_dissipation_instance(p) = count(phase_source(:,1:p) == SOURCE_thermal_dissipation_ID)
|
|
|
|
do source = 1, phase_Nsources(p)
|
|
|
|
if (phase_source(source,p) == SOURCE_thermal_dissipation_ID) &
|
|
|
|
source_thermal_dissipation_offset(p) = source
|
2015-05-28 22:32:23 +05:30
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
|
2018-12-31 01:28:38 +05:30
|
|
|
allocate(source_thermal_dissipation_sizePostResults(Ninstance), source=0_pInt)
|
|
|
|
allocate(source_thermal_dissipation_sizePostResult(maxval(phase_Noutput),Ninstance),source=0_pInt)
|
|
|
|
allocate(source_thermal_dissipation_output (maxval(phase_Noutput),Ninstance))
|
2015-05-28 22:32:23 +05:30
|
|
|
source_thermal_dissipation_output = ''
|
2018-12-31 01:28:38 +05:30
|
|
|
allocate(source_thermal_dissipation_Noutput(Ninstance), source=0_pInt)
|
|
|
|
|
|
|
|
allocate(source_thermal_dissipation_coldworkCoeff(Ninstance), source=0.0_pReal)
|
|
|
|
|
|
|
|
do p=1, size(config_phase)
|
2019-02-22 20:07:42 +05:30
|
|
|
if (all(phase_source(:,p) /= SOURCE_THERMAL_DISSIPATION_ID)) cycle
|
|
|
|
instance = source_thermal_dissipation_instance(p)
|
|
|
|
source_thermal_dissipation_coldworkCoeff(instance) = config_phase(p)%getFloat('dissipation_coldworkcoeff')
|
|
|
|
NofMyPhase=count(material_phase==p)
|
|
|
|
sourceOffset = source_thermal_dissipation_offset(p)
|
2015-05-28 22:32:23 +05:30
|
|
|
|
2019-02-22 20:07:42 +05:30
|
|
|
call material_allocateSourceState(p,sourceOffset,NofMyPhase,0_pInt,0_pInt,0_pInt)
|
2015-05-28 22:32:23 +05:30
|
|
|
|
2019-02-22 20:07:42 +05:30
|
|
|
enddo
|
|
|
|
|
2015-05-28 22:32:23 +05:30
|
|
|
end subroutine source_thermal_dissipation_init
|
|
|
|
|
2019-02-22 20:07:42 +05:30
|
|
|
|
2015-05-28 22:32:23 +05:30
|
|
|
!--------------------------------------------------------------------------------------------------
|
|
|
|
!> @brief returns local vacancy generation rate
|
|
|
|
!--------------------------------------------------------------------------------------------------
|
2019-02-22 20:07:42 +05:30
|
|
|
subroutine source_thermal_dissipation_getRateAndItsTangent(TDot, dTDOT_dT, Tstar, Lp, phase)
|
2015-05-28 22:32:23 +05:30
|
|
|
use math, only: &
|
|
|
|
math_Mandel6to33
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
integer(pInt), intent(in) :: &
|
2019-02-22 20:07:42 +05:30
|
|
|
phase
|
|
|
|
real(pReal), intent(in), dimension(3,3) :: &
|
|
|
|
Tstar !< 2nd Piola Kirchhoff stress tensor (Mandel)
|
2015-05-28 22:32:23 +05:30
|
|
|
real(pReal), intent(in), dimension(3,3) :: &
|
|
|
|
Lp
|
|
|
|
real(pReal), intent(out) :: &
|
|
|
|
TDot, &
|
|
|
|
dTDOT_dT
|
|
|
|
integer(pInt) :: &
|
2018-12-31 01:28:38 +05:30
|
|
|
instance
|
2015-05-28 22:32:23 +05:30
|
|
|
|
|
|
|
instance = source_thermal_dissipation_instance(phase)
|
|
|
|
|
2019-02-22 20:07:42 +05:30
|
|
|
TDot = source_thermal_dissipation_coldworkCoeff(instance)*sum(abs(Tstar*Lp))
|
2015-05-28 22:32:23 +05:30
|
|
|
dTDOT_dT = 0.0_pReal
|
|
|
|
|
|
|
|
end subroutine source_thermal_dissipation_getRateAndItsTangent
|
|
|
|
|
|
|
|
end module source_thermal_dissipation
|