removed delta state for J2 and phenopowerlaw when using new state

This commit is contained in:
Martin Diehl 2014-06-17 06:54:49 +00:00
parent 98ec754cdf
commit 3533138936
4 changed files with 42 additions and 44 deletions

View File

@ -55,9 +55,7 @@ module constitutive
constitutive_LpAndItsTangent, & constitutive_LpAndItsTangent, &
constitutive_TandItsTangent, & constitutive_TandItsTangent, &
constitutive_collectDotState, & constitutive_collectDotState, &
#ifndef NEWSTATE
constitutive_collectDeltaState, & constitutive_collectDeltaState, &
#endif
constitutive_postResults constitutive_postResults
private :: & private :: &
@ -262,17 +260,17 @@ subroutine constitutive_init
endif endif
#endif #endif
ElemLoop:do e = 1_pInt,mesh_NcpElems ! loop over elements ElemLoop:do e = 1_pInt,mesh_NcpElems ! loop over elements
myNgrains = homogenization_Ngrains(mesh_element(3,e)) myNgrains = homogenization_Ngrains(mesh_element(3,e))
IPloop:do i = 1_pInt,FE_Nips(FE_geomtype(mesh_element(2,e))) ! loop over IPs IPloop:do i = 1_pInt,FE_Nips(FE_geomtype(mesh_element(2,e))) ! loop over IPs
GrainLoop:do g = 1_pInt,myNgrains ! loop over grains GrainLoop:do g = 1_pInt,myNgrains ! loop over grains
select case(phase_elasticity(material_phase(g,i,e))) select case(phase_elasticity(material_phase(g,i,e)))
case default ! so far no output for elasticity case default ! so far no output for elasticity
end select end select
phase = material_phase(g,i,e) phase = material_phase(g,i,e)
instance = phase_plasticityInstance(phase) instance = phase_plasticityInstance(phase)
#if defined(HDF) || defined(NEWSTATE) #if defined(HDF) || defined(NEWSTATE)
ConstitutivePosition(phase) = ConstitutivePosition(phase)+1_pInt ! not distinguishing between instances of same phase ConstitutivePosition(phase) = ConstitutivePosition(phase)+1_pInt ! not distinguishing between instances of same phase
mappingConstitutive(1:2,g,i,e) = [ConstitutivePosition(phase),phase] mappingConstitutive(1:2,g,i,e) = [ConstitutivePosition(phase),phase]
#endif #endif
select case(phase_plasticity(material_phase(g,i,e))) select case(phase_plasticity(material_phase(g,i,e)))
@ -938,10 +936,10 @@ subroutine constitutive_collectDotState(Tstar_v, FeArray, FpArray, Temperature,
end subroutine constitutive_collectDotState end subroutine constitutive_collectDotState
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief contains the constitutive equation for calculating the incremental change of !> @brief for constitutive models having an instantaneous change of state (so far, only nonlocal)
!> microstructure based on the current stress and state !> will return false if delta state is not needed/supported by the constitutive model
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine constitutive_collectDeltaState(Tstar_v, ipc, ip, el) logical function constitutive_collectDeltaState(Tstar_v, ipc, ip, el)
use prec, only: & use prec, only: &
pLongInt pLongInt
use debug, only: & use debug, only: &
@ -978,6 +976,7 @@ subroutine constitutive_collectDeltaState(Tstar_v, ipc, ip, el)
select case (phase_plasticity(material_phase(ipc,ip,el))) select case (phase_plasticity(material_phase(ipc,ip,el)))
case (PLASTICITY_NONLOCAL_ID) case (PLASTICITY_NONLOCAL_ID)
constitutive_collectDeltaState = .true.
#ifdef NEWSTATE #ifdef NEWSTATE
call constitutive_nonlocal_deltaState(mappingConstitutive, Tstar_v,ipc,ip,el) call constitutive_nonlocal_deltaState(mappingConstitutive, Tstar_v,ipc,ip,el)
#else #else
@ -985,10 +984,8 @@ subroutine constitutive_collectDeltaState(Tstar_v, ipc, ip, el)
constitutive_state(ipc,ip,el), Tstar_v,ipc,ip,el) constitutive_state(ipc,ip,el), Tstar_v,ipc,ip,el)
#endif #endif
case default case default
#ifdef NEWSTATE constitutive_collectDeltaState = .false.
plasticState(mappingConstitutive(2,ipc,ip,el))%deltaState(:,mappingConstitutive(2,ipc,ip,el)) = & #ifndef NEWSTATE
0.0_pReal
#else
constitutive_deltaState(ipc,ip,el)%p = 0.0_pReal !ToDo: needed or will it remain zero anyway? constitutive_deltaState(ipc,ip,el)%p = 0.0_pReal !ToDo: needed or will it remain zero anyway?
#endif #endif
end select end select
@ -1003,7 +1000,9 @@ subroutine constitutive_collectDeltaState(Tstar_v, ipc, ip, el)
!$OMP END CRITICAL (debugTimingDeltaState) !$OMP END CRITICAL (debugTimingDeltaState)
endif endif
end subroutine constitutive_collectDeltaState end function constitutive_collectDeltaState
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief returns array of constitutive results !> @brief returns array of constitutive results
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------

