DAMASK_EICMD/src/source_thermal_dissipation.f90

101 lines
4.0 KiB
Fortran
Raw Normal View History

!--------------------------------------------------------------------------------------------------
!> @author Martin Diehl, Max-Planck-Institut für Eisenforschung GmbH
!> @author Pratheek Shanthraj, Max-Planck-Institut für Eisenforschung GmbH
!> @brief material subroutine for thermal source due to plastic dissipation
!> @details to be done
!--------------------------------------------------------------------------------------------------
submodule(constitutive:constitutive_thermal) source_thermal_dissipation
integer, dimension(:), allocatable :: &
source_thermal_dissipation_offset, & !< which source is my current thermal dissipation mechanism?
source_thermal_dissipation_instance !< instance of thermal dissipation source mechanism
2020-02-26 23:07:17 +05:30
type :: tParameters !< container type for internal constitutive parameters
real(pReal) :: &
2020-08-15 19:32:10 +05:30
kappa !< TAYLOR-QUINNEY factor
end type tParameters
2020-02-26 23:07:17 +05:30
type(tParameters), dimension(:), allocatable :: param !< containers of constitutive parameters (len Ninstance)
2020-02-26 23:07:17 +05:30
contains
!--------------------------------------------------------------------------------------------------
!> @brief module initialization
!> @details reads in material parameters, allocates arrays, and does sanity checks
!--------------------------------------------------------------------------------------------------
2020-08-15 19:32:10 +05:30
module function source_thermal_dissipation_init(source_length) result(mySources)
2020-02-26 23:07:17 +05:30
2020-08-15 19:32:10 +05:30
integer, intent(in) :: source_length
logical, dimension(:,:), allocatable :: mySources
class(tNode), pointer :: &
phases, &
phase, &
sources, &
src
2020-03-16 22:59:15 +05:30
integer :: Ninstance,sourceOffset,NipcMyPhase,p
2020-02-26 23:07:17 +05:30
2020-08-15 19:32:10 +05:30
write(6,'(/,a)') ' <<<+- source_thermal_dissipation init -+>>>'
2020-02-26 23:07:17 +05:30
2020-08-15 19:32:10 +05:30
mySources = source_active('thermal_dissipation',source_length)
Ninstance = count(mySources)
2020-07-02 00:16:26 +05:30
write(6,'(a16,1x,i5,/)') '# instances:',Ninstance; flush(6)
2020-08-15 19:32:10 +05:30
if(Ninstance == 0) return
2020-02-26 23:07:17 +05:30
2020-08-15 19:32:10 +05:30
phases => material_root%get('phase')
allocate(param(Ninstance))
2020-08-15 19:32:10 +05:30
allocate(source_thermal_dissipation_offset (phases%length), source=0)
allocate(source_thermal_dissipation_instance(phases%length), source=0)
do p = 1, phases%length
phase => phases%get(p)
if(count(mySources(:,p)) == 0) cycle
if(any(mySources(:,p))) source_thermal_dissipation_instance(p) = count(mySources(:,1:p))
sources => phase%get('source')
do sourceOffset = 1, sources%length
if(mySources(sourceOffset,p)) then
2020-02-29 12:33:06 +05:30
source_thermal_dissipation_offset(p) = sourceOffset
2020-08-15 19:32:10 +05:30
associate(prm => param(source_thermal_dissipation_instance(p)))
2020-02-29 12:28:33 +05:30
2020-08-15 19:32:10 +05:30
src => sources%get(sourceOffset)
prm%kappa = src%get_asFloat('kappa')
NipcMyPhase = count(material_phaseAt==p) * discretization_nIP
call constitutive_allocateState(sourceState(p)%p(sourceOffset),NipcMyPhase,0,0,0)
2020-02-26 23:07:17 +05:30
2020-08-15 19:32:10 +05:30
end associate
endif
enddo
enddo
2020-02-26 23:07:17 +05:30
2020-08-15 19:32:10 +05:30
end function source_thermal_dissipation_init
!--------------------------------------------------------------------------------------------------
2020-02-26 23:07:17 +05:30
!> @brief Ninstances dissipation rate
!--------------------------------------------------------------------------------------------------
module subroutine source_thermal_dissipation_getRateAndItsTangent(TDot, dTDot_dT, Tstar, Lp, phase)
integer, intent(in) :: &
phase
real(pReal), intent(in), dimension(3,3) :: &
Tstar
real(pReal), intent(in), dimension(3,3) :: &
Lp
2020-02-29 19:04:19 +05:30
real(pReal), intent(out) :: &
TDot, &
2020-02-28 14:55:07 +05:30
dTDot_dT
2020-02-26 23:07:17 +05:30
2020-02-29 12:28:33 +05:30
associate(prm => param(source_thermal_dissipation_instance(phase)))
TDot = prm%kappa*sum(abs(Tstar*Lp))
2020-02-28 14:55:07 +05:30
dTDot_dT = 0.0_pReal
2020-02-29 12:28:33 +05:30
end associate
2020-02-26 23:07:17 +05:30
end subroutine source_thermal_dissipation_getRateAndItsTangent
2020-02-26 23:07:17 +05:30
end submodule source_thermal_dissipation