changed naming scheme for helper functions. damage and thermal dependent stress calculation more modularised

This commit is contained in:
Pratheek Shanthraj 2014-08-08 14:02:20 +00:00
parent da5f3d8f85
commit 10d2cfebd3
8 changed files with 59 additions and 90 deletions

View File

@ -403,9 +403,7 @@ homogenization_none.o: homogenization_none.f90 \
crystallite.o crystallite.o
crystallite.o: crystallite.f90 \ crystallite.o: crystallite.f90 \
constitutive.o \ constitutive.o
constitutive_thermal.o \
constitutive_damage.o
constitutive.o: constitutive.f90 \ constitutive.o: constitutive.f90 \
constitutive_nonlocal.o \ constitutive_nonlocal.o \
@ -414,7 +412,9 @@ constitutive.o: constitutive.f90 \
constitutive_dislokmc.o \ constitutive_dislokmc.o \
constitutive_phenopowerlaw.o \ constitutive_phenopowerlaw.o \
constitutive_j2.o \ constitutive_j2.o \
constitutive_none.o constitutive_none.o \
constitutive_thermal.o \
constitutive_damage.o
constitutive_nonlocal.o: constitutive_nonlocal.f90 \ constitutive_nonlocal.o: constitutive_nonlocal.f90 \
lattice.o lattice.o

View File