View File

@ -322,7 +322,6 @@ subroutine constitutive_j2_init(fileUnit)
allocate(plasticState(phase)%state_backup (sizeState,NofMyPhase),source=0.0_pReal) allocate(plasticState(phase)%state_backup (sizeState,NofMyPhase),source=0.0_pReal)
allocate(plasticState(phase)%aTolState (NofMyPhase),source=constitutive_j2_aTolResistance(instance)) allocate(plasticState(phase)%aTolState (NofMyPhase),source=constitutive_j2_aTolResistance(instance))
allocate(plasticState(phase)%dotState (sizeDotState,NofMyPhase),source=0.0_pReal) allocate(plasticState(phase)%dotState (sizeDotState,NofMyPhase),source=0.0_pReal)
allocate(plasticState(phase)%deltaState (sizeDotState,NofMyPhase),source=0.0_pReal)
allocate(plasticState(phase)%dotState_backup (sizeDotState,NofMyPhase),source=0.0_pReal) allocate(plasticState(phase)%dotState_backup (sizeDotState,NofMyPhase),source=0.0_pReal)
if (any(numerics_integrator == 1_pInt)) then if (any(numerics_integrator == 1_pInt)) then
allocate(plasticState(phase)%previousDotState (sizeDotState,NofMyPhase),source=0.0_pReal) allocate(plasticState(phase)%previousDotState (sizeDotState,NofMyPhase),source=0.0_pReal)

View File

