parent
293f869fe5
commit
19af34e054
|
@ -1,22 +1,20 @@
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
!> @author Pratheek Shanthraj, Max-Planck-Institut für Eisenforschung GmbH
|
!> @author Pratheek Shanthraj, Max-Planck-Institut für Eisenforschung GmbH
|
||||||
!> @brief material subroutine for temperature evolution from heat conduction
|
!> @brief material subroutine for temperature evolution from heat conduction
|
||||||
!> @details to be done
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
module thermal_conduction
|
module thermal_conduction
|
||||||
use prec, only: &
|
use prec, only: &
|
||||||
pReal, &
|
pReal
|
||||||
pInt
|
|
||||||
|
|
||||||
implicit none
|
implicit none
|
||||||
private
|
private
|
||||||
|
|
||||||
integer(pInt), dimension(:,:), allocatable, target, public :: &
|
integer, dimension(:,:), allocatable, target, public :: &
|
||||||
thermal_conduction_sizePostResult !< size of each post result output
|
thermal_conduction_sizePostResult !< size of each post result output
|
||||||
character(len=64), dimension(:,:), allocatable, target, public :: &
|
character(len=64), dimension(:,:), allocatable, target, public :: &
|
||||||
thermal_conduction_output !< name of each post result output
|
thermal_conduction_output !< name of each post result output
|
||||||
|
|
||||||
integer(pInt), dimension(:), allocatable, target, public :: &
|
integer, dimension(:), allocatable, target, public :: &
|
||||||
thermal_conduction_Noutput !< number of outputs per instance of this damage
|
thermal_conduction_Noutput !< number of outputs per instance of this damage
|
||||||
|
|
||||||
enum, bind(c)
|
enum, bind(c)
|
||||||
|
@ -61,42 +59,42 @@ subroutine thermal_conduction_init
|
||||||
config_homogenization
|
config_homogenization
|
||||||
|
|
||||||
implicit none
|
implicit none
|
||||||
integer(pInt) :: maxNinstance,section,instance,i
|
integer :: maxNinstance,section,instance,i
|
||||||
integer(pInt) :: sizeState
|
integer :: sizeState
|
||||||
integer(pInt) :: NofMyHomog
|
integer :: NofMyHomog
|
||||||
character(len=65536), dimension(0), parameter :: emptyStringArray = [character(len=65536)::]
|
character(len=65536), dimension(0), parameter :: emptyStringArray = [character(len=65536)::]
|
||||||
character(len=65536), dimension(:), allocatable :: outputs
|
character(len=65536), dimension(:), allocatable :: outputs
|
||||||
|
|
||||||
write(6,'(/,a)') ' <<<+- thermal_'//THERMAL_CONDUCTION_label//' init -+>>>'
|
write(6,'(/,a)') ' <<<+- thermal_'//THERMAL_CONDUCTION_label//' init -+>>>'
|
||||||
|
|
||||||
maxNinstance = count(thermal_type == THERMAL_conduction_ID)
|
maxNinstance = count(thermal_type == THERMAL_conduction_ID)
|
||||||
if (maxNinstance == 0_pInt) return
|
if (maxNinstance == 0) return
|
||||||
|
|
||||||
allocate(thermal_conduction_sizePostResult (maxval(homogenization_Noutput),maxNinstance),source=0_pInt)
|
allocate(thermal_conduction_sizePostResult (maxval(homogenization_Noutput),maxNinstance),source=0)
|
||||||
allocate(thermal_conduction_output (maxval(homogenization_Noutput),maxNinstance))
|
allocate(thermal_conduction_output (maxval(homogenization_Noutput),maxNinstance))
|
||||||
thermal_conduction_output = ''
|
thermal_conduction_output = ''
|
||||||
allocate(thermal_conduction_outputID (maxval(homogenization_Noutput),maxNinstance),source=undefined_ID)
|
allocate(thermal_conduction_outputID (maxval(homogenization_Noutput),maxNinstance),source=undefined_ID)
|
||||||
allocate(thermal_conduction_Noutput (maxNinstance), source=0_pInt)
|
allocate(thermal_conduction_Noutput (maxNinstance), source=0)
|
||||||
|
|
||||||
|
|
||||||
initializeInstances: do section = 1_pInt, size(thermal_type)
|
initializeInstances: do section = 1, size(thermal_type)
|
||||||
if (thermal_type(section) /= THERMAL_conduction_ID) cycle
|
if (thermal_type(section) /= THERMAL_conduction_ID) cycle
|
||||||
NofMyHomog=count(material_homogenizationAt==section)
|
NofMyHomog=count(material_homogenizationAt==section)
|
||||||
instance = thermal_typeInstance(section)
|
instance = thermal_typeInstance(section)
|
||||||
outputs = config_homogenization(section)%getStrings('(output)',defaultVal=emptyStringArray)
|
outputs = config_homogenization(section)%getStrings('(output)',defaultVal=emptyStringArray)
|
||||||
do i=1_pInt, size(outputs)
|
do i=1, size(outputs)
|
||||||
select case(outputs(i))
|
select case(outputs(i))
|
||||||
case('temperature')
|
case('temperature')
|
||||||
thermal_conduction_Noutput(instance) = thermal_conduction_Noutput(instance) + 1_pInt
|
thermal_conduction_Noutput(instance) = thermal_conduction_Noutput(instance) + 1
|
||||||
thermal_conduction_outputID(thermal_conduction_Noutput(instance),instance) = temperature_ID
|
thermal_conduction_outputID(thermal_conduction_Noutput(instance),instance) = temperature_ID
|
||||||
thermal_conduction_output(thermal_conduction_Noutput(instance),instance) = outputs(i)
|
thermal_conduction_output(thermal_conduction_Noutput(instance),instance) = outputs(i)
|
||||||
thermal_conduction_sizePostResult(thermal_conduction_Noutput(instance),instance) = 1_pInt
|
thermal_conduction_sizePostResult(thermal_conduction_Noutput(instance),instance) = 1
|
||||||
end select
|
end select
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
|
|
||||||
! allocate state arrays
|
! allocate state arrays
|
||||||
sizeState = 0_pInt
|
sizeState = 0
|
||||||
thermalState(section)%sizeState = sizeState
|
thermalState(section)%sizeState = sizeState
|
||||||
thermalState(section)%sizePostResults = sum(thermal_conduction_sizePostResult(:,instance))
|
thermalState(section)%sizePostResults = sum(thermal_conduction_sizePostResult(:,instance))
|
||||||
allocate(thermalState(section)%state0 (sizeState,NofMyHomog))
|
allocate(thermalState(section)%state0 (sizeState,NofMyHomog))
|
||||||
|
@ -138,7 +136,7 @@ subroutine thermal_conduction_getSourceAndItsTangent(Tdot, dTdot_dT, T, ip, el)
|
||||||
crystallite_Lp
|
crystallite_Lp
|
||||||
|
|
||||||
implicit none
|
implicit none
|
||||||
integer(pInt), intent(in) :: &
|
integer, intent(in) :: &
|
||||||
ip, & !< integration point number
|
ip, & !< integration point number
|
||||||
el !< element number
|
el !< element number
|
||||||
real(pReal), intent(in) :: &
|
real(pReal), intent(in) :: &
|
||||||
|
@ -147,7 +145,7 @@ subroutine thermal_conduction_getSourceAndItsTangent(Tdot, dTdot_dT, T, ip, el)
|
||||||
Tdot, dTdot_dT
|
Tdot, dTdot_dT
|
||||||
real(pReal) :: &
|
real(pReal) :: &
|
||||||
my_Tdot, my_dTdot_dT
|
my_Tdot, my_dTdot_dT
|
||||||
integer(pInt) :: &
|
integer :: &
|
||||||
phase, &
|
phase, &
|
||||||
homog, &
|
homog, &
|
||||||
offset, &
|
offset, &
|
||||||
|
@ -208,12 +206,12 @@ function thermal_conduction_getConductivity33(ip,el)
|
||||||
crystallite_push33ToRef
|
crystallite_push33ToRef
|
||||||
|
|
||||||
implicit none
|
implicit none
|
||||||
integer(pInt), intent(in) :: &
|
integer, intent(in) :: &
|
||||||
ip, & !< integration point number
|
ip, & !< integration point number
|
||||||
el !< element number
|
el !< element number
|
||||||
real(pReal), dimension(3,3) :: &
|
real(pReal), dimension(3,3) :: &
|
||||||
thermal_conduction_getConductivity33
|
thermal_conduction_getConductivity33
|
||||||
integer(pInt) :: &
|
integer :: &
|
||||||
grain
|
grain
|
||||||
|
|
||||||
|
|
||||||
|
@ -242,12 +240,12 @@ function thermal_conduction_getSpecificHeat(ip,el)
|
||||||
mesh_element
|
mesh_element
|
||||||
|
|
||||||
implicit none
|
implicit none
|
||||||
integer(pInt), intent(in) :: &
|
integer, intent(in) :: &
|
||||||
ip, & !< integration point number
|
ip, & !< integration point number
|
||||||
el !< element number
|
el !< element number
|
||||||
real(pReal) :: &
|
real(pReal) :: &
|
||||||
thermal_conduction_getSpecificHeat
|
thermal_conduction_getSpecificHeat
|
||||||
integer(pInt) :: &
|
integer :: &
|
||||||
grain
|
grain
|
||||||
|
|
||||||
thermal_conduction_getSpecificHeat = 0.0_pReal
|
thermal_conduction_getSpecificHeat = 0.0_pReal
|
||||||
|
@ -276,12 +274,12 @@ function thermal_conduction_getMassDensity(ip,el)
|
||||||
mesh_element
|
mesh_element
|
||||||
|
|
||||||
implicit none
|
implicit none
|
||||||
integer(pInt), intent(in) :: &
|
integer, intent(in) :: &
|
||||||
ip, & !< integration point number
|
ip, & !< integration point number
|
||||||
el !< element number
|
el !< element number
|
||||||
real(pReal) :: &
|
real(pReal) :: &
|
||||||
thermal_conduction_getMassDensity
|
thermal_conduction_getMassDensity
|
||||||
integer(pInt) :: &
|
integer :: &
|
||||||
grain
|
grain
|
||||||
|
|
||||||
thermal_conduction_getMassDensity = 0.0_pReal
|
thermal_conduction_getMassDensity = 0.0_pReal
|
||||||
|
@ -309,13 +307,13 @@ subroutine thermal_conduction_putTemperatureAndItsRate(T,Tdot,ip,el)
|
||||||
thermalMapping
|
thermalMapping
|
||||||
|
|
||||||
implicit none
|
implicit none
|
||||||
integer(pInt), intent(in) :: &
|
integer, intent(in) :: &
|
||||||
ip, & !< integration point number
|
ip, & !< integration point number
|
||||||
el !< element number
|
el !< element number
|
||||||
real(pReal), intent(in) :: &
|
real(pReal), intent(in) :: &
|
||||||
T, &
|
T, &
|
||||||
Tdot
|
Tdot
|
||||||
integer(pInt) :: &
|
integer :: &
|
||||||
homog, &
|
homog, &
|
||||||
offset
|
offset
|
||||||
|
|
||||||
|
@ -335,7 +333,7 @@ function thermal_conduction_postResults(homog,instance,of) result(postResults)
|
||||||
temperature
|
temperature
|
||||||
|
|
||||||
implicit none
|
implicit none
|
||||||
integer(pInt), intent(in) :: &
|
integer, intent(in) :: &
|
||||||
homog, &
|
homog, &
|
||||||
instance, &
|
instance, &
|
||||||
of
|
of
|
||||||
|
@ -343,16 +341,15 @@ function thermal_conduction_postResults(homog,instance,of) result(postResults)
|
||||||
real(pReal), dimension(sum(thermal_conduction_sizePostResult(:,instance))) :: &
|
real(pReal), dimension(sum(thermal_conduction_sizePostResult(:,instance))) :: &
|
||||||
postResults
|
postResults
|
||||||
|
|
||||||
integer(pInt) :: &
|
integer :: &
|
||||||
o, c
|
o, c
|
||||||
|
|
||||||
c = 0_pInt
|
c = 0
|
||||||
|
do o = 1,thermal_conduction_Noutput(instance)
|
||||||
do o = 1_pInt,thermal_conduction_Noutput(instance)
|
|
||||||
select case(thermal_conduction_outputID(o,instance))
|
select case(thermal_conduction_outputID(o,instance))
|
||||||
|
|
||||||
case (temperature_ID)
|
case (temperature_ID)
|
||||||
postResults(c+1_pInt) = temperature(homog)%p(of)
|
postResults(c+1) = temperature(homog)%p(of)
|
||||||
c = c + 1
|
c = c + 1
|
||||||
end select
|
end select
|
||||||
enddo
|
enddo
|
||||||
|
|
Loading…
Reference in New Issue