@ -362,6 +362,8 @@ subroutine constitutive_LpAndItsTangent(Lp, dLp_dTstar, Tstar_v, temperature, ip
PLASTICITY_DISLOKMC_ID, & PLASTICITY_DISLOKMC_ID, &
PLASTICITY_TITANMOD_ID, & PLASTICITY_TITANMOD_ID, &
PLASTICITY_NONLOCAL_ID PLASTICITY_NONLOCAL_ID
use constitutive_damage, only: &
constitutive_damageValue
use constitutive_j2, only: & use constitutive_j2, only: &
constitutive_j2_LpAndItsTangent constitutive_j2_LpAndItsTangent
use constitutive_phenopowerlaw, only: & use constitutive_phenopowerlaw, only: &
@ -455,18 +457,14 @@ subroutine constitutive_hooke_TandItsTangent(T, dT_dFe, Fe, ipc, ip, el)
math_transpose33, & math_transpose33, &
MATH_I3 MATH_I3
use material, only: & use material, only: &
mappingConstitutive, & mappingConstitutive
damageState, &
phase_damage, &
DAMAGE_local_ID, &
DAMAGE_gradient_ID, &
thermalState, &
phase_thermal, &
THERMAL_conduction_ID, &
THERMAL_adiabatic_ID
use lattice, only: & use lattice, only: &
lattice_referenceTemperature, & lattice_referenceTemperature, &
lattice_thermalExpansion33 lattice_thermalExpansion33
use constitutive_damage, only: &
constitutive_damageValue
use constitutive_thermal, only: &
constitutive_temperature
implicit none implicit none
integer(pInt), intent(in) :: & integer(pInt), intent(in) :: &
@ -483,45 +481,19 @@ subroutine constitutive_hooke_TandItsTangent(T, dT_dFe, Fe, ipc, ip, el)
integer(pInt) :: i, j, k, l integer(pInt) :: i, j, k, l
real(pReal), dimension(3,3) :: FeT real(pReal), dimension(3,3) :: FeT
real(pReal), dimension(3,3,3,3) :: C real(pReal), dimension(3,3,3,3) :: C
real(pReal) :: damage
integer(pInt) :: phase, constituent
C = constitutive_damageValue(ipc,ip,el)*&
C = math_Mandel66to3333(constitutive_homogenizedC(ipc,ip,el)) math_Mandel66to3333(constitutive_homogenizedC(ipc,ip,el))
FeT = math_transpose33(Fe) FeT = math_transpose33(Fe)
T = 0.5_pReal*math_mul3333xx33(C,math_mul33x33(FeT,Fe)-MATH_I3) T = math_mul3333xx33(C,0.5_pReal*(math_mul33x33(FeT,Fe)-MATH_I3) - &
lattice_thermalExpansion33(1:3,1:3,mappingConstitutive(2,ipc,ip,el))* &
(constitutive_temperature(ipc,ip,el) - &
lattice_referenceTemperature(mappingConstitutive(2,ipc,ip,el))))
dT_dFe = 0.0_pReal dT_dFe = 0.0_pReal
forall (i=1_pInt:3_pInt, j=1_pInt:3_pInt, k=1_pInt:3_pInt, l=1_pInt:3_pInt) & forall (i=1_pInt:3_pInt, j=1_pInt:3_pInt, k=1_pInt:3_pInt, l=1_pInt:3_pInt) &
dT_dFe(i,j,k,l) = math_mul3x3(C(i,j,l,1:3),Fe(k,1:3)) ! dT*_ij/dFe_kl dT_dFe(i,j,k,l) = math_mul3x3(C(i,j,l,1:3),Fe(k,1:3)) ! dT*_ij/dFe_kl
phase = mappingConstitutive(2,ipc,ip,el)
constituent = mappingConstitutive(1,ipc,ip,el)
select case (phase_damage(phase))
case (DAMAGE_local_ID)
damage = damageState(phase)%state(2,constituent)* &
damageState(phase)%state(2,constituent)
T = damage*T
dT_dFe = damage*dT_dFe
case (DAMAGE_gradient_ID)
damage = damageState(phase)%state(3,constituent)* &
damageState(phase)%state(3,constituent)
T = damage*T
dT_dFe = damage*dT_dFe
end select
select case (phase_thermal(phase))
case (THERMAL_conduction_ID)
T = T - math_mul3333xx33(C, (thermalState(phase)%state(2,constituent) - &
lattice_referenceTemperature(phase)) &
* lattice_thermalExpansion33(1:3,1:3,phase))
case (THERMAL_adiabatic_ID)
T = T - math_mul3333xx33(C, (thermalState(phase)%state(1,constituent) - &
lattice_referenceTemperature(phase)) &
* lattice_thermalExpansion33(1:3,1:3,phase))
end select
end subroutine constitutive_hooke_TandItsTangent end subroutine constitutive_hooke_TandItsTangent

View File

@ -20,7 +20,7 @@ module constitutive_damage
constitutive_damage_init, & constitutive_damage_init, &
constitutive_damage_microstructure, & constitutive_damage_microstructure, &
constitutive_damage_collectDotState, & constitutive_damage_collectDotState, &
constitutive_damage_getDamage, & constitutive_damageValue, &
constitutive_damage_postResults constitutive_damage_postResults
contains contains
@ -206,7 +206,7 @@ end subroutine constitutive_damage_collectDotState
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief returns temperature based on each damage model state layout !> @brief returns temperature based on each damage model state layout
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
function constitutive_damage_getDamage(ipc, ip, el) function constitutive_damageValue(ipc, ip, el)
use material, only: & use material, only: &
material_phase, & material_phase, &
phase_damage, & phase_damage, &
@ -214,30 +214,30 @@ function constitutive_damage_getDamage(ipc, ip, el)
DAMAGE_local_ID, & DAMAGE_local_ID, &
DAMAGE_gradient_ID DAMAGE_gradient_ID
use damage_local, only: & use damage_local, only: &
damage_local_getDamage damage_local_damageValue
use damage_gradient, only: & use damage_gradient, only: &
damage_gradient_getDamage damage_gradient_damageValue
implicit none implicit none
integer(pInt), intent(in) :: & integer(pInt), intent(in) :: &
ipc, & !< grain number ipc, & !< grain number
ip, & !< integration point number ip, & !< integration point number
el !< element number el !< element number
real(pReal) :: constitutive_damage_getDamage real(pReal) :: constitutive_damageValue
select case (phase_damage(material_phase(ipc,ip,el))) select case (phase_damage(material_phase(ipc,ip,el)))
case (DAMAGE_none_ID) case (DAMAGE_none_ID)
constitutive_damage_getDamage = 1.0_pReal constitutive_damageValue = 1.0_pReal
case (DAMAGE_local_ID) case (DAMAGE_local_ID)
constitutive_damage_getDamage = damage_local_getDamage(ipc, ip, el) constitutive_damageValue = damage_local_damageValue(ipc, ip, el)
case (DAMAGE_gradient_ID) case (DAMAGE_gradient_ID)
constitutive_damage_getDamage = damage_gradient_getDamage(ipc, ip, el) constitutive_damageValue = damage_gradient_damageValue(ipc, ip, el)
end select end select
end function constitutive_damage_getDamage end function constitutive_damageValue
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief returns array of constitutive results !> @brief returns array of constitutive results

View File

@ -19,7 +19,7 @@ module constitutive_thermal
constitutive_thermal_init, & constitutive_thermal_init, &
constitutive_thermal_microstructure, & constitutive_thermal_microstructure, &
constitutive_thermal_collectDotState, & constitutive_thermal_collectDotState, &
constitutive_thermal_getTemperature, & constitutive_temperature, &
constitutive_thermal_postResults constitutive_thermal_postResults
contains contains
@ -189,7 +189,7 @@ end subroutine constitutive_thermal_collectDotState
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief returns temperature based on each thermal model state layout !> @brief returns temperature based on each thermal model state layout
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
function constitutive_thermal_getTemperature(ipc, ip, el) function constitutive_temperature(ipc, ip, el)
use material, only: & use material, only: &
material_phase, & material_phase, &
phase_thermal, & phase_thermal, &
@ -199,30 +199,30 @@ function constitutive_thermal_getTemperature(ipc, ip, el)
use lattice, only: & use lattice, only: &
lattice_referenceTemperature lattice_referenceTemperature
use thermal_conduction, only: & use thermal_conduction, only: &
thermal_conduction_getTemperature thermal_conduction_temperature
! use thermal_adiabatic, only: & ! use thermal_adiabatic, only: &
! thermal_adiabatic_getTemperature ! thermal_adiabatic_temperature
implicit none implicit none
integer(pInt), intent(in) :: & integer(pInt), intent(in) :: &
ipc, & !< grain number ipc, & !< grain number
ip, & !< integration point number ip, & !< integration point number
el !< element number el !< element number
real(pReal) :: constitutive_thermal_getTemperature real(pReal) :: constitutive_temperature
select case (phase_thermal(material_phase(ipc,ip,el))) select case (phase_thermal(material_phase(ipc,ip,el)))
case (THERMAL_none_ID) case (THERMAL_none_ID)
constitutive_thermal_getTemperature = lattice_referenceTemperature(material_phase(ipc,ip,el)) constitutive_temperature = lattice_referenceTemperature(material_phase(ipc,ip,el))
case (THERMAL_adiabatic_ID) case (THERMAL_adiabatic_ID)
!constitutive_thermal_getTemperature = thermal_adiabatic_getTemperature(ipc, ip, el) !constitutive_temperature = thermal_adiabatic_temperature(ipc, ip, el)
case (THERMAL_conduction_ID) case (THERMAL_conduction_ID)
constitutive_thermal_getTemperature = thermal_conduction_getTemperature(ipc, ip, el) constitutive_temperature = thermal_conduction_temperature(ipc, ip, el)
end select end select
end function constitutive_thermal_getTemperature end function constitutive_temperature
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief returns array of constitutive results !> @brief returns array of constitutive results

View File

@ -44,7 +44,7 @@ module damage_gradient
damage_gradient_aTolState, & damage_gradient_aTolState, &
damage_gradient_microstructure, & damage_gradient_microstructure, &
damage_gradient_dotState, & damage_gradient_dotState, &
damage_gradient_getDamage, & damage_gradient_damageValue, &
damage_gradient_postResults damage_gradient_postResults
contains contains
@ -287,7 +287,7 @@ subroutine damage_gradient_microstructure(Tstar_v, Fe, ipc, ip, el)
integer(pInt) :: & integer(pInt) :: &
phase, constituent phase, constituent
real(pReal) :: & real(pReal) :: &
strainEnergy, strain(3,3), phi strainEnergy, strain(3,3)
phase = mappingConstitutive(2,ipc,ip,el) phase = mappingConstitutive(2,ipc,ip,el)
constituent = mappingConstitutive(1,ipc,ip,el) constituent = mappingConstitutive(1,ipc,ip,el)
@ -308,7 +308,6 @@ end subroutine damage_gradient_microstructure
subroutine damage_gradient_dotState(Tstar_v, Lp, ipc, ip, el) subroutine damage_gradient_dotState(Tstar_v, Lp, ipc, ip, el)
use material, only: & use material, only: &
mappingConstitutive, & mappingConstitutive, &
phase_damageInstance, &
damageState damageState
use math, only: & use math, only: &
math_Mandel6to33, & math_Mandel6to33, &
@ -330,7 +329,6 @@ subroutine damage_gradient_dotState(Tstar_v, Lp, ipc, ip, el)
phase = mappingConstitutive(2,ipc,ip,el) phase = mappingConstitutive(2,ipc,ip,el)
constituent = mappingConstitutive(1,ipc,ip,el) constituent = mappingConstitutive(1,ipc,ip,el)
instance = phase_damageInstance(phase)
damageState(phase)%dotState(1,constituent) = & damageState(phase)%dotState(1,constituent) = &
sum(abs(math_Mandel6to33(Tstar_v)*Lp))/ & sum(abs(math_Mandel6to33(Tstar_v)*Lp))/ &
@ -341,7 +339,7 @@ end subroutine damage_gradient_dotState
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief returns temperature based on gradient damage model state layout !> @brief returns temperature based on gradient damage model state layout
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
function damage_gradient_getDamage(ipc, ip, el) function damage_gradient_damageValue(ipc, ip, el)
use material, only: & use material, only: &
mappingConstitutive, & mappingConstitutive, &
damageState damageState
@ -351,13 +349,13 @@ function damage_gradient_getDamage(ipc, ip, el)
ipc, & !< grain number ipc, & !< grain number
ip, & !< integration point number ip, & !< integration point number
el !< element number el !< element number
real(pReal) :: damage_gradient_getDamage real(pReal) :: damage_gradient_damageValue
damage_gradient_getDamage = & damage_gradient_damageValue = &
damageState(mappingConstitutive(2,ipc,ip,el))%state(3,mappingConstitutive(1,ipc,ip,el))* & damageState(mappingConstitutive(2,ipc,ip,el))%state(3,mappingConstitutive(1,ipc,ip,el))* &
damageState(mappingConstitutive(2,ipc,ip,el))%state(3,mappingConstitutive(1,ipc,ip,el)) damageState(mappingConstitutive(2,ipc,ip,el))%state(3,mappingConstitutive(1,ipc,ip,el))
end function damage_gradient_getDamage end function damage_gradient_damageValue
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief return array of constitutive results !> @brief return array of constitutive results

View File

@ -42,7 +42,7 @@ module damage_local
damage_local_stateInit, & damage_local_stateInit, &
damage_local_aTolState, & damage_local_aTolState, &
damage_local_dotState, & damage_local_dotState, &
damage_local_getDamage, & damage_local_damageValue, &
damage_local_postResults damage_local_postResults
contains contains
@ -295,8 +295,7 @@ subroutine damage_local_dotState(Tstar_v, Fe, Lp, ipc, ip, el)
damageState(phase)%state(1,constituent))) damageState(phase)%state(1,constituent)))
damageState(phase)%dotState(1,constituent) = & damageState(phase)%dotState(1,constituent) = &
sum(abs(math_Mandel6to33(Tstar_v)*Lp))/ & sum(abs(math_Mandel6to33(Tstar_v)*Lp))
(math_trace33(lattice_surfaceEnergy33(1:3,1:3,phase))/3.0_pReal)
damageState(phase)%dotState(2,constituent) = & damageState(phase)%dotState(2,constituent) = &
damage_local_crack_mobility(instance)* & damage_local_crack_mobility(instance)* &
(trialDamage - damageState(phase)%state(2,constituent)) (trialDamage - damageState(phase)%state(2,constituent))
@ -306,7 +305,7 @@ end subroutine damage_local_dotState
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief returns temperature based on local damage model state layout !> @brief returns temperature based on local damage model state layout
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
function damage_local_getDamage(ipc, ip, el) function damage_local_damageValue(ipc, ip, el)
use material, only: & use material, only: &
mappingConstitutive, & mappingConstitutive, &
damageState damageState
@ -316,13 +315,13 @@ function damage_local_getDamage(ipc, ip, el)
ipc, & !< grain number ipc, & !< grain number
ip, & !< integration point number ip, & !< integration point number
el !< element number el !< element number
real(pReal) :: damage_local_getDamage real(pReal) :: damage_local_damageValue
damage_local_getDamage = & damage_local_damageValue = &
damageState(mappingConstitutive(2,ipc,ip,el))%state(2,mappingConstitutive(1,ipc,ip,el))* & damageState(mappingConstitutive(2,ipc,ip,el))%state(2,mappingConstitutive(1,ipc,ip,el))* &
damageState(mappingConstitutive(2,ipc,ip,el))%state(2,mappingConstitutive(1,ipc,ip,el)) damageState(mappingConstitutive(2,ipc,ip,el))%state(2,mappingConstitutive(1,ipc,ip,el))
end function damage_local_getDamage end function damage_local_damageValue
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief return array of constitutive results !> @brief return array of constitutive results