@ -516,7 +516,6 @@ allocate(constitutive_phenopowerlaw_sizePostResults(maxNinstance),
allocate(plasticState(phase)%state_backup (sizeState,NofMyPhase), source=0.0_pReal) allocate(plasticState(phase)%state_backup (sizeState,NofMyPhase), source=0.0_pReal)
allocate(plasticState(phase)%dotState (sizeDotState,NofMyPhase), source=0.0_pReal) allocate(plasticState(phase)%dotState (sizeDotState,NofMyPhase), source=0.0_pReal)
allocate(plasticState(phase)%deltaState (sizeDotState,NofMyPhase), source=0.0_pReal)
allocate(plasticState(phase)%dotState_backup(sizeDotState,NofMyPhase), source=0.0_pReal) allocate(plasticState(phase)%dotState_backup(sizeDotState,NofMyPhase), source=0.0_pReal)
if (any(numerics_integrator == 1_pInt)) then if (any(numerics_integrator == 1_pInt)) then
allocate(plasticState(phase)%previousDotState (sizeDotState,NofMyPhase),source=0.0_pReal) allocate(plasticState(phase)%previousDotState (sizeDotState,NofMyPhase),source=0.0_pReal)

View File

@ -3339,6 +3339,7 @@ end subroutine crystallite_integrateStateFPI
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief calculates a jump in the state according to the current state and the current stress !> @brief calculates a jump in the state according to the current state and the current stress
!> returns true, if state jump was successfull or not needed. false indicates NaN in delta state
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
logical function crystallite_stateJump(g,i,e) logical function crystallite_stateJump(g,i,e)
use debug, only: & use debug, only: &
@ -3361,8 +3362,8 @@ logical function crystallite_stateJump(g,i,e)
#endif #endif
homogenization_Ngrains homogenization_Ngrains
use constitutive, only: & use constitutive, only: &
#ifndef NEWSTATE
constitutive_collectDeltaState, & constitutive_collectDeltaState, &
#ifndef NEWSTATE
constitutive_sizeDotState, & constitutive_sizeDotState, &
constitutive_state, & constitutive_state, &
constitutive_deltaState constitutive_deltaState
@ -3380,40 +3381,40 @@ logical function crystallite_stateJump(g,i,e)
mySizeDotState mySizeDotState
crystallite_stateJump = .false. if (constitutive_collectDeltaState(crystallite_Tstar_v(1:6,g,i,e), g,i,e)) then
#ifndef NEWSTATE
call constitutive_collectDeltaState(crystallite_Tstar_v(1:6,g,i,e), g,i,e)
#endif
#ifdef NEWSTATE #ifdef NEWSTATE
mySizeDotState = plasticState(mappingConstitutive(2,g,i,e))%sizeDotState mySizeDotState = plasticState(mappingConstitutive(2,g,i,e))%sizeDotState
if( any(plasticState(mappingConstitutive(2,g,i,e))%deltaState(:,mappingConstitutive(1,g,i,e)) & if( any(plasticState(mappingConstitutive(2,g,i,e))%deltaState(:,mappingConstitutive(1,g,i,e)) &
/= plasticState(mappingConstitutive(2,g,i,e))%deltaState(:,mappingConstitutive(1,g,i,e)))) then ! NaN occured in dotState /= plasticState(mappingConstitutive(2,g,i,e))%deltaState(:,mappingConstitutive(1,g,i,e)))) then ! NaN occured in deltaState
return crystallite_stateJump = .false.
endif return
plasticState(mappingConstitutive(2,g,i,e))%state(1:mySizeDotState,mappingConstitutive(1,g,i,e)) = & endif
plasticState(mappingConstitutive(2,g,i,e))%state(1:mySizeDotState,mappingConstitutive(1,g,i,e)) & plasticState(mappingConstitutive(2,g,i,e))%state(1:mySizeDotState,mappingConstitutive(1,g,i,e)) = &
+ plasticState(mappingConstitutive(2,g,i,e))%deltaState(1:mySizeDotState,mappingConstitutive(1,g,i,e)) plasticState(mappingConstitutive(2,g,i,e))%state(1:mySizeDotState,mappingConstitutive(1,g,i,e)) &
+ plasticState(mappingConstitutive(2,g,i,e))%deltaState(1:mySizeDotState,mappingConstitutive(1,g,i,e))
#else #else
mySizeDotState = constitutive_sizeDotState(g,i,e) mySizeDotState = constitutive_sizeDotState(g,i,e)
if (any(constitutive_deltaState(g,i,e)%p(1:mySizeDotState) & if (any(constitutive_deltaState(g,i,e)%p(1:mySizeDotState) &
/= constitutive_deltaState(g,i,e)%p(1:mySizeDotState))) then /= constitutive_deltaState(g,i,e)%p(1:mySizeDotState))) then
return crystallite_stateJump = .false.
endif return
endif
constitutive_state(g,i,e)%p(1:mySizeDotState) = constitutive_state(g,i,e)%p(1:mySizeDotState) & constitutive_state(g,i,e)%p(1:mySizeDotState) = constitutive_state(g,i,e)%p(1:mySizeDotState) &
+ constitutive_deltaState(g,i,e)%p(1:mySizeDotState) + constitutive_deltaState(g,i,e)%p(1:mySizeDotState)
#ifndef _OPENMP #ifndef _OPENMP
if (any(constitutive_deltaState(g,i,e)%p(1:mySizeDotState) /= 0.0_pReal) & if (any(constitutive_deltaState(g,i,e)%p(1:mySizeDotState) /= 0.0_pReal) &
.and. iand(debug_level(debug_crystallite), debug_levelExtensive) /= 0_pInt & .and. iand(debug_level(debug_crystallite), debug_levelExtensive) /= 0_pInt &
.and. ((e == debug_e .and. i == debug_i .and. g == debug_g) & .and. ((e == debug_e .and. i == debug_i .and. g == debug_g) &
.or. .not. iand(debug_level(debug_crystallite), debug_levelSelective) /= 0_pInt)) then .or. .not. iand(debug_level(debug_crystallite), debug_levelSelective) /= 0_pInt)) then
write(6,'(a,i8,1x,i2,1x,i3, /)') '<< CRYST >> update state at el ip g ',e,i,g write(6,'(a,i8,1x,i2,1x,i3, /)') '<< CRYST >> update state at el ip g ',e,i,g
write(6,'(a,/,(12x,12(e12.5,1x)),/)') '<< CRYST >> deltaState', constitutive_deltaState(g,i,e)%p(1:mySizeDotState) write(6,'(a,/,(12x,12(e12.5,1x)),/)') '<< CRYST >> deltaState', constitutive_deltaState(g,i,e)%p(1:mySizeDotState)
write(6,'(a,/,(12x,12(e12.5,1x)),/)') '<< CRYST >> new state', constitutive_state(g,i,e)%p(1:mySizeDotState) write(6,'(a,/,(12x,12(e12.5,1x)),/)') '<< CRYST >> new state', constitutive_state(g,i,e)%p(1:mySizeDotState)
endif endif
#endif #endif
#endif #endif
endif
crystallite_stateJump = .true. crystallite_stateJump = .true.