consistent variable names
This commit is contained in:
parent
f6378790f1
commit
2cc8612572
|
@ -33,13 +33,14 @@ submodule(phase:plastic) kinehardening
|
||||||
end type tParameters
|
end type tParameters
|
||||||
|
|
||||||
type :: tKinehardeningState
|
type :: tKinehardeningState
|
||||||
real(pReal), pointer, dimension(:,:) :: & !< vectors along NipcMyInstance
|
real(pReal), pointer, dimension(:,:) :: &
|
||||||
crss, & !< critical resolved stress
|
xi, & !< resistance against plastic slip
|
||||||
crss_back, & !< critical resolved back stress
|
chi, & !< back stress
|
||||||
sense, & !< sense of acting shear stress (-1 or +1)
|
chi_0, & !< back stress at last switch of stress sense
|
||||||
chi0, & !< backstress at last switch of stress sense
|
gamma, & !< accumulated (absolute) shear
|
||||||
gamma0, & !< accumulated shear at last switch of stress sense
|
gamma_0, & !< accumulated shear at last switch of stress sense
|
||||||
accshear !< accumulated (absolute) shear
|
sgn_gamma !< sense of acting shear stress (-1 or +1)
|
||||||
|
|
||||||
end type tKinehardeningState
|
end type tKinehardeningState
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
|
@ -154,7 +155,6 @@ module function plastic_kinehardening_init() result(myPlasticity)
|
||||||
if (any(prm%xi_inf_f <= 0.0_pReal)) extmsg = trim(extmsg)//' xi_inf_f'
|
if (any(prm%xi_inf_f <= 0.0_pReal)) extmsg = trim(extmsg)//' xi_inf_f'
|
||||||
if (any(prm%xi_inf_b <= 0.0_pReal)) extmsg = trim(extmsg)//' xi_inf_b'
|
if (any(prm%xi_inf_b <= 0.0_pReal)) extmsg = trim(extmsg)//' xi_inf_b'
|
||||||
|
|
||||||
!ToDo: Any sensible checks for theta?
|
|
||||||
else slipActive
|
else slipActive
|
||||||
xi_0 = emptyRealArray
|
xi_0 = emptyRealArray
|
||||||
allocate(prm%xi_inf_f,prm%xi_inf_b,prm%h_0_f,prm%h_inf_f,prm%h_0_b,prm%h_inf_b,source=emptyRealArray)
|
allocate(prm%xi_inf_f,prm%xi_inf_b,prm%h_0_f,prm%h_inf_f,prm%h_0_b,prm%h_inf_b,source=emptyRealArray)
|
||||||
|
@ -164,8 +164,8 @@ module function plastic_kinehardening_init() result(myPlasticity)
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
! allocate state arrays
|
! allocate state arrays
|
||||||
Nmembers = count(material_phaseID == ph)
|
Nmembers = count(material_phaseID == ph)
|
||||||
sizeDotState = size(['crss ','crss_back', 'accshear ']) * prm%sum_N_sl !ToDo: adjust names like in material.yaml
|
sizeDotState = size(['xi ','chi ', 'gamma']) * prm%sum_N_sl
|
||||||
sizeDeltaState = size(['sense ', 'chi0 ', 'gamma0' ]) * prm%sum_N_sl !ToDo: adjust names like in material.yaml
|
sizeDeltaState = size(['sgn_gamma', 'chi_0 ', 'gamma_0 ']) * prm%sum_N_sl
|
||||||
sizeState = sizeDotState + sizeDeltaState
|
sizeState = sizeDotState + sizeDeltaState
|
||||||
|
|
||||||
call phase_allocateState(plasticState(ph),Nmembers,sizeState,sizeDotState,sizeDeltaState)
|
call phase_allocateState(plasticState(ph),Nmembers,sizeState,sizeDotState,sizeDeltaState)
|
||||||
|
@ -174,40 +174,40 @@ module function plastic_kinehardening_init() result(myPlasticity)
|
||||||
! state aliases and initialization
|
! state aliases and initialization
|
||||||
startIndex = 1
|
startIndex = 1
|
||||||
endIndex = prm%sum_N_sl
|
endIndex = prm%sum_N_sl
|
||||||
stt%crss => plasticState(ph)%state (startIndex:endIndex,:)
|
stt%xi => plasticState(ph)%state (startIndex:endIndex,:)
|
||||||
stt%crss = spread(xi_0, 2, Nmembers)
|
stt%xi = spread(xi_0, 2, Nmembers)
|
||||||
dot%crss => plasticState(ph)%dotState(startIndex:endIndex,:)
|
dot%xi => plasticState(ph)%dotState(startIndex:endIndex,:)
|
||||||
plasticState(ph)%atol(startIndex:endIndex) = pl%get_asFloat('atol_xi',defaultVal=1.0_pReal)
|
plasticState(ph)%atol(startIndex:endIndex) = pl%get_asFloat('atol_xi',defaultVal=1.0_pReal)
|
||||||
if(any(plasticState(ph)%atol(startIndex:endIndex) < 0.0_pReal)) extmsg = trim(extmsg)//' atol_xi'
|
if(any(plasticState(ph)%atol(startIndex:endIndex) < 0.0_pReal)) extmsg = trim(extmsg)//' atol_xi'
|
||||||
|
|
||||||
startIndex = endIndex + 1
|
startIndex = endIndex + 1
|
||||||
endIndex = endIndex + prm%sum_N_sl
|
endIndex = endIndex + prm%sum_N_sl
|
||||||
stt%crss_back => plasticState(ph)%state (startIndex:endIndex,:)
|
stt%chi => plasticState(ph)%state (startIndex:endIndex,:)
|
||||||
dot%crss_back => plasticState(ph)%dotState(startIndex:endIndex,:)
|
dot%chi => plasticState(ph)%dotState(startIndex:endIndex,:)
|
||||||
plasticState(ph)%atol(startIndex:endIndex) = pl%get_asFloat('atol_xi',defaultVal=1.0_pReal)
|
plasticState(ph)%atol(startIndex:endIndex) = pl%get_asFloat('atol_xi',defaultVal=1.0_pReal)
|
||||||
|
|
||||||
startIndex = endIndex + 1
|
startIndex = endIndex + 1
|
||||||
endIndex = endIndex + prm%sum_N_sl
|
endIndex = endIndex + prm%sum_N_sl
|
||||||
stt%accshear => plasticState(ph)%state (startIndex:endIndex,:)
|
stt%gamma => plasticState(ph)%state (startIndex:endIndex,:)
|
||||||
dot%accshear => plasticState(ph)%dotState(startIndex:endIndex,:)
|
dot%gamma => plasticState(ph)%dotState(startIndex:endIndex,:)
|
||||||
plasticState(ph)%atol(startIndex:endIndex) = pl%get_asFloat('atol_gamma',defaultVal=1.0e-6_pReal)
|
plasticState(ph)%atol(startIndex:endIndex) = pl%get_asFloat('atol_gamma',defaultVal=1.0e-6_pReal)
|
||||||
if(any(plasticState(ph)%atol(startIndex:endIndex) < 0.0_pReal)) extmsg = trim(extmsg)//' atol_gamma'
|
if(any(plasticState(ph)%atol(startIndex:endIndex) < 0.0_pReal)) extmsg = trim(extmsg)//' atol_gamma'
|
||||||
|
|
||||||
o = plasticState(ph)%offsetDeltaState
|
o = plasticState(ph)%offsetDeltaState
|
||||||
startIndex = endIndex + 1
|
startIndex = endIndex + 1
|
||||||
endIndex = endIndex + prm%sum_N_sl
|
endIndex = endIndex + prm%sum_N_sl
|
||||||
stt%sense => plasticState(ph)%state (startIndex :endIndex ,:)
|
stt%sgn_gamma => plasticState(ph)%state (startIndex :endIndex ,:)
|
||||||
dlt%sense => plasticState(ph)%deltaState(startIndex-o:endIndex-o,:)
|
dlt%sgn_gamma => plasticState(ph)%deltaState(startIndex-o:endIndex-o,:)
|
||||||
|
|
||||||
startIndex = endIndex + 1
|
startIndex = endIndex + 1
|
||||||
endIndex = endIndex + prm%sum_N_sl
|
endIndex = endIndex + prm%sum_N_sl
|
||||||
stt%chi0 => plasticState(ph)%state (startIndex :endIndex ,:)
|
stt%chi_0 => plasticState(ph)%state (startIndex :endIndex ,:)
|
||||||
dlt%chi0 => plasticState(ph)%deltaState(startIndex-o:endIndex-o,:)
|
dlt%chi_0 => plasticState(ph)%deltaState(startIndex-o:endIndex-o,:)
|
||||||
|
|
||||||
startIndex = endIndex + 1
|
startIndex = endIndex + 1
|
||||||
endIndex = endIndex + prm%sum_N_sl
|
endIndex = endIndex + prm%sum_N_sl
|
||||||
stt%gamma0 => plasticState(ph)%state (startIndex :endIndex ,:)
|
stt%gamma_0 => plasticState(ph)%state (startIndex :endIndex ,:)
|
||||||
dlt%gamma0 => plasticState(ph)%deltaState(startIndex-o:endIndex-o,:)
|
dlt%gamma_0 => plasticState(ph)%deltaState(startIndex-o:endIndex-o,:)
|
||||||
|
|
||||||
end associate
|
end associate
|
||||||
|
|
||||||
|
@ -283,21 +283,21 @@ module subroutine plastic_kinehardening_dotState(Mp,ph,en)
|
||||||
associate(prm => param(ph), stt => state(ph),dot => dotState(ph))
|
associate(prm => param(ph), stt => state(ph),dot => dotState(ph))
|
||||||
|
|
||||||
call kinetics(Mp,ph,en,dot_gamma_pos,dot_gamma_neg)
|
call kinetics(Mp,ph,en,dot_gamma_pos,dot_gamma_neg)
|
||||||
dot%accshear(:,en) = abs(dot_gamma_pos+dot_gamma_neg)
|
dot%gamma(:,en) = abs(dot_gamma_pos+dot_gamma_neg)
|
||||||
sumGamma = sum(stt%accshear(:,en))
|
sumGamma = sum(stt%gamma(:,en))
|
||||||
|
|
||||||
|
|
||||||
dot%crss(:,en) = matmul(prm%h_sl_sl,dot%accshear(:,en)) &
|
dot%xi(:,en) = matmul(prm%h_sl_sl,dot%gamma(:,en)) &
|
||||||
* ( prm%h_inf_f &
|
* ( prm%h_inf_f &
|
||||||
+ (prm%h_0_f - prm%h_inf_f + prm%h_0_f*prm%h_inf_f*sumGamma/prm%xi_inf_f) &
|
+ (prm%h_0_f - prm%h_inf_f + prm%h_0_f*prm%h_inf_f*sumGamma/prm%xi_inf_f) &
|
||||||
* exp(-sumGamma*prm%h_0_f/prm%xi_inf_f) &
|
* exp(-sumGamma*prm%h_0_f/prm%xi_inf_f) &
|
||||||
)
|
)
|
||||||
|
|
||||||
dot%crss_back(:,en) = stt%sense(:,en)*dot%accshear(:,en) * &
|
dot%chi(:,en) = stt%sgn_gamma(:,en)*dot%gamma(:,en) * &
|
||||||
( prm%h_inf_b + &
|
( prm%h_inf_b + &
|
||||||
(prm%h_0_b - prm%h_inf_b &
|
(prm%h_0_b - prm%h_inf_b &
|
||||||
+ prm%h_0_b*prm%h_inf_b/(prm%xi_inf_b+stt%chi0(:,en))*(stt%accshear(:,en)-stt%gamma0(:,en))&
|
+ prm%h_0_b*prm%h_inf_b/(prm%xi_inf_b+stt%chi_0(:,en))*(stt%gamma(:,en)-stt%gamma_0(:,en))&
|
||||||
) *exp(-(stt%accshear(:,en)-stt%gamma0(:,en)) *prm%h_0_b/(prm%xi_inf_b+stt%chi0(:,en))) &
|
) *exp(-(stt%gamma(:,en)-stt%gamma_0(:,en)) *prm%h_0_b/(prm%xi_inf_b+stt%chi_0(:,en))) &
|
||||||
)
|
)
|
||||||
|
|
||||||
end associate
|
end associate
|
||||||
|
@ -318,25 +318,24 @@ module subroutine plastic_kinehardening_deltaState(Mp,ph,en)
|
||||||
|
|
||||||
real(pReal), dimension(param(ph)%sum_N_sl) :: &
|
real(pReal), dimension(param(ph)%sum_N_sl) :: &
|
||||||
dot_gamma_pos,dot_gamma_neg, &
|
dot_gamma_pos,dot_gamma_neg, &
|
||||||
sense
|
sgn_gamma
|
||||||
|
|
||||||
|
|
||||||
associate(prm => param(ph), stt => state(ph), dlt => deltaState(ph))
|
associate(prm => param(ph), stt => state(ph), dlt => deltaState(ph))
|
||||||
|
|
||||||
call kinetics(Mp,ph,en,dot_gamma_pos,dot_gamma_neg)
|
call kinetics(Mp,ph,en,dot_gamma_pos,dot_gamma_neg)
|
||||||
sense = merge(state(ph)%sense(:,en), & ! keep existing...
|
sgn_gamma = merge(state(ph)%sgn_gamma(:,en), &
|
||||||
sign(1.0_pReal,dot_gamma_pos+dot_gamma_neg), & ! ...or have a defined
|
sign(1.0_pReal,dot_gamma_pos+dot_gamma_neg), &
|
||||||
dEq0(dot_gamma_pos+dot_gamma_neg,1e-10_pReal)) ! current sense of shear direction
|
dEq0(dot_gamma_pos+dot_gamma_neg,1e-10_pReal))
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
where(dNeq(sgn_gamma,stt%sgn_gamma(:,en),0.1_pReal)) ! ToDo sgn_gamma*stt%sgn_gamma(:,en)<0
|
||||||
! switch in sense of shear?
|
dlt%sgn_gamma (:,en) = sgn_gamma - stt%sgn_gamma(:,en)
|
||||||
where(dNeq(sense,stt%sense(:,en),0.1_pReal))
|
dlt%chi_0 (:,en) = abs(stt%chi(:,en)) - stt%chi_0(:,en)
|
||||||
dlt%sense (:,en) = sense - stt%sense(:,en) ! switch sense
|
dlt%gamma_0(:,en) = stt%gamma(:,en) - stt%gamma_0(:,en)
|
||||||
dlt%chi0 (:,en) = abs(stt%crss_back(:,en)) - stt%chi0(:,en) ! remember current backstress magnitude
|
|
||||||
dlt%gamma0(:,en) = stt%accshear(:,en) - stt%gamma0(:,en) ! remember current accumulated shear
|
|
||||||
else where
|
else where
|
||||||
dlt%sense (:,en) = 0.0_pReal
|
dlt%sgn_gamma (:,en) = 0.0_pReal
|
||||||
dlt%chi0 (:,en) = 0.0_pReal
|
dlt%chi_0 (:,en) = 0.0_pReal
|
||||||
dlt%gamma0(:,en) = 0.0_pReal
|
dlt%gamma_0(:,en) = 0.0_pReal
|
||||||
end where
|
end where
|
||||||
|
|
||||||
end associate
|
end associate
|
||||||
|
@ -358,22 +357,22 @@ module subroutine plastic_kinehardening_results(ph,group)
|
||||||
outputsLoop: do o = 1,size(prm%output)
|
outputsLoop: do o = 1,size(prm%output)
|
||||||
select case(trim(prm%output(o)))
|
select case(trim(prm%output(o)))
|
||||||
case ('xi')
|
case ('xi')
|
||||||
if(prm%sum_N_sl>0) call results_writeDataset(stt%crss,group,trim(prm%output(o)), &
|
if(prm%sum_N_sl>0) call results_writeDataset(stt%xi,group,trim(prm%output(o)), &
|
||||||
'resistance against plastic slip','Pa')
|
'resistance against plastic slip','Pa')
|
||||||
case ('tau_b')
|
case ('tau_b') !ToDo tbd
|
||||||
if(prm%sum_N_sl>0) call results_writeDataset(stt%crss_back,group,trim(prm%output(o)), &
|
if(prm%sum_N_sl>0) call results_writeDataset(stt%chi,group,trim(prm%output(o)), &
|
||||||
'back stress against plastic slip','Pa')
|
'back stress','Pa')
|
||||||
case ('sgn(gamma)')
|
case ('sgn(gamma)')
|
||||||
if(prm%sum_N_sl>0) call results_writeDataset(stt%sense,group,trim(prm%output(o)), & ! ToDo: could be int
|
if(prm%sum_N_sl>0) call results_writeDataset(stt%sgn_gamma,group,trim(prm%output(o)), & ! ToDo: could be int
|
||||||
'sense of shear','1')
|
'sense of shear','1')
|
||||||
case ('chi_0')
|
case ('chi')
|
||||||
if(prm%sum_N_sl>0) call results_writeDataset(stt%chi0,group,trim(prm%output(o)), &
|
if(prm%sum_N_sl>0) call results_writeDataset(stt%chi_0,group,trim(prm%output(o)), &
|
||||||
'tbd','Pa')
|
'back stress at last switch of stress sense','Pa')
|
||||||
case ('gamma_0')
|
case ('gamma_0')
|
||||||
if(prm%sum_N_sl>0) call results_writeDataset(stt%gamma0,group,trim(prm%output(o)), &
|
if(prm%sum_N_sl>0) call results_writeDataset(stt%gamma_0,group,trim(prm%output(o)), &
|
||||||
'tbd','1')
|
'plastic shear at last switch of stress sense','1')
|
||||||
case ('gamma')
|
case ('gamma')
|
||||||
if(prm%sum_N_sl>0) call results_writeDataset(stt%accshear,group,trim(prm%output(o)), &
|
if(prm%sum_N_sl>0) call results_writeDataset(stt%gamma,group,trim(prm%output(o)), &
|
||||||
'plastic shear','1')
|
'plastic shear','1')
|
||||||
end select
|
end select
|
||||||
enddo outputsLoop
|
enddo outputsLoop
|
||||||
|
@ -401,7 +400,7 @@ pure subroutine kinetics(Mp,ph,en, &
|
||||||
real(pReal), intent(out), dimension(param(ph)%sum_N_sl) :: &
|
real(pReal), intent(out), dimension(param(ph)%sum_N_sl) :: &
|
||||||
dot_gamma_pos, &
|
dot_gamma_pos, &
|
||||||
dot_gamma_neg
|
dot_gamma_neg
|
||||||
real(pReal), intent(out), optional, dimension(param(ph)%sum_N_sl) :: &
|
real(pReal), intent(out), dimension(param(ph)%sum_N_sl), optional :: &
|
||||||
ddot_gamma_dtau_pos, &
|
ddot_gamma_dtau_pos, &
|
||||||
ddot_gamma_dtau_neg
|
ddot_gamma_dtau_neg
|
||||||
|
|
||||||
|
@ -414,21 +413,21 @@ pure subroutine kinetics(Mp,ph,en, &
|
||||||
associate(prm => param(ph), stt => state(ph))
|
associate(prm => param(ph), stt => state(ph))
|
||||||
|
|
||||||
do i = 1, prm%sum_N_sl
|
do i = 1, prm%sum_N_sl
|
||||||
tau_pos(i) = math_tensordot(Mp,prm%P_nS_pos(1:3,1:3,i)) - stt%crss_back(i,en)
|
tau_pos(i) = math_tensordot(Mp,prm%P_nS_pos(1:3,1:3,i)) - stt%chi(i,en)
|
||||||
tau_neg(i) = merge(math_tensordot(Mp,prm%P_nS_neg(1:3,1:3,i)) - stt%crss_back(i,en), &
|
tau_neg(i) = merge(math_tensordot(Mp,prm%P_nS_neg(1:3,1:3,i)) - stt%chi(i,en), &
|
||||||
0.0_pReal, prm%nonSchmidActive)
|
0.0_pReal, prm%nonSchmidActive)
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
where(dNeq0(tau_pos))
|
where(dNeq0(tau_pos))
|
||||||
dot_gamma_pos = prm%dot_gamma_0 * merge(0.5_pReal,1.0_pReal, prm%nonSchmidActive) & ! 1/2 if non-Schmid active
|
dot_gamma_pos = prm%dot_gamma_0 * merge(0.5_pReal,1.0_pReal, prm%nonSchmidActive) & ! 1/2 if non-Schmid active
|
||||||
* sign(abs(tau_pos/stt%crss(:,en))**prm%n, tau_pos)
|
* sign(abs(tau_pos/stt%xi(:,en))**prm%n, tau_pos)
|
||||||
else where
|
else where
|
||||||
dot_gamma_pos = 0.0_pReal
|
dot_gamma_pos = 0.0_pReal
|
||||||
end where
|
end where
|
||||||
|
|
||||||
where(dNeq0(tau_neg))
|
where(dNeq0(tau_neg))
|
||||||
dot_gamma_neg = prm%dot_gamma_0 * 0.5_pReal & ! only used if non-Schmid active, always 1/2
|
dot_gamma_neg = prm%dot_gamma_0 * 0.5_pReal & ! only used if non-Schmid active, always 1/2
|
||||||
* sign(abs(tau_neg/stt%crss(:,en))**prm%n, tau_neg)
|
* sign(abs(tau_neg/stt%xi(:,en))**prm%n, tau_neg)
|
||||||
else where
|
else where
|
||||||
dot_gamma_neg = 0.0_pReal
|
dot_gamma_neg = 0.0_pReal
|
||||||
end where
|
end where
|
||||||
|
|
Loading…
Reference in New Issue