consistent access pattern and naming
This commit is contained in:
parent
9292bc91ea
commit
69f6de0e4f
|
@ -225,13 +225,19 @@ module subroutine thermal_conduction_getSource(Tdot, ip,el)
|
||||||
real(pReal), intent(out) :: &
|
real(pReal), intent(out) :: &
|
||||||
Tdot
|
Tdot
|
||||||
|
|
||||||
integer :: &
|
integer :: co, ho,ph,me
|
||||||
homog
|
real(pReal) :: dot_T_temp
|
||||||
|
|
||||||
homog = material_homogenizationAt(el)
|
ho = material_homogenizationAt(el)
|
||||||
call constitutive_thermal_getRate(TDot, ip,el)
|
Tdot = 0.0_pReal
|
||||||
|
do co = 1, homogenization_Nconstituents(ho)
|
||||||
|
ph = material_phaseAt(co,el)
|
||||||
|
me = material_phasememberAt(co,ip,el)
|
||||||
|
call constitutive_thermal_getRate(dot_T_temp, ph,me)
|
||||||
|
Tdot = Tdot + dot_T_temp
|
||||||
|
enddo
|
||||||
|
|
||||||
Tdot = Tdot/real(homogenization_Nconstituents(homog),pReal)
|
Tdot = Tdot/real(homogenization_Nconstituents(ho),pReal)
|
||||||
|
|
||||||
end subroutine thermal_conduction_getSource
|
end subroutine thermal_conduction_getSource
|
||||||
|
|
||||||
|
|
|
@ -244,10 +244,8 @@ module phase
|
||||||
dPhiDot_dPhi
|
dPhiDot_dPhi
|
||||||
end subroutine constitutive_damage_getRateAndItsTangents
|
end subroutine constitutive_damage_getRateAndItsTangents
|
||||||
|
|
||||||
module subroutine constitutive_thermal_getRate(TDot, ip,el)
|
module subroutine constitutive_thermal_getRate(TDot, ph,me)
|
||||||
integer, intent(in) :: &
|
integer, intent(in) :: ph, me
|
||||||
ip, & !< integration point number
|
|
||||||
el !< element number
|
|
||||||
real(pReal), intent(out) :: &
|
real(pReal), intent(out) :: &
|
||||||
TDot
|
TDot
|
||||||
end subroutine constitutive_thermal_getRate
|
end subroutine constitutive_thermal_getRate
|
||||||
|
|
|
@ -44,13 +44,10 @@ submodule(phase) thermal
|
||||||
me
|
me
|
||||||
end subroutine externalheat_dotState
|
end subroutine externalheat_dotState
|
||||||
|
|
||||||
module subroutine thermal_dissipation_getRate(TDot, Tstar,Lp,phase)
|
module subroutine thermal_dissipation_getRate(TDot, ph,me)
|
||||||
integer, intent(in) :: &
|
integer, intent(in) :: &
|
||||||
phase !< phase ID of element
|
ph, &
|
||||||
real(pReal), intent(in), dimension(3,3) :: &
|
me
|
||||||
Tstar !< 2nd Piola Kirchhoff stress tensor for a given element
|
|
||||||
real(pReal), intent(in), dimension(3,3) :: &
|
|
||||||
Lp !< plastic velocuty gradient for a given element
|
|
||||||
real(pReal), intent(out) :: &
|
real(pReal), intent(out) :: &
|
||||||
TDot
|
TDot
|
||||||
end subroutine thermal_dissipation_getRate
|
end subroutine thermal_dissipation_getRate
|
||||||
|
@ -135,33 +132,24 @@ end subroutine thermal_init
|
||||||
!----------------------------------------------------------------------------------------------
|
!----------------------------------------------------------------------------------------------
|
||||||
!< @brief calculates thermal dissipation rate
|
!< @brief calculates thermal dissipation rate
|
||||||
!----------------------------------------------------------------------------------------------
|
!----------------------------------------------------------------------------------------------
|
||||||
module subroutine constitutive_thermal_getRate(TDot, ip, el)
|
module subroutine constitutive_thermal_getRate(TDot, ph,me)
|
||||||
|
|
||||||
integer, intent(in) :: &
|
integer, intent(in) :: ph, me
|
||||||
ip, & !< integration point number
|
|
||||||
el !< element number
|
|
||||||
real(pReal), intent(out) :: &
|
real(pReal), intent(out) :: &
|
||||||
TDot
|
TDot
|
||||||
|
|
||||||
real(pReal) :: &
|
real(pReal) :: &
|
||||||
my_Tdot
|
my_Tdot
|
||||||
integer :: &
|
integer :: &
|
||||||
ph, &
|
so
|
||||||
homog, &
|
|
||||||
me, &
|
|
||||||
so, &
|
|
||||||
co
|
|
||||||
|
|
||||||
homog = material_homogenizationAt(el)
|
|
||||||
|
|
||||||
TDot = 0.0_pReal
|
TDot = 0.0_pReal
|
||||||
do co = 1, homogenization_Nconstituents(homog)
|
|
||||||
ph = material_phaseAt(co,el)
|
|
||||||
me = material_phasememberAt(co,ip,el)
|
|
||||||
do so = 1, thermal_Nsources(ph)
|
do so = 1, thermal_Nsources(ph)
|
||||||
select case(thermal_source(so,ph))
|
select case(thermal_source(so,ph))
|
||||||
case (THERMAL_DISSIPATION_ID)
|
case (THERMAL_DISSIPATION_ID)
|
||||||
call thermal_dissipation_getRate(my_Tdot, mech_S(ph,me),mech_L_p(ph,me),ph)
|
call thermal_dissipation_getRate(my_Tdot, ph,me)
|
||||||
|
|
||||||
case (THERMAL_EXTERNALHEAT_ID)
|
case (THERMAL_EXTERNALHEAT_ID)
|
||||||
call thermal_externalheat_getRate(my_Tdot, ph,me)
|
call thermal_externalheat_getRate(my_Tdot, ph,me)
|
||||||
|
@ -171,7 +159,7 @@ module subroutine constitutive_thermal_getRate(TDot, ip, el)
|
||||||
end select
|
end select
|
||||||
Tdot = Tdot + my_Tdot
|
Tdot = Tdot + my_Tdot
|
||||||
enddo
|
enddo
|
||||||
enddo
|
|
||||||
|
|
||||||
end subroutine constitutive_thermal_getRate
|
end subroutine constitutive_thermal_getRate
|
||||||
|
|
||||||
|
|
|
@ -6,10 +6,6 @@
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
submodule(phase:thermal) dissipation
|
submodule(phase: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
|
|
||||||
|
|
||||||
type :: tParameters !< container type for internal constitutive parameters
|
type :: tParameters !< container type for internal constitutive parameters
|
||||||
real(pReal) :: &
|
real(pReal) :: &
|
||||||
kappa !< TAYLOR-QUINNEY factor
|
kappa !< TAYLOR-QUINNEY factor
|
||||||
|
@ -35,7 +31,7 @@ module function dissipation_init(source_length) result(mySources)
|
||||||
phase, &
|
phase, &
|
||||||
sources, thermal, &
|
sources, thermal, &
|
||||||
src
|
src
|
||||||
integer :: Ninstances,sourceOffset,Nconstituents,p
|
integer :: Ninstances,so,Nconstituents,ph
|
||||||
|
|
||||||
print'(/,a)', ' <<<+- thermal_dissipation init -+>>>'
|
print'(/,a)', ' <<<+- thermal_dissipation init -+>>>'
|
||||||
|
|
||||||
|
@ -46,25 +42,21 @@ module function dissipation_init(source_length) result(mySources)
|
||||||
if(Ninstances == 0) return
|
if(Ninstances == 0) return
|
||||||
|
|
||||||
phases => config_material%get('phase')
|
phases => config_material%get('phase')
|
||||||
allocate(param(Ninstances))
|
allocate(param(phases%length))
|
||||||
allocate(source_thermal_dissipation_offset (phases%length), source=0)
|
|
||||||
allocate(source_thermal_dissipation_instance(phases%length), source=0)
|
|
||||||
|
|
||||||
do p = 1, phases%length
|
do ph = 1, phases%length
|
||||||
phase => phases%get(p)
|
phase => phases%get(ph)
|
||||||
if(any(mySources(:,p))) source_thermal_dissipation_instance(p) = count(mySources(:,1:p))
|
if(count(mySources(:,ph)) == 0) cycle !ToDo: error if > 1
|
||||||
if(count(mySources(:,p)) == 0) cycle
|
|
||||||
thermal => phase%get('thermal')
|
thermal => phase%get('thermal')
|
||||||
sources => thermal%get('source')
|
sources => thermal%get('source')
|
||||||
do sourceOffset = 1, sources%length
|
do so = 1, sources%length
|
||||||
if(mySources(sourceOffset,p)) then
|
if(mySources(so,ph)) then
|
||||||
source_thermal_dissipation_offset(p) = sourceOffset
|
associate(prm => param(ph))
|
||||||
associate(prm => param(source_thermal_dissipation_instance(p)))
|
src => sources%get(so)
|
||||||
src => sources%get(sourceOffset)
|
|
||||||
|
|
||||||
prm%kappa = src%get_asFloat('kappa')
|
prm%kappa = src%get_asFloat('kappa')
|
||||||
Nconstituents = count(material_phaseAt==p) * discretization_nIPs
|
Nconstituents = count(material_phaseAt2 == ph)
|
||||||
call constitutive_allocateState(thermalState(p)%p(sourceOffset),Nconstituents,0,0,0)
|
call constitutive_allocateState(thermalState(ph)%p(so),Nconstituents,0,0,0)
|
||||||
|
|
||||||
end associate
|
end associate
|
||||||
endif
|
endif
|
||||||
|
@ -78,20 +70,15 @@ end function dissipation_init
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
!> @brief Ninstancess dissipation rate
|
!> @brief Ninstancess dissipation rate
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
module subroutine thermal_dissipation_getRate(TDot, Tstar, Lp, phase)
|
module subroutine thermal_dissipation_getRate(TDot, ph,me)
|
||||||
|
|
||||||
integer, intent(in) :: &
|
|
||||||
phase
|
|
||||||
real(pReal), intent(in), dimension(3,3) :: &
|
|
||||||
Tstar
|
|
||||||
real(pReal), intent(in), dimension(3,3) :: &
|
|
||||||
Lp
|
|
||||||
|
|
||||||
|
integer, intent(in) :: ph, me
|
||||||
real(pReal), intent(out) :: &
|
real(pReal), intent(out) :: &
|
||||||
TDot
|
TDot
|
||||||
|
|
||||||
associate(prm => param(source_thermal_dissipation_instance(phase)))
|
|
||||||
TDot = prm%kappa*sum(abs(Tstar*Lp))
|
associate(prm => param(ph))
|
||||||
|
TDot = prm%kappa*sum(abs(mech_S(ph,me)*mech_L_p(ph,me)))
|
||||||
end associate
|
end associate
|
||||||
|
|
||||||
end subroutine thermal_dissipation_getRate
|
end subroutine thermal_dissipation_getRate
|
||||||
|
|
|
@ -39,7 +39,7 @@ module function externalheat_init(source_length) result(mySources)
|
||||||
phase, &
|
phase, &
|
||||||
sources, thermal, &
|
sources, thermal, &
|
||||||
src
|
src
|
||||||
integer :: Ninstances,sourceOffset,Nconstituents,p
|
integer :: Ninstances,so,Nconstituents,p
|
||||||
|
|
||||||
print'(/,a)', ' <<<+- thermal_externalheat init -+>>>'
|
print'(/,a)', ' <<<+- thermal_externalheat init -+>>>'
|
||||||
|
|
||||||
|
@ -60,11 +60,11 @@ module function externalheat_init(source_length) result(mySources)
|
||||||
if(count(mySources(:,p)) == 0) cycle
|
if(count(mySources(:,p)) == 0) cycle
|
||||||
thermal => phase%get('thermal')
|
thermal => phase%get('thermal')
|
||||||
sources => thermal%get('source')
|
sources => thermal%get('source')
|
||||||
do sourceOffset = 1, sources%length
|
do so = 1, sources%length
|
||||||
if(mySources(sourceOffset,p)) then
|
if(mySources(so,p)) then
|
||||||
source_thermal_externalheat_offset(p) = sourceOffset
|
source_thermal_externalheat_offset(p) = so
|
||||||
associate(prm => param(source_thermal_externalheat_instance(p)))
|
associate(prm => param(source_thermal_externalheat_instance(p)))
|
||||||
src => sources%get(sourceOffset)
|
src => sources%get(so)
|
||||||
|
|
||||||
prm%t_n = src%get_asFloats('t_n')
|
prm%t_n = src%get_asFloats('t_n')
|
||||||
prm%nIntervals = size(prm%t_n) - 1
|
prm%nIntervals = size(prm%t_n) - 1
|
||||||
|
@ -72,7 +72,7 @@ module function externalheat_init(source_length) result(mySources)
|
||||||
prm%f_T = src%get_asFloats('f_T',requiredSize = size(prm%t_n))
|
prm%f_T = src%get_asFloats('f_T',requiredSize = size(prm%t_n))
|
||||||
|
|
||||||
Nconstituents = count(material_phaseAt==p) * discretization_nIPs
|
Nconstituents = count(material_phaseAt==p) * discretization_nIPs
|
||||||
call constitutive_allocateState(thermalState(p)%p(sourceOffset),Nconstituents,1,1,0)
|
call constitutive_allocateState(thermalState(p)%p(so),Nconstituents,1,1,0)
|
||||||
end associate
|
end associate
|
||||||
endif
|
endif
|
||||||
enddo
|
enddo
|
||||||
|
@ -92,11 +92,11 @@ module subroutine externalheat_dotState(ph, me)
|
||||||
me
|
me
|
||||||
|
|
||||||
integer :: &
|
integer :: &
|
||||||
sourceOffset
|
so
|
||||||
|
|
||||||
sourceOffset = source_thermal_externalheat_offset(ph)
|
so = source_thermal_externalheat_offset(ph)
|
||||||
|
|
||||||
thermalState(ph)%p(sourceOffset)%dotState(1,me) = 1.0_pReal ! state is current time
|
thermalState(ph)%p(so)%dotState(1,me) = 1.0_pReal ! state is current time
|
||||||
|
|
||||||
end subroutine externalheat_dotState
|
end subroutine externalheat_dotState
|
||||||
|
|
||||||
|
@ -113,15 +113,15 @@ module subroutine thermal_externalheat_getRate(TDot, ph, me)
|
||||||
TDot
|
TDot
|
||||||
|
|
||||||
integer :: &
|
integer :: &
|
||||||
sourceOffset, interval
|
so, interval
|
||||||
real(pReal) :: &
|
real(pReal) :: &
|
||||||
frac_time
|
frac_time
|
||||||
|
|
||||||
sourceOffset = source_thermal_externalheat_offset(ph)
|
so = source_thermal_externalheat_offset(ph)
|
||||||
|
|
||||||
associate(prm => param(source_thermal_externalheat_instance(ph)))
|
associate(prm => param(source_thermal_externalheat_instance(ph)))
|
||||||
do interval = 1, prm%nIntervals ! scan through all rate segments
|
do interval = 1, prm%nIntervals ! scan through all rate segments
|
||||||
frac_time = (thermalState(ph)%p(sourceOffset)%state(1,me) - prm%t_n(interval)) &
|
frac_time = (thermalState(ph)%p(so)%state(1,me) - prm%t_n(interval)) &
|
||||||
/ (prm%t_n(interval+1) - prm%t_n(interval)) ! fractional time within segment
|
/ (prm%t_n(interval+1) - prm%t_n(interval)) ! fractional time within segment
|
||||||
if ( (frac_time < 0.0_pReal .and. interval == 1) &
|
if ( (frac_time < 0.0_pReal .and. interval == 1) &
|
||||||
.or. (frac_time >= 1.0_pReal .and. interval == prm%nIntervals) &
|
.or. (frac_time >= 1.0_pReal .and. interval == prm%nIntervals) &
|
||||||
|
|
Loading…
Reference in New Issue