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