View File

@ -42,7 +42,7 @@ module thermal_adiabatic
thermal_adiabatic_stateInit, & thermal_adiabatic_stateInit, &
thermal_adiabatic_aTolState, & thermal_adiabatic_aTolState, &
thermal_adiabatic_dotState, & thermal_adiabatic_dotState, &
thermal_adiabatic_getTemperature, & thermal_adiabatic_temperature, &
thermal_adiabatic_postResults thermal_adiabatic_postResults
contains contains
@ -283,7 +283,7 @@ end subroutine thermal_adiabatic_dotState
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief returns temperature based on adiabatic thermal model state layout !> @brief returns temperature based on adiabatic thermal model state layout
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
function thermal_adiabatic_getTemperature(ipc, ip, el) function thermal_adiabatic_temperature(ipc, ip, el)
use material, only: & use material, only: &
mappingConstitutive, & mappingConstitutive, &
thermalState thermalState
@ -293,12 +293,12 @@ function thermal_adiabatic_getTemperature(ipc, ip, el)
ipc, & !< grain number ipc, & !< grain number
ip, & !< integration point number ip, & !< integration point number
el !< element number el !< element number
real(pReal) :: thermal_adiabatic_getTemperature real(pReal) :: thermal_adiabatic_temperature
thermal_adiabatic_getTemperature = & thermal_adiabatic_temperature = &
thermalState(mappingConstitutive(2,ipc,ip,el))%state(1,mappingConstitutive(1,ipc,ip,el)) thermalState(mappingConstitutive(2,ipc,ip,el))%state(1,mappingConstitutive(1,ipc,ip,el))
end function thermal_adiabatic_getTemperature end function thermal_adiabatic_temperature
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief return array of constitutive results !> @brief return array of constitutive results

View File

@ -42,7 +42,7 @@ module thermal_conduction
thermal_conduction_stateInit, & thermal_conduction_stateInit, &
thermal_conduction_aTolState, & thermal_conduction_aTolState, &
thermal_conduction_microstructure, & thermal_conduction_microstructure, &
thermal_conduction_getTemperature, & thermal_conduction_temperature, &
thermal_conduction_postResults thermal_conduction_postResults
contains contains
@ -283,7 +283,7 @@ end subroutine thermal_conduction_microstructure
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief returns temperature based on conduction thermal model state layout !> @brief returns temperature based on conduction thermal model state layout
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
function thermal_conduction_getTemperature(ipc, ip, el) function thermal_conduction_temperature(ipc, ip, el)
use material, only: & use material, only: &
mappingConstitutive, & mappingConstitutive, &
thermalState thermalState
@ -293,13 +293,13 @@ function thermal_conduction_getTemperature(ipc, ip, el)
ipc, & !< grain number ipc, & !< grain number
ip, & !< integration point number ip, & !< integration point number
el !< element number el !< element number
real(pReal) :: thermal_conduction_getTemperature real(pReal) :: thermal_conduction_temperature
thermal_conduction_getTemperature = & thermal_conduction_temperature = &
thermalState(mappingConstitutive(2,ipc,ip,el))%state(2,mappingConstitutive(1,ipc,ip,el)) thermalState(mappingConstitutive(2,ipc,ip,el))%state(2,mappingConstitutive(1,ipc,ip,el))
end function thermal_conduction_getTemperature end function thermal_conduction_temperature
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief return array of constitutive results !> @brief return array of constitutive results
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------