preparing for non-global variables

This commit is contained in:
Martin Diehl 2020-12-29 07:20:37 +01:00
parent 1b85dbea80
commit 7992ef474e
3 changed files with 31 additions and 13 deletions

View File

@ -235,15 +235,12 @@ module constitutive
dPhiDot_dPhi dPhiDot_dPhi
end subroutine constitutive_damage_getRateAndItsTangents end subroutine constitutive_damage_getRateAndItsTangents
module subroutine constitutive_thermal_getRateAndItsTangents(TDot, dTDot_dT, T, S, Lp, ip, el) module subroutine constitutive_thermal_getRateAndItsTangents(TDot, dTDot_dT, T, ip, el)
integer, 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
real(pReal), intent(in), dimension(:,:,:,:,:) :: &
S, & !< current 2nd Piola Kitchoff stress vector
Lp !< plastic velocity gradient
real(pReal), intent(inout) :: & real(pReal), intent(inout) :: &
TDot, & TDot, &
dTDot_dT dTDot_dT
@ -392,6 +389,8 @@ module constitutive
crystallite_push33ToRef, & crystallite_push33ToRef, &
crystallite_restartWrite, & crystallite_restartWrite, &
integrateSourceState, & integrateSourceState, &
constitutive_mech_getLp, &
constitutive_mech_getS, &
crystallite_restartRead, & crystallite_restartRead, &
constitutive_initializeRestorationPoints, & constitutive_initializeRestorationPoints, &
constitutive_windForward, & constitutive_windForward, &
@ -1427,4 +1426,24 @@ subroutine crystallite_restartRead
end subroutine crystallite_restartRead end subroutine crystallite_restartRead
! getter for non-mech (e.g. thermal)
function constitutive_mech_getS(co,ip,el) result(S)
integer, intent(in) :: co, ip, el
real(pReal), dimension(3,3) :: S
S = crystallite_S(1:3,1:3,co,ip,el)
end function constitutive_mech_getS
! getter for non-mech (e.g. thermal)
function constitutive_mech_getLp(co,ip,el) result(Lp)
integer, intent(in) :: co, ip, el
real(pReal), dimension(3,3) :: Lp
Lp = crystallite_S(1:3,1:3,co,ip,el)
end function constitutive_mech_getLp
end module constitutive end module constitutive

View File

@ -68,15 +68,13 @@ end subroutine thermal_init
!---------------------------------------------------------------------------------------------- !----------------------------------------------------------------------------------------------
!< @brief calculates thermal dissipation rate !< @brief calculates thermal dissipation rate
!---------------------------------------------------------------------------------------------- !----------------------------------------------------------------------------------------------
module subroutine constitutive_thermal_getRateAndItsTangents(TDot, dTDot_dT, T, S, Lp, ip, el) module subroutine constitutive_thermal_getRateAndItsTangents(TDot, dTDot_dT, T, ip, el)
integer, 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 !< plastic velocity gradient
real(pReal), intent(in), dimension(:,:,:,:,:) :: &
S, & !< current 2nd Piola Kirchhoff stress
Lp !< plastic velocity gradient
real(pReal), intent(inout) :: & real(pReal), intent(inout) :: &
TDot, & TDot, &
dTDot_dT dTDot_dT
@ -84,6 +82,7 @@ module subroutine constitutive_thermal_getRateAndItsTangents(TDot, dTDot_dT, T,
real(pReal) :: & real(pReal) :: &
my_Tdot, & my_Tdot, &
my_dTdot_dT my_dTdot_dT
real(pReal), dimension(3,3) :: Lp, S
integer :: & integer :: &
phase, & phase, &
homog, & homog, &
@ -101,10 +100,10 @@ module subroutine constitutive_thermal_getRateAndItsTangents(TDot, dTDot_dT, T,
do source = 1, phase_Nsources(phase) do source = 1, phase_Nsources(phase)
select case(phase_source(source,phase)) select case(phase_source(source,phase))
case (SOURCE_thermal_dissipation_ID) case (SOURCE_thermal_dissipation_ID)
Lp = constitutive_mech_getLp(grain,ip,el)
S = constitutive_mech_getS(grain,ip,el)
call source_thermal_dissipation_getRateAndItsTangent(my_Tdot, my_dTdot_dT, & call source_thermal_dissipation_getRateAndItsTangent(my_Tdot, my_dTdot_dT, &
S(1:3,1:3,grain,ip,el), & S, Lp, phase)
Lp(1:3,1:3,grain,ip,el), &
phase)
case (SOURCE_thermal_externalheat_ID) case (SOURCE_thermal_externalheat_ID)
call source_thermal_externalheat_getRateAndItsTangent(my_Tdot, my_dTdot_dT, & call source_thermal_externalheat_getRateAndItsTangent(my_Tdot, my_dTdot_dT, &

View File

@ -94,7 +94,7 @@ subroutine thermal_conduction_getSourceAndItsTangent(Tdot, dTdot_dT, T, ip, el)
dTdot_dT = 0.0_pReal dTdot_dT = 0.0_pReal
homog = material_homogenizationAt(el) homog = material_homogenizationAt(el)
call constitutive_thermal_getRateAndItsTangents(TDot, dTDot_dT, T, crystallite_S,crystallite_Lp ,ip, el) call constitutive_thermal_getRateAndItsTangents(TDot, dTDot_dT, T, ip, el)
Tdot = Tdot/real(homogenization_Nconstituents(homog),pReal) Tdot = Tdot/real(homogenization_Nconstituents(homog),pReal)
dTdot_dT = dTdot_dT/real(homogenization_Nconstituents(homog),pReal) dTdot_dT = dTdot_dT/real(homogenization_Nconstituents(homog),pReal)