thermal and damage modules now synched with DAMASK

This commit is contained in:
Pratheek Shanthraj 2014-06-24 23:19:21 +00:00
parent ab9a9f4f58
commit 6dc7f1bac9
2 changed files with 59 additions and 8 deletions

View File

@ -75,6 +75,12 @@ subroutine CPFEM_initAll(temperature,el,ip)
use FEZoo, only: & use FEZoo, only: &
FEZoo_init FEZoo_init
#endif #endif
#ifdef NEWSTATE
use constitutive_thermal, only: &
constitutive_thermal_init
use constitutive_damage, only: &
constitutive_damage_init
#endif
implicit none implicit none
integer(pInt), intent(in) :: el, & ! FE el number integer(pInt), intent(in) :: el, & ! FE el number
@ -102,6 +108,10 @@ subroutine CPFEM_initAll(temperature,el,ip)
call lattice_init call lattice_init
call material_init call material_init
call constitutive_init call constitutive_init
#ifdef NEWSTATE
call constitutive_thermal_init
call constitutive_damage_init
#endif
call crystallite_init(temperature) ! (have to) use temperature of first ip for whole model call crystallite_init(temperature) ! (have to) use temperature of first ip for whole model
call homogenization_init call homogenization_init
call CPFEM_init call CPFEM_init
@ -295,6 +305,8 @@ subroutine CPFEM_general(mode, parallelExecution, ffn, ffn1, temperature, dt, el
microstructure_elemhomo, & microstructure_elemhomo, &
#ifdef NEWSTATE #ifdef NEWSTATE
plasticState, & plasticState, &
damageState, &
thermalState, &
mappingConstitutive, & mappingConstitutive, &
#endif #endif
material_phase material_phase
@ -399,6 +411,8 @@ subroutine CPFEM_general(mode, parallelExecution, ffn, ffn1, temperature, dt, el
#endif #endif
#ifdef NEWSTATE #ifdef NEWSTATE
forall ( i = 1:size(plasticState)) plasticState(i)%state0= plasticState(i)%state ! copy state in this lenghty way because A component cannot be an array if the encompassing structure is an array forall ( i = 1:size(plasticState)) plasticState(i)%state0= plasticState(i)%state ! copy state in this lenghty way because A component cannot be an array if the encompassing structure is an array
forall ( i = 1:size(damageState)) damageState(i)%state0 = damageState(i)%state ! copy state in this lenghty way because A component cannot be an array if the encompassing structure is an array
forall ( i = 1:size(thermalState)) thermalState(i)%state0= thermalState(i)%state ! copy state in this lenghty way because A component cannot be an array if the encompassing structure is an array
if (iand(debug_level(debug_CPFEM), debug_levelExtensive) /= 0_pInt) then if (iand(debug_level(debug_CPFEM), debug_levelExtensive) /= 0_pInt) then
write(6,'(a)') '<< CPFEM >> aging states' write(6,'(a)') '<< CPFEM >> aging states'
if (debug_e <= mesh_NcpElems .and. debug_i <= mesh_maxNips) then if (debug_e <= mesh_NcpElems .and. debug_i <= mesh_maxNips) then

View File

@ -104,6 +104,12 @@ subroutine homogenization_init()
FE_geomtype FE_geomtype
use constitutive, only: & use constitutive, only: &
constitutive_maxSizePostResults constitutive_maxSizePostResults
#ifdef NEWSTATE
use constitutive_damage, only: &
constitutive_damage_maxSizePostResults
use constitutive_thermal, only: &
constitutive_thermal_maxSizePostResults
#endif
use crystallite, only: & use crystallite, only: &
crystallite_maxSizePostResults crystallite_maxSizePostResults
use material use material
@ -233,6 +239,10 @@ subroutine homogenization_init()
materialpoint_sizeResults = 1 & ! grain count materialpoint_sizeResults = 1 & ! grain count
+ 1 + homogenization_maxSizePostResults & ! homogSize & homogResult + 1 + homogenization_maxSizePostResults & ! homogSize & homogResult
+ homogenization_maxNgrains * (1 + crystallite_maxSizePostResults & ! crystallite size & crystallite results + homogenization_maxNgrains * (1 + crystallite_maxSizePostResults & ! crystallite size & crystallite results
#ifdef NEWSTATE
+ 1 + constitutive_damage_maxSizePostResults &
+ 1 + constitutive_thermal_maxSizePostResults &
#endif
+ 1 + constitutive_maxSizePostResults) ! constitutive size & constitutive results + 1 + constitutive_maxSizePostResults) ! constitutive size & constitutive results
allocate(materialpoint_results(materialpoint_sizeResults,mesh_maxNips,mesh_NcpElems)) allocate(materialpoint_results(materialpoint_sizeResults,mesh_maxNips,mesh_NcpElems))
@ -294,6 +304,8 @@ subroutine materialpoint_stressAndItsTangent(updateJaco,dt)
use material, only: & use material, only: &
#ifdef NEWSTATE #ifdef NEWSTATE
plasticState, & plasticState, &
damageState, &
thermalState, &
mappingConstitutive, & mappingConstitutive, &
#endif #endif
homogenization_Ngrains homogenization_Ngrains
@ -371,6 +383,10 @@ subroutine materialpoint_stressAndItsTangent(updateJaco,dt)
#ifdef NEWSTATE #ifdef NEWSTATE
plasticState(mappingConstitutive(2,g,i,e))%partionedState0(:,mappingConstitutive(1,g,i,e)) = & plasticState(mappingConstitutive(2,g,i,e))%partionedState0(:,mappingConstitutive(1,g,i,e)) = &
plasticState(mappingConstitutive(2,g,i,e))%state0(:,mappingConstitutive(1,g,i,e)) plasticState(mappingConstitutive(2,g,i,e))%state0(:,mappingConstitutive(1,g,i,e))
damageState(mappingConstitutive(2,g,i,e))%partionedState0(:,mappingConstitutive(1,g,i,e)) = &
damageState(mappingConstitutive(2,g,i,e))%state0(:,mappingConstitutive(1,g,i,e))
thermalState(mappingConstitutive(2,g,i,e))%partionedState0(:,mappingConstitutive(1,g,i,e)) = &
thermalState(mappingConstitutive(2,g,i,e))%state0(:,mappingConstitutive(1,g,i,e))
#else #else
constitutive_partionedState0(g,i,e)%p = constitutive_state0(g,i,e)%p ! ...microstructures constitutive_partionedState0(g,i,e)%p = constitutive_state0(g,i,e)%p ! ...microstructures
#endif #endif
@ -429,9 +445,14 @@ subroutine materialpoint_stressAndItsTangent(updateJaco,dt)
crystallite_partioneddPdF0(1:3,1:3,1:3,1:3,1:myNgrains,i,e) = crystallite_dPdF(1:3,1:3,1:3,1:3,1:myNgrains,i,e)! ...stiffness crystallite_partioneddPdF0(1:3,1:3,1:3,1:3,1:myNgrains,i,e) = crystallite_dPdF(1:3,1:3,1:3,1:3,1:myNgrains,i,e)! ...stiffness
crystallite_partionedTstar0_v(1:6,1:myNgrains,i,e) = crystallite_Tstar_v(1:6,1:myNgrains,i,e) ! ...2nd PK stress crystallite_partionedTstar0_v(1:6,1:myNgrains,i,e) = crystallite_Tstar_v(1:6,1:myNgrains,i,e) ! ...2nd PK stress
#ifdef NEWSTATE #ifdef NEWSTATE
forall (g = 1:myNgrains) & forall (g = 1:myNgrains)
plasticState(mappingConstitutive(2,g,i,e))%partionedState0(:,mappingConstitutive(1,g,i,e)) = & plasticState(mappingConstitutive(2,g,i,e))%partionedState0(:,mappingConstitutive(1,g,i,e)) = &
plasticState(mappingConstitutive(2,g,i,e))%state(:,mappingConstitutive(1,g,i,e)) plasticState(mappingConstitutive(2,g,i,e))%state(:,mappingConstitutive(1,g,i,e))
damageState(mappingConstitutive(2,g,i,e))%partionedState0(:,mappingConstitutive(1,g,i,e)) = &
damageState(mappingConstitutive(2,g,i,e))%state(:,mappingConstitutive(1,g,i,e))
thermalState(mappingConstitutive(2,g,i,e))%partionedState0(:,mappingConstitutive(1,g,i,e)) = &
thermalState(mappingConstitutive(2,g,i,e))%state(:,mappingConstitutive(1,g,i,e))
end forall
#else #else
forall (g = 1:myNgrains) constitutive_partionedState0(g,i,e)%p = constitutive_state(g,i,e)%p ! ...microstructures forall (g = 1:myNgrains) constitutive_partionedState0(g,i,e)%p = constitutive_state(g,i,e)%p ! ...microstructures
@ -483,9 +504,14 @@ forall (g = 1:myNgrains) &
crystallite_dPdF(1:3,1:3,1:3,1:3,1:myNgrains,i,e) = crystallite_partioneddPdF0(1:3,1:3,1:3,1:3,1:myNgrains,i,e) ! ...stiffness crystallite_dPdF(1:3,1:3,1:3,1:3,1:myNgrains,i,e) = crystallite_partioneddPdF0(1:3,1:3,1:3,1:3,1:myNgrains,i,e) ! ...stiffness
crystallite_Tstar_v(1:6,1:myNgrains,i,e) = crystallite_partionedTstar0_v(1:6,1:myNgrains,i,e) ! ...2nd PK stress crystallite_Tstar_v(1:6,1:myNgrains,i,e) = crystallite_partionedTstar0_v(1:6,1:myNgrains,i,e) ! ...2nd PK stress
#ifdef NEWSTATE #ifdef NEWSTATE
forall (g = 1:myNgrains) & forall (g = 1:myNgrains)
plasticState(mappingConstitutive(2,g,i,e))%state(:,mappingConstitutive(1,g,i,e)) = & plasticState(mappingConstitutive(2,g,i,e))%state(:,mappingConstitutive(1,g,i,e)) = &
plasticState(mappingConstitutive(2,g,i,e))%partionedState0(:,mappingConstitutive(1,g,i,e)) plasticState(mappingConstitutive(2,g,i,e))%partionedState0(:,mappingConstitutive(1,g,i,e))
damageState(mappingConstitutive(2,g,i,e))%state(:,mappingConstitutive(1,g,i,e)) = &
damageState(mappingConstitutive(2,g,i,e))%partionedState0(:,mappingConstitutive(1,g,i,e))
thermalState(mappingConstitutive(2,g,i,e))%state(:,mappingConstitutive(1,g,i,e)) = &
thermalState(mappingConstitutive(2,g,i,e))%partionedState0(:,mappingConstitutive(1,g,i,e))
end forall
#else #else
forall (g = 1:myNgrains) constitutive_state(g,i,e)%p = constitutive_partionedState0(g,i,e)%p ! ...microstructures forall (g = 1:myNgrains) constitutive_state(g,i,e)%p = constitutive_partionedState0(g,i,e)%p ! ...microstructures
@ -610,6 +636,12 @@ subroutine materialpoint_postResults
use constitutive, only: & use constitutive, only: &
constitutive_sizePostResults, & constitutive_sizePostResults, &
constitutive_postResults constitutive_postResults
#ifdef NEWSTATE
use constitutive_damage, only: &
constitutive_damage_sizePostResults
use constitutive_thermal, only: &
constitutive_thermal_sizePostResults
#endif
use crystallite, only: & use crystallite, only: &
crystallite_sizePostResults, & crystallite_sizePostResults, &
crystallite_postResults crystallite_postResults
@ -644,7 +676,12 @@ subroutine materialpoint_postResults
thePos = thePos + 1_pInt thePos = thePos + 1_pInt
grainLooping :do g = 1,myNgrains grainLooping :do g = 1,myNgrains
theSize = (1 + crystallite_sizePostResults(myCrystallite)) + (1 + constitutive_sizePostResults(g,i,e)) theSize = (1 + crystallite_sizePostResults(myCrystallite)) + &
#ifdef NEWSTATE
(1 + constitutive_damage_sizePostResults(g,i,e)) + &
(1 + constitutive_thermal_sizePostResults(g,i,e)) + &
#endif
(1 + constitutive_sizePostResults(g,i,e))
materialpoint_results(thePos+1:thePos+theSize,i,e) = crystallite_postResults(g,i,e) ! tell crystallite results materialpoint_results(thePos+1:thePos+theSize,i,e) = crystallite_postResults(g,i,e) ! tell crystallite results
thePos = thePos + theSize thePos = thePos + theSize
enddo grainLooping enddo grainLooping