added getDamage and getTemperature helper functions
This commit is contained in:
parent
d9a72c4062
commit
9d615b3d3b
|
@ -15,10 +15,12 @@ module constitutive_damage
|
||||||
integer(pInt), public, protected :: &
|
integer(pInt), public, protected :: &
|
||||||
constitutive_damage_maxSizePostResults, &
|
constitutive_damage_maxSizePostResults, &
|
||||||
constitutive_damage_maxSizeDotState
|
constitutive_damage_maxSizeDotState
|
||||||
|
|
||||||
public :: &
|
public :: &
|
||||||
constitutive_damage_init, &
|
constitutive_damage_init, &
|
||||||
constitutive_damage_microstructure, &
|
constitutive_damage_microstructure, &
|
||||||
constitutive_damage_collectDotState, &
|
constitutive_damage_collectDotState, &
|
||||||
|
constitutive_damage_getDamage, &
|
||||||
constitutive_damage_postResults
|
constitutive_damage_postResults
|
||||||
|
|
||||||
contains
|
contains
|
||||||
|
@ -201,6 +203,41 @@ subroutine constitutive_damage_collectDotState(Tstar_v, Fe, Lp, ipc, ip, el)
|
||||||
|
|
||||||
end subroutine constitutive_damage_collectDotState
|
end subroutine constitutive_damage_collectDotState
|
||||||
|
|
||||||
|
!--------------------------------------------------------------------------------------------------
|
||||||
|
!> @brief returns temperature based on each damage model state layout
|
||||||
|
!--------------------------------------------------------------------------------------------------
|
||||||
|
function constitutive_damage_getDamage(ipc, ip, el)
|
||||||
|
use material, only: &
|
||||||
|
material_phase, &
|
||||||
|
phase_damage, &
|
||||||
|
DAMAGE_none_ID, &
|
||||||
|
DAMAGE_local_ID, &
|
||||||
|
DAMAGE_gradient_ID
|
||||||
|
use damage_local, only: &
|
||||||
|
damage_local_getDamage
|
||||||
|
use damage_gradient, only: &
|
||||||
|
damage_gradient_getDamage
|
||||||
|
|
||||||
|
implicit none
|
||||||
|
integer(pInt), intent(in) :: &
|
||||||
|
ipc, & !< grain number
|
||||||
|
ip, & !< integration point number
|
||||||
|
el !< element number
|
||||||
|
real(pReal) :: constitutive_damage_getDamage
|
||||||
|
|
||||||
|
select case (phase_damage(material_phase(ipc,ip,el)))
|
||||||
|
case (DAMAGE_none_ID)
|
||||||
|
constitutive_damage_getDamage = 1.0_pReal
|
||||||
|
|
||||||
|
case (DAMAGE_local_ID)
|
||||||
|
constitutive_damage_getDamage = damage_local_getDamage(ipc, ip, el)
|
||||||
|
|
||||||
|
case (DAMAGE_gradient_ID)
|
||||||
|
constitutive_damage_getDamage = damage_gradient_getDamage(ipc, ip, el)
|
||||||
|
|
||||||
|
end select
|
||||||
|
|
||||||
|
end function constitutive_damage_getDamage
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
!> @brief returns array of constitutive results
|
!> @brief returns array of constitutive results
|
||||||
|
|
|
@ -19,6 +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_thermal_postResults
|
constitutive_thermal_postResults
|
||||||
|
|
||||||
contains
|
contains
|
||||||
|
@ -185,6 +186,44 @@ subroutine constitutive_thermal_collectDotState(Tstar_v, Lp, ipc, ip, el)
|
||||||
|
|
||||||
end subroutine constitutive_thermal_collectDotState
|
end subroutine constitutive_thermal_collectDotState
|
||||||
|
|
||||||
|
!--------------------------------------------------------------------------------------------------
|
||||||
|
!> @brief returns temperature based on each thermal model state layout
|
||||||
|
!--------------------------------------------------------------------------------------------------
|
||||||
|
function constitutive_thermal_getTemperature(ipc, ip, el)
|
||||||
|
use material, only: &
|
||||||
|
material_phase, &
|
||||||
|
phase_thermal, &
|
||||||
|
THERMAL_none_ID, &
|
||||||
|
THERMAL_adiabatic_ID, &
|
||||||
|
THERMAL_conduction_ID
|
||||||
|
use lattice, only: &
|
||||||
|
lattice_referenceTemperature
|
||||||
|
use thermal_conduction, only: &
|
||||||
|
thermal_conduction_getTemperature
|
||||||
|
! use thermal_adiabatic, only: &
|
||||||
|
! thermal_adiabatic_getTemperature
|
||||||
|
|
||||||
|
implicit none
|
||||||
|
integer(pInt), intent(in) :: &
|
||||||
|
ipc, & !< grain number
|
||||||
|
ip, & !< integration point number
|
||||||
|
el !< element number
|
||||||
|
real(pReal) :: constitutive_thermal_getTemperature
|
||||||
|
|
||||||
|
select case (phase_thermal(material_phase(ipc,ip,el)))
|
||||||
|
case (THERMAL_none_ID)
|
||||||
|
constitutive_thermal_getTemperature = lattice_referenceTemperature(material_phase(ipc,ip,el))
|
||||||
|
|
||||||
|
case (THERMAL_adiabatic_ID)
|
||||||
|
!constitutive_thermal_getTemperature = thermal_adiabatic_getTemperature(ipc, ip, el)
|
||||||
|
|
||||||
|
case (THERMAL_conduction_ID)
|
||||||
|
constitutive_thermal_getTemperature = thermal_conduction_getTemperature(ipc, ip, el)
|
||||||
|
|
||||||
|
end select
|
||||||
|
|
||||||
|
end function constitutive_thermal_getTemperature
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
!> @brief returns array of constitutive results
|
!> @brief returns array of constitutive results
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -44,6 +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_postResults
|
damage_gradient_postResults
|
||||||
|
|
||||||
contains
|
contains
|
||||||
|
@ -337,6 +338,26 @@ subroutine damage_gradient_dotState(Tstar_v, Lp, ipc, ip, el)
|
||||||
|
|
||||||
end subroutine damage_gradient_dotState
|
end subroutine damage_gradient_dotState
|
||||||
|
|
||||||
|
!--------------------------------------------------------------------------------------------------
|
||||||
|
!> @brief returns temperature based on gradient damage model state layout
|
||||||
|
!--------------------------------------------------------------------------------------------------
|
||||||
|
function damage_gradient_getDamage(ipc, ip, el)
|
||||||
|
use material, only: &
|
||||||
|
mappingConstitutive, &
|
||||||
|
damageState
|
||||||
|
|
||||||
|
implicit none
|
||||||
|
integer(pInt), intent(in) :: &
|
||||||
|
ipc, & !< grain number
|
||||||
|
ip, & !< integration point number
|
||||||
|
el !< element number
|
||||||
|
real(pReal) :: damage_gradient_getDamage
|
||||||
|
|
||||||
|
damage_gradient_getDamage = &
|
||||||
|
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
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
!> @brief return array of constitutive results
|
!> @brief return array of constitutive results
|
||||||
|
|
|
@ -42,6 +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_postResults
|
damage_local_postResults
|
||||||
|
|
||||||
contains
|
contains
|
||||||
|
@ -243,7 +244,8 @@ subroutine damage_local_aTolState(phase,instance)
|
||||||
instance ! number specifying the current instance of the damage
|
instance ! number specifying the current instance of the damage
|
||||||
real(pReal), dimension(damageState(phase)%sizeState) :: tempTol
|
real(pReal), dimension(damageState(phase)%sizeState) :: tempTol
|
||||||
|
|
||||||
tempTol = damage_local_aTol(instance)
|
tempTol(1) = 100.0_pReal
|
||||||
|
tempTol(2) = damage_local_aTol(instance)
|
||||||
damageState(phase)%aTolState = tempTol
|
damageState(phase)%aTolState = tempTol
|
||||||
end subroutine damage_local_aTolState
|
end subroutine damage_local_aTolState
|
||||||
|
|
||||||
|
@ -257,6 +259,7 @@ subroutine damage_local_dotState(Tstar_v, Fe, Lp, ipc, ip, el)
|
||||||
damageState
|
damageState
|
||||||
use math, only: &
|
use math, only: &
|
||||||
math_Mandel66to3333, &
|
math_Mandel66to3333, &
|
||||||
|
math_Mandel6to33, &
|
||||||
math_mul33x33, &
|
math_mul33x33, &
|
||||||
math_mul3333xx33, &
|
math_mul3333xx33, &
|
||||||
math_transpose33, &
|
math_transpose33, &
|
||||||
|
@ -292,13 +295,34 @@ 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) = &
|
||||||
0.0_pReal
|
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))
|
||||||
|
|
||||||
end subroutine damage_local_dotState
|
end subroutine damage_local_dotState
|
||||||
|
|
||||||
|
!--------------------------------------------------------------------------------------------------
|
||||||
|
!> @brief returns temperature based on local damage model state layout
|
||||||
|
!--------------------------------------------------------------------------------------------------
|
||||||
|
function damage_local_getDamage(ipc, ip, el)
|
||||||
|
use material, only: &
|
||||||
|
mappingConstitutive, &
|
||||||
|
damageState
|
||||||
|
|
||||||
|
implicit none
|
||||||
|
integer(pInt), intent(in) :: &
|
||||||
|
ipc, & !< grain number
|
||||||
|
ip, & !< integration point number
|
||||||
|
el !< element number
|
||||||
|
real(pReal) :: damage_local_getDamage
|
||||||
|
|
||||||
|
damage_local_getDamage = &
|
||||||
|
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
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
!> @brief return array of constitutive results
|
!> @brief return array of constitutive results
|
||||||
|
|
|
@ -42,6 +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_postResults
|
thermal_adiabatic_postResults
|
||||||
|
|
||||||
contains
|
contains
|
||||||
|
@ -279,6 +280,25 @@ subroutine thermal_adiabatic_dotState(Tstar_v, Lp, ipc, ip, el)
|
||||||
|
|
||||||
end subroutine thermal_adiabatic_dotState
|
end subroutine thermal_adiabatic_dotState
|
||||||
|
|
||||||
|
!--------------------------------------------------------------------------------------------------
|
||||||
|
!> @brief returns temperature based on adiabatic thermal model state layout
|
||||||
|
!--------------------------------------------------------------------------------------------------
|
||||||
|
function thermal_adiabatic_getTemperature(ipc, ip, el)
|
||||||
|
use material, only: &
|
||||||
|
mappingConstitutive, &
|
||||||
|
thermalState
|
||||||
|
|
||||||
|
implicit none
|
||||||
|
integer(pInt), intent(in) :: &
|
||||||
|
ipc, & !< grain number
|
||||||
|
ip, & !< integration point number
|
||||||
|
el !< element number
|
||||||
|
real(pReal) :: thermal_adiabatic_getTemperature
|
||||||
|
|
||||||
|
thermal_adiabatic_getTemperature = &
|
||||||
|
thermalState(mappingConstitutive(2,ipc,ip,el))%state(1,mappingConstitutive(1,ipc,ip,el))
|
||||||
|
|
||||||
|
end function thermal_adiabatic_getTemperature
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
!> @brief return array of constitutive results
|
!> @brief return array of constitutive results
|
||||||
|
|
|
@ -42,6 +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_postResults
|
thermal_conduction_postResults
|
||||||
|
|
||||||
contains
|
contains
|
||||||
|
@ -279,6 +280,25 @@ subroutine thermal_conduction_microstructure(Tstar_v, Lp, ipc, ip, el)
|
||||||
|
|
||||||
end subroutine thermal_conduction_microstructure
|
end subroutine thermal_conduction_microstructure
|
||||||
|
|
||||||
|
!--------------------------------------------------------------------------------------------------
|
||||||
|
!> @brief returns temperature based on conduction thermal model state layout
|
||||||
|
!--------------------------------------------------------------------------------------------------
|
||||||
|
function thermal_conduction_getTemperature(ipc, ip, el)
|
||||||
|
use material, only: &
|
||||||
|
mappingConstitutive, &
|
||||||
|
thermalState
|
||||||
|
|
||||||
|
implicit none
|
||||||
|
integer(pInt), intent(in) :: &
|
||||||
|
ipc, & !< grain number
|
||||||
|
ip, & !< integration point number
|
||||||
|
el !< element number
|
||||||
|
real(pReal) :: thermal_conduction_getTemperature
|
||||||
|
|
||||||
|
thermal_conduction_getTemperature = &
|
||||||
|
thermalState(mappingConstitutive(2,ipc,ip,el))%state(2,mappingConstitutive(1,ipc,ip,el))
|
||||||
|
|
||||||
|
end function thermal_conduction_getTemperature
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
!> @brief return array of constitutive results
|
!> @brief return array of constitutive results
|
||||||
|
|
Loading…
Reference in New Issue