added auxillary functions: get/put 'Physics' to communicate regularised/ unregularised values between solver and constitutive physics
This commit is contained in:
parent
a7741457b9
commit
923adbc2d3
|
@ -23,6 +23,12 @@ module constitutive
|
|||
constitutive_TandItsTangent, &
|
||||
constitutive_collectDotState, &
|
||||
constitutive_collectDeltaState, &
|
||||
#ifdef NEWSTATE
|
||||
constitutive_getLocalDamage, &
|
||||
constitutive_getNonLocalDamage, &
|
||||
constitutive_getAdiabaticThermal, &
|
||||
constitutive_getConductionThermal, &
|
||||
#endif
|
||||
constitutive_postResults
|
||||
|
||||
private :: &
|
||||
|
@ -664,6 +670,136 @@ logical function constitutive_collectDeltaState(Tstar_v, ipc, ip, el)
|
|||
endif
|
||||
|
||||
end function constitutive_collectDeltaState
|
||||
#ifdef NEWSTATE
|
||||
!--------------------------------------------------------------------------------------------------
|
||||
!> @brief returns temperature based on each damage model state layout
|
||||
!--------------------------------------------------------------------------------------------------
|
||||
function constitutive_getLocalDamage(ipc, ip, el)
|
||||
use prec, only: &
|
||||
pReal
|
||||
use material, only: &
|
||||
material_phase, &
|
||||
LOCAL_DAMAGE_none_ID, &
|
||||
LOCAL_DAMAGE_BRITTLE_ID, &
|
||||
phase_damage
|
||||
use damage_local, only: &
|
||||
constitutive_brittle_getDamage
|
||||
|
||||
implicit none
|
||||
integer(pInt), intent(in) :: &
|
||||
ipc, & !< grain number
|
||||
ip, & !< integration point number
|
||||
el !< element number
|
||||
real(pReal) :: constitutive_getLocalDamage
|
||||
|
||||
select case (phase_damage(material_phase(ipc,ip,el)))
|
||||
case (LOCAL_DAMAGE_none_ID)
|
||||
constitutive_getLocalDamage = 1.0_pReal
|
||||
|
||||
case (LOCAL_DAMAGE_BRITTLE_ID)
|
||||
constitutive_getLocalDamage = constitutive_brittle_getDamage(ipc, ip, el)
|
||||
end select
|
||||
|
||||
end function constitutive_getLocalDamage
|
||||
|
||||
|
||||
function constitutive_getNonlocalDamage(ipc, ip, el)
|
||||
use prec, only: &
|
||||
pReal
|
||||
use material, only: &
|
||||
material_homog, &
|
||||
mappingHomogenization, &
|
||||
fieldDamage, &
|
||||
field_damage_type, &
|
||||
FIELD_DAMAGE_LOCAL_ID, &
|
||||
FIELD_DAMAGE_NONLOCAL_ID
|
||||
|
||||
|
||||
implicit none
|
||||
integer(pInt), intent(in) :: &
|
||||
ipc, & !< grain number
|
||||
ip, & !< integration point number
|
||||
el !< element number
|
||||
real(pReal) :: constitutive_getNonlocalDamage
|
||||
|
||||
select case(field_damage_type(material_homog(ip,el)))
|
||||
|
||||
case (FIELD_DAMAGE_LOCAL_ID)
|
||||
constitutive_getNonlocalDamage = 1.0_pReal ! doubt
|
||||
|
||||
case (FIELD_DAMAGE_NONLOCAL_ID)
|
||||
constitutive_getNonlocalDamage = fieldDamage(material_homog(ip,el))% &
|
||||
state(1,mappingHomogenization(1,ip,el)) ! Taylor type
|
||||
|
||||
end select
|
||||
|
||||
end function constitutive_getNonlocalDamage
|
||||
|
||||
function constitutive_getAdiabaticThermal(ipc, ip, el)
|
||||
use prec, only: &
|
||||
pReal
|
||||
use material, only: &
|
||||
material_phase, &
|
||||
LOCAL_THERMAL_none_ID, &
|
||||
LOCAL_THERMAL_HEATGEN_ID, &
|
||||
phase_thermal
|
||||
! use thermal_adiabatic, only: &
|
||||
! constitutive_heatgen_getThermal
|
||||
use lattice, only: &
|
||||
lattice_referenceTemperature
|
||||
|
||||
implicit none
|
||||
integer(pInt), intent(in) :: &
|
||||
ipc, & !< grain number
|
||||
ip, & !< integration point number
|
||||
el !< element number
|
||||
real(pReal) :: constitutive_getAdiabaticThermal
|
||||
|
||||
select case (phase_thermal(material_phase(ipc,ip,el)))
|
||||
case (LOCAL_THERMAL_none_ID)
|
||||
! constitutive_getAdiabaticThermal = lattice_referenceTemperature(material_phase(ipc,ip,el))
|
||||
|
||||
case (LOCAL_THERMAL_HEATGEN_ID)
|
||||
! constitutive_getAdiabaticThermal = constitutive_heatgen_getThermal(ipc, ip, el)
|
||||
end select
|
||||
|
||||
end function constitutive_getAdiabaticThermal
|
||||
|
||||
|
||||
function constitutive_getConductionThermal(ipc, ip, el)
|
||||
use prec, only: &
|
||||
pReal
|
||||
use material, only: &
|
||||
mappingHomogenization, &
|
||||
fieldThermal, &
|
||||
field_thermal_type, &
|
||||
FIELD_DAMAGE_LOCAL_ID, &
|
||||
FIELD_DAMAGE_NONLOCAL_ID, &
|
||||
material_homog
|
||||
use lattice, only: &
|
||||
lattice_referenceTemperature
|
||||
implicit none
|
||||
integer(pInt), intent(in) :: &
|
||||
ipc, & !< grain number
|
||||
ip, & !< integration point number
|
||||
el !< element number
|
||||
real(pReal) :: constitutive_getConductionThermal
|
||||
|
||||
select case(field_thermal_type(material_homog(ip,el)))
|
||||
|
||||
case (FIELD_DAMAGE_LOCAL_ID)
|
||||
! constitutive_getConductionThermal = lattice_referenceTemperature(material_phase(ipc,ip,el)) ! check
|
||||
|
||||
case (FIELD_DAMAGE_NONLOCAL_ID)
|
||||
! constitutive_getConductionThermal = fieldThermal(material_homog(ip,el))% &
|
||||
! state(1,mappingHomogenization(1,ip,el)) ! Taylor type
|
||||
|
||||
end select
|
||||
|
||||
end function constitutive_getConductionThermal
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
!--------------------------------------------------------------------------------------------------
|
||||
|
|
|
@ -44,6 +44,9 @@ module damage_local
|
|||
damage_local_aTolState, &
|
||||
damage_local_dotState, &
|
||||
damage_local_damageValue, &
|
||||
#ifdef NEWSTATE
|
||||
constitutive_brittle_getDamage, &
|
||||
#endif
|
||||
damage_local_postResults
|
||||
|
||||
contains
|
||||
|
@ -351,6 +354,29 @@ function damage_local_damageValue(ipc, ip, el)
|
|||
|
||||
end function damage_local_damageValue
|
||||
|
||||
#ifdef NEWSTATE
|
||||
!--------------------------------------------------------------------------------------------------
|
||||
!> @brief returns temperature based on local damage model state layout
|
||||
!--------------------------------------------------------------------------------------------------
|
||||
function constitutive_brittle_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) :: constitutive_brittle_getDamage
|
||||
|
||||
constitutive_brittle_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 constitutive_brittle_getDamage
|
||||
#endif
|
||||
|
||||
!--------------------------------------------------------------------------------------------------
|
||||
!> @brief return array of constitutive results
|
||||
!--------------------------------------------------------------------------------------------------
|
||||
|
|
|
@ -62,6 +62,10 @@ module homogenization
|
|||
public :: &
|
||||
homogenization_init, &
|
||||
materialpoint_stressAndItsTangent, &
|
||||
#ifdef NEWSTATE
|
||||
field_getDAMAGE, &
|
||||
field_putDAMAGE, &
|
||||
#endif
|
||||
materialpoint_postResults
|
||||
private :: &
|
||||
homogenization_partitionDeformation, &
|
||||
|
@ -937,7 +941,163 @@ real(pReal) function homogenization_averageHeat(ip,el)
|
|||
|
||||
end function homogenization_averageHeat
|
||||
|
||||
#ifdef NEWSTATE
|
||||
!--------------------------------------------------------------------------------------------------
|
||||
!> @brief ToDo
|
||||
!--------------------------------------------------------------------------------------------------
|
||||
real(pReal) function field_getDAMAGE(ip,el)
|
||||
use mesh, only: &
|
||||
mesh_element
|
||||
use material, only: &
|
||||
material_homog, &
|
||||
field_damage_type, &
|
||||
FIELD_DAMAGE_LOCAL_ID, &
|
||||
FIELD_DAMAGE_NONLOCAL_ID, &
|
||||
homogenization_Ngrains
|
||||
|
||||
use constitutive, only: &
|
||||
constitutive_getLocalDamage
|
||||
|
||||
implicit none
|
||||
integer(pInt), intent(in) :: &
|
||||
ip, & !< integration point number
|
||||
el !< element number
|
||||
integer(pInt) :: &
|
||||
Ngrains, ipc
|
||||
!--------------------------------------------------------------------------------------------------
|
||||
! computing the damage value needed to be passed to field solver
|
||||
field_getDAMAGE =0.0_pReal
|
||||
|
||||
select case(field_damage_type(material_homog(ip,el)))
|
||||
|
||||
case (FIELD_DAMAGE_LOCAL_ID)
|
||||
field_getDAMAGE = 1.0_pReal
|
||||
|
||||
case (FIELD_DAMAGE_NONLOCAL_ID)
|
||||
do ipc = 1, homogenization_Ngrains(mesh_element(3,el))
|
||||
field_getDAMAGE = field_getDAMAGE + constitutive_getLocalDamage(ipc,ip,el)
|
||||
enddo
|
||||
|
||||
end select
|
||||
|
||||
field_getDAMAGE = field_getDAMAGE /homogenization_Ngrains(mesh_element(3,el))
|
||||
|
||||
end function field_getDAMAGE
|
||||
|
||||
!--------------------------------------------------------------------------------------------------
|
||||
!> @brief ToDo, to be pushed in crystallite/material??
|
||||
!--------------------------------------------------------------------------------------------------
|
||||
subroutine field_putDAMAGE(ip,el,fieldDamageValue) ! naming scheme
|
||||
use mesh, only: &
|
||||
mesh_element
|
||||
use material, only: &
|
||||
fieldDamage, &
|
||||
mappingHomogenization, &
|
||||
material_homog, &
|
||||
field_damage_type, &
|
||||
FIELD_DAMAGE_LOCAL_ID, &
|
||||
FIELD_DAMAGE_NONLOCAL_ID
|
||||
|
||||
implicit none
|
||||
integer(pInt), intent(in) :: &
|
||||
ip, & !< integration point number
|
||||
el, &
|
||||
fieldDamageValue
|
||||
|
||||
integer(pInt) :: &
|
||||
Ngrains, ipc
|
||||
|
||||
select case(field_damage_type(material_homog(ip,el)))
|
||||
|
||||
case (FIELD_DAMAGE_LOCAL_ID)
|
||||
|
||||
|
||||
case (FIELD_DAMAGE_NONLOCAL_ID)
|
||||
fieldDamage(material_homog(ip,el))% &
|
||||
state(1:fieldDamage(material_homog(ip,el))%sizeState, &
|
||||
mappingHomogenization(1,ip,el)) = fieldDamageValue
|
||||
|
||||
end select
|
||||
|
||||
end subroutine field_putDAMAGE
|
||||
|
||||
!--------------------------------------------------------------------------------------------------
|
||||
!> @brief ToDo
|
||||
!--------------------------------------------------------------------------------------------------
|
||||
real(pReal) function field_getThermal(ip,el)
|
||||
use mesh, only: &
|
||||
mesh_element
|
||||
use material, only: &
|
||||
material_homog, &
|
||||
field_thermal_type, &
|
||||
FIELD_THERMAL_ADIABATIC_ID, &
|
||||
FIELD_THERMAL_CONDUCTION_ID, &
|
||||
homogenization_Ngrains
|
||||
|
||||
use constitutive, only: &
|
||||
constitutive_getAdiabaticThermal
|
||||
|
||||
implicit none
|
||||
integer(pInt), intent(in) :: &
|
||||
ip, & !< integration point number
|
||||
el !< element number
|
||||
integer(pInt) :: &
|
||||
Ngrains, ipc
|
||||
|
||||
! computing the damage value needed to be passed to field solver
|
||||
field_getThermal =1.0_pReal
|
||||
|
||||
select case(field_thermal_type(material_homog(ip,el)))
|
||||
|
||||
case (FIELD_THERMAL_ADIABATIC_ID)
|
||||
field_getThermal = 1.0_pReal
|
||||
|
||||
case (FIELD_THERMAL_CONDUCTION_ID)
|
||||
do ipc = 1, homogenization_Ngrains(mesh_element(3,el))
|
||||
field_getThermal = field_getThermal + constitutive_getAdiabaticThermal(ipc,ip,el) ! array/function/subroutine which is faster
|
||||
enddo
|
||||
|
||||
end select
|
||||
|
||||
field_getThermal = field_getThermal /homogenization_Ngrains(mesh_element(3,el))
|
||||
|
||||
end function field_getThermal
|
||||
|
||||
!--------------------------------------------------------------------------------------------------
|
||||
!> @brief ToDo, to be pushed in crystallite/material??
|
||||
!--------------------------------------------------------------------------------------------------
|
||||
subroutine field_putThermal(ip,el,fieldThermalValue) ! naming scheme
|
||||
use mesh, only: &
|
||||
mesh_element
|
||||
use material, only: &
|
||||
material_homog, &
|
||||
fieldThermal, &
|
||||
mappingHomogenization, &
|
||||
field_thermal_type, &
|
||||
FIELD_THERMAL_ADIABATIC_ID, &
|
||||
FIELD_THERMAL_CONDUCTION_ID
|
||||
|
||||
implicit none
|
||||
integer(pInt), intent(in) :: &
|
||||
ip, & !< integration point number
|
||||
el, &
|
||||
fieldThermalValue
|
||||
integer(pInt) :: &
|
||||
Ngrains, ipc
|
||||
|
||||
select case(field_thermal_type(material_homog(ip,el)))
|
||||
|
||||
case (FIELD_THERMAL_ADIABATIC_ID)
|
||||
|
||||
case (FIELD_THERMAL_CONDUCTION_ID)
|
||||
fieldThermal(material_homog(ip,el))% &
|
||||
state(1:fieldThermal(material_homog(ip,el))%sizeState, &
|
||||
mappingHomogenization(1,ip,el)) = fieldThermalValue
|
||||
|
||||
end select
|
||||
|
||||
end subroutine field_putThermal
|
||||
#endif
|
||||
!--------------------------------------------------------------------------------------------------
|
||||
!> @brief return array of homogenization results for post file inclusion. call only,
|
||||
!> if homogenization_sizePostResults(i,e) > 0 !!
|
||||
|
|
|
@ -42,6 +42,9 @@ module thermal_adiabatic
|
|||
thermal_adiabatic_stateInit, &
|
||||
thermal_adiabatic_aTolState, &
|
||||
thermal_adiabatic_dotState, &
|
||||
#ifdef NEWSTATE
|
||||
constitutive_heatgen_getThermal, &
|
||||
#endif
|
||||
thermal_adiabatic_temperature, &
|
||||
thermal_adiabatic_postResults
|
||||
|
||||
|
@ -79,8 +82,13 @@ subroutine thermal_adiabatic_init(fileUnit)
|
|||
phase_thermal, &
|
||||
phase_thermalInstance, &
|
||||
phase_Noutput, &
|
||||
#ifdef NEWSTATE
|
||||
LOCAL_THERMAL_HEATGEN_label, &
|
||||
LOCAL_THERMAL_HEATGEN_ID, &
|
||||
#else
|
||||
THERMAL_ADIABATIC_label, &
|
||||
THERMAL_adiabatic_ID, &
|
||||
#endif
|
||||
material_phase, &
|
||||
thermalState, &
|
||||
MATERIAL_partPhase
|
||||
|
@ -98,13 +106,21 @@ subroutine thermal_adiabatic_init(fileUnit)
|
|||
character(len=65536) :: &
|
||||
tag = '', &
|
||||
line = ''
|
||||
|
||||
#ifdef NEWSTATE
|
||||
write(6,'(/,a)') ' <<<+- thermal_'//LOCAL_THERMAL_HEATGEN_label//' init -+>>>'
|
||||
#else
|
||||
write(6,'(/,a)') ' <<<+- thermal_'//THERMAL_ADIABATIC_label//' init -+>>>'
|
||||
#endif
|
||||
|
||||
write(6,'(a)') ' $Id: thermal_adiabatic.f90 3210 2014-06-17 15:24:44Z MPIE\m.diehl $'
|
||||
write(6,'(a15,a)') ' Current time: ',IO_timeStamp()
|
||||
#include "compilation_info.f90"
|
||||
|
||||
#ifdef NEWSTATE
|
||||
maxNinstance = int(count(phase_thermal == LOCAL_THERMAL_HEATGEN_ID),pInt)
|
||||
#else
|
||||
maxNinstance = int(count(phase_thermal == THERMAL_adiabatic_ID),pInt)
|
||||
#endif
|
||||
if (maxNinstance == 0_pInt) return
|
||||
|
||||
if (iand(debug_level(debug_constitutive),debug_levelBasic) /= 0_pInt) &
|
||||
|
@ -136,7 +152,11 @@ subroutine thermal_adiabatic_init(fileUnit)
|
|||
phase = phase + 1_pInt ! advance phase section counter
|
||||
cycle ! skip to next line
|
||||
endif
|
||||
#ifdef NEWSTATE
|
||||
if (phase > 0_pInt ) then; if (phase_thermal(phase) == LOCAL_THERMAL_HEATGEN_ID) then ! do not short-circuit here (.and. with next if statemen). It's not safe in Fortran
|
||||
#else
|
||||
if (phase > 0_pInt ) then; if (phase_thermal(phase) == THERMAL_adiabatic_ID) then ! do not short-circuit here (.and. with next if statemen). It's not safe in Fortran
|
||||
#endif
|
||||
instance = phase_thermalInstance(phase) ! which instance of my thermal is present phase
|
||||
positions = IO_stringPos(line,MAXNCHUNKS)
|
||||
tag = IO_lc(IO_stringValue(line,positions,1_pInt)) ! extract key
|
||||
|
@ -159,7 +179,11 @@ subroutine thermal_adiabatic_init(fileUnit)
|
|||
enddo parsingFile
|
||||
|
||||
initializeInstances: do phase = 1_pInt, size(phase_thermal)
|
||||
#ifdef NEWSTATE
|
||||
if (phase_thermal(phase) == LOCAL_THERMAL_HEATGEN_ID) then
|
||||
#else
|
||||
if (phase_thermal(phase) == THERMAL_adiabatic_ID) then
|
||||
#endif
|
||||
NofMyPhase=count(material_phase==phase)
|
||||
instance = phase_thermalInstance(phase)
|
||||
|
||||
|
@ -300,6 +324,29 @@ function thermal_adiabatic_temperature(ipc, ip, el)
|
|||
|
||||
end function thermal_adiabatic_temperature
|
||||
|
||||
#ifdef NEWSTATE
|
||||
!--------------------------------------------------------------------------------------------------
|
||||
!> @brief returns temperature based on local damage model state layout
|
||||
!--------------------------------------------------------------------------------------------------
|
||||
function constitutive_heatgen_getThermal(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) :: constitutive_heatgen_getThermal
|
||||
|
||||
constitutive_heatgen_getThermal = &
|
||||
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 constitutive_heatgen_getThermal
|
||||
#endif
|
||||
|
||||
!--------------------------------------------------------------------------------------------------
|
||||
!> @brief return array of constitutive results
|
||||
!--------------------------------------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in New Issue