Added structures for constitutive_Lp ; constitutive_TangentLp and constitutive_DotState

This commit is contained in:
Luc Hantcherli 2007-03-23 19:37:18 +00:00
parent 1c04045359
commit dab0e7013c
1 changed files with 331 additions and 313 deletions

View File

@ -15,55 +15,46 @@ MODULE constitutive
use prec, only: pReal,pInt use prec, only: pReal,pInt
implicit none implicit none
!*****************************
!* Module parameters *
!*****************************
!* Character *
character(len=80), allocatable :: constitutive_ODFfile(:)
! NB: ODFfile(number of texture)
character(len=80), allocatable :: constitutive_symmetry(:)
! NB: symmetry(number of texture)
!* Integer * ! QUESTION: would it be wise to outsource these to _constitutive_ ?? YES!
integer(pInt) constitutive_Nmats ! *** Slip resistances at (t=t0) and (t=t1) ***
! NB: Number of materials (read in material file) ! allocate(constitutive_state_old(constitutive_Nstatevars,constitutive_maxNgrains,mesh_maxNips,mesh_NcpElems))
integer(pInt) constitutive_Ntexts !allocate(constitutive_state_new(constitutive_Nstatevars,constitutive_maxNgrains,mesh_maxNips,mesh_NcpElems))
! NB: Number of textures (read in material file) !state_tauc_slip_old = 0.0_pReal
integer(pInt), allocatable :: constitutive_crystal_structure(:) !state_tauc_slip_new = 0.0_pReal
! NB: crystal_structure(number of material)=1-3
integer(pInt), allocatable :: constitutive_Nslip(:) ! *** Transformation to get the MARC order ***
! NB: Number of systems for each material ! *** 11,22,33,12,23,13 ***
integer(pInt) constitutive_Nslip_max(3) ! MISSING this should be outsourced to FEM-spec
! NB: Number of defines slip systems
integer(pInt), allocatable :: constitutive_Ngrains(:) !temp=Cslip_66(4,:)
! NB: Ngrains(number of texture) !Cslip_66(4,:)=Cslip_66(6,:)
!Cslip_66(6,:)=Cslip_66(5,:)
!* Real * !Cslip_66(5,:)=temp
real(pReal), allocatable :: constitutive_C11(:) !temp=Cslip_66(:,4)
real(pReal), allocatable :: constitutive_C12(:) !Cslip_66(:,4)=2.0d0*Cslip_66(:,6)
real(pReal), allocatable :: constitutive_C13(:) !Cslip_66(:,6)=2.0d0*Cslip_66(:,5)
real(pReal), allocatable :: constitutive_C33(:) !Cslip_66(:,5)=2.0d0*temp
real(pReal), allocatable :: constitutive_C44(:)
real(pReal), allocatable :: constitutive_Cslip_66(:,:,:)
! NB: Cslip_66(1:6,1:6,number of materials) !***********************************************
real(pReal), allocatable :: constitutive_s0_slip(:) !* Definition of crystal structures properties *
real(pReal), allocatable :: constitutive_gdot0_slip(:) !***********************************************
real(pReal), allocatable :: constitutive_n_slip(:) !* Number of crystal structures (1-FCC,2-BCC,3-HCP)
real(pReal), allocatable :: constitutive_h0(:) integer(pInt), parameter :: constitutive_MaxCrystalStructure = 3
real(pReal), allocatable :: constitutive_s_sat(:) !* Total number of slip systems per crystal structure
real(pReal), allocatable :: constitutive_w0(:) !* (as to be changed according the definition of slip systems)
! NB: Parameters(number of materials) integer(pInt), dimension(constitutive_MaxCrystalStructure), parameter :: constitutive_MaxNslipOfStructure = &
real(pReal), allocatable :: constitutive_hardening_matrix(:,:,:) reshape((/12,48,12/),(/constitutive_MaxCrystalStructure/))
! NB: hardening_matrix(48,48,3) !* Maximum number of slip systems over crystal structures
real(pReal), parameter :: constitutive_latent_hardening=1.4_pReal integer(pInt), parameter :: constitutive_MaxMaxNslipOfStructure = 48
real(pReal) constitutive_sn(3,48,3),constitutive_sd(3,48,3) !* Slip direction, slip normales and Schmid matrices
! NB: slip normale and slip direction for 3 crystal structures real(pReal), dimension(3,3,constitutive_MaxMaxNslipOfStructure,constitutive_MaxCrystalStructure) :: constitutive_Sslip
! Is 48 always the maximum number of systems? real(pReal), dimension(6,constitutive_MaxMaxNslipOfStructure,constitutive_MaxCrystalStructure) :: constitutive_Sslip_v
real(pReal) constitutive_Sslip(3,3,48,3),constitutive_Sslip_v(6,48,3) real(pReal), dimension(3,constitutive_MaxMaxNslipOfStructure,constitutive_MaxCrystalStructure) :: constitutive_sn
! NB: Schmid matrices and corresponding Schmid vectors real(pReal), dimension(3,constitutive_MaxMaxNslipOfStructure,constitutive_MaxCrystalStructure) :: constitutive_sd
!*** Slip systems for FCC structures (1) *** !*** Slip systems for FCC structures (1) ***
data constitutive_Nslip_max(1)/12/
!* System {111}<110> Sort according Eisenlohr&Hantcherli !* System {111}<110> Sort according Eisenlohr&Hantcherli
data constitutive_sd(:, 1,1)/ 0, 1,-1/ ; data constitutive_sn(:, 1,1)/ 1, 1, 1/ data constitutive_sd(:, 1,1)/ 0, 1,-1/ ; data constitutive_sn(:, 1,1)/ 1, 1, 1/
data constitutive_sd(:, 2,1)/-1, 0, 1/ ; data constitutive_sn(:, 2,1)/ 1, 1, 1/ data constitutive_sd(:, 2,1)/-1, 0, 1/ ; data constitutive_sn(:, 2,1)/ 1, 1, 1/
@ -79,7 +70,6 @@ data constitutive_sd(:,11,1)/ 1, 0,-1/ ; data constitutive_sn(:,11,1)/-1, 1,-1/
data constitutive_sd(:,12,1)/-1,-1, 0/ ; data constitutive_sn(:,12,1)/-1, 1,-1/ data constitutive_sd(:,12,1)/-1,-1, 0/ ; data constitutive_sn(:,12,1)/-1, 1,-1/
!*** Slip systems for BCC structures (2) *** !*** Slip systems for BCC structures (2) ***
data constitutive_Nslip_max(2)/48/
!* System {110}<111> !* System {110}<111>
!* Sort? !* Sort?
data constitutive_sd(:, 1,2)/ 1,-1, 1/ ; data constitutive_sn(:, 1,2)/ 0, 1, 1/ data constitutive_sd(:, 1,2)/ 1,-1, 1/ ; data constitutive_sn(:, 1,2)/ 0, 1, 1/
@ -136,7 +126,6 @@ data constitutive_sd(:,47,2)/ 1, 1,-1/ ; data constitutive_sn(:,47,2)/ 3,-2, 1/
data constitutive_sd(:,48,2)/ 1,-1, 1/ ; data constitutive_sn(:,48,2)/ 3, 2,-1/ data constitutive_sd(:,48,2)/ 1,-1, 1/ ; data constitutive_sn(:,48,2)/ 3, 2,-1/
!*** Slip systems for HCP structures (3) *** !*** Slip systems for HCP structures (3) ***
data constitutive_Nslip_max(3)/12/
!* Basal systems {0001}<1120> (independent of c/a-ratio) !* Basal systems {0001}<1120> (independent of c/a-ratio)
!* 1- (0 0 0 1)[-2 1 1 0] !* 1- (0 0 0 1)[-2 1 1 0]
!* 2- (0 0 0 1)[ 1 -2 1 0] !* 2- (0 0 0 1)[ 1 -2 1 0]
@ -173,17 +162,64 @@ data constitutive_sd(:,10,3)/-1, 0, 0/ ; data constitutive_sn(:,10,3)/ 1, 0, 1/
data constitutive_sd(:,11,3)/ 0,-1, 0/ ; data constitutive_sn(:,11,3)/-1, 1, 1/ data constitutive_sd(:,11,3)/ 0,-1, 0/ ; data constitutive_sn(:,11,3)/-1, 1, 1/
data constitutive_sd(:,12,3)/ 1, 1, 0/ ; data constitutive_sn(:,12,3)/ 1,-1, 1/ data constitutive_sd(:,12,3)/ 1, 1, 0/ ; data constitutive_sn(:,12,3)/ 1,-1, 1/
!* Slip-slip interactions matrices
!* (defined for the moment as crystal structure property and not as material property)
!* (may be changed in the future)
real(pReal), dimension(constitutive_MaxMaxNslipOfStructure,constitutive_MaxMaxNslipOfStructure,constitutive_MaxCrystalStructure) :: constitutive_hardening_matrix
real(pReal), parameter :: constitutive_latent_hardening=1.4
!*************************************
!* Definition of material properties *
!*************************************
!* Number of materials
integer(pInt) materials_maxN
!* Crystal structure and number of selected slip systems per material
integer(pInt), dimension(:) , allocatable :: materials_CrystalStructure
integer(pInt), dimension(:) , allocatable :: materials_Nslip
!* Maximum number of selected slip systems over materials
integer(pInt), allocatable :: materials_MaxNslip
!* Elastic constants and matrices
real(pReal), dimension(:) , allocatable :: materials_C11
real(pReal), dimension(:) , allocatable :: materials_C12
real(pReal), dimension(:) , allocatable :: materials_C13
real(pReal), dimension(:) , allocatable :: materials_C33
real(pReal), dimension(:) , allocatable :: materials_C44
real(pReal), dimension(:,:,:), allocatable :: materials_Cslip_66
! NB: Cslip_66(1:6,1:6,number of materials)
!* Visco-plastic material parameters
real(pReal), dimension(:) , allocatable :: materials_s0_slip
real(pReal), dimension(:) , allocatable :: materials_gdot0_slip
real(pReal), dimension(:) , allocatable :: materials_n_slip
real(pReal), dimension(:) , allocatable :: materials_h0
real(pReal), dimension(:) , allocatable :: materials_s_sat
real(pReal), dimension(:) , allocatable :: materials_w0
! NB: Parameters(number of materials)
!************************************
!* Definition of texture properties *
!************************************
!* Number of textures
integer(pInt) textures_maxN
!* Textures definition
character(len=80), dimension(:), allocatable :: textures_ODFfile
character(len=80), dimension(:), allocatable :: textures_symmetry
integer(pInt), dimension(:) , allocatable :: textures_Ngrains
! NB: symmetry(number of texture)
CONTAINS CONTAINS
!**************************************** !****************************************
!* - constitutive_init * !* - constitutive_init
!* - constitutive_calc_SchmidM * !* - constitutive_SchmidMatrices
!* - constitutive_calc_HardeningM * !* - constitutive_HardeningMatrices
!* - constitutive_parse_MatTexDat * !* - constitutive_CountSections
!* - constitutive_calc_SlipRates * !* - constitutive_Parse_UnknownPart
!* - constitutive_calc_Hardening * !* - constitutive_Parse_MaterialPart
!* - consistutive_calc_PlasVeloGradient * !* - constitutive_Parse_TexturePart
!* - CPFEM_CauchyStress??????? * !* - constitutive_Parse_MatTexDat
!* - constitutive_Lp
!* - constitutive_TangentLp
!* - consistutive_DotState
!**************************************** !****************************************
@ -191,13 +227,13 @@ subroutine constitutive_init()
!************************************** !**************************************
!* Module initialization * !* Module initialization *
!************************************** !**************************************
call constitutive_calc_SchmidM() call constitutive_calc_SchmidMatrices()
call constitutive_calc_hardeningM() call constitutive_calc_HardeningMatrices()
call constitutive_parse_MatTexDat('materials_textures.mpie') call constitutive_parse_MatTexDat('materials_textures.mpie')
end subroutine end subroutine
subroutine constitutive_calc_SchmidM() subroutine constitutive_SchmidMatrices()
!************************************** !**************************************
!* Calculation of Schmid matrices * !* Calculation of Schmid matrices *
!************************************** !**************************************
@ -211,7 +247,7 @@ real(pReal) invNorm
!* Iteration over the crystal structures !* Iteration over the crystal structures
do l=1,3 do l=1,3
!* Iteration over the systems !* Iteration over the systems
do k=1,constitutive_Nslip_max(l) do k=1,constitutive_MaxNslipOfStructure(l)
!* Defintion of Schmid matrix !* Defintion of Schmid matrix
forall (i=1:3,j=1:3) forall (i=1:3,j=1:3)
constitutive_Sslip(i,j,k,l)=constitutive_sd(i,k,l)*constitutive_sn(j,k,l) constitutive_Sslip(i,j,k,l)=constitutive_sd(i,k,l)*constitutive_sn(j,k,l)
@ -233,7 +269,7 @@ enddo
end subroutine end subroutine
subroutine constitutive_calc_HardeningM() subroutine constitutive_HardeningMatrices()
!**************************************** !****************************************
!* Hardening matrix (see Kalidindi) * !* Hardening matrix (see Kalidindi) *
!**************************************** !****************************************
@ -279,230 +315,250 @@ enddo
end subroutine end subroutine
!*********************************************************** subroutine constitutive_CountSections(file,count,part)
!*********************************************************** !*********************************************************************
SUBROUTINE constitutive_countSections(file,count,part) !* This subroutine reads a "part" from the input file until the next *
!* part is reached and counts the number of "sections" in the part *
!* INPUT: *
!* - file : file ID *
!* OUTPUT: *
!* - part : name of the next "part" *
!* - count : number of sections inside the current "part" *
!*********************************************************************
use prec, only: pInt use prec, only: pInt
use IO, only: IO_stringPos,IO_stringValue,IO_lc use IO, only: IO_stringPos,IO_stringValue,IO_lc
implicit none implicit none
!* Definition of variables
character(len=80) part,line,tag
integer(pInt) file,count,pos integer(pInt) file,count,pos
integer(pInt), dimension(3) :: positions integer(pInt), dimension(3) :: positions
character(len=80) part,line,tag
count = 0 count=0
part = '' part=''
do while(.true.)
do read(unit=file,fmt='(a80)',END=100) line
read(unit=file,fmt='(a80)',end=100) line positions=IO_stringPos(line,1)
positions = IO_stringPos(line,1) tag=IO_lc(IO_stringValue(line,positions,1))
tag = IO_lc(IO_stringValue(line,positions,1)) if (tag(1:1)=='<' .and. tag(len(tag):len(tag)=='>') then
if (tag(1:1)=='<' .and. tag(len(tag):len(tag)=='>') then part=tag(2:len(tag)-1)
part = tag(2:len(tag)-1) exit
exit elseif (tag(1:1)=='[' .and. tag(len(tag):len(tag)==']') then
elseif (tag(1:1)=='[' .and. tag(len(tag):len(tag)==']') then count=count+1
count = count+1 endif
endif enddo
end do
100 return 100 return
END SUBROUTINE end subroutine
!*********************************************************** character(len=80) function constitutive_Parse_UnknownPart(file)
!*********************************************************** !*********************************************************************
character(len=80) function constitutive_parse_unknownPart(file) !* This function reads a unknown "part" from the input file until *
!* the next part is reached *
!* INPUT: *
!* - file : file ID *
!*********************************************************************
use prec, only: pInt use prec, only: pInt
use IO, only: IO_stringPos,IO_stringValue,IO_lc use IO, only: IO_stringPos,IO_stringValue,IO_lc
implicit none implicit none
!* Definition of variables
character(len=80) line,tag
integer(pInt), parameter :: maxNchunks = 1 integer(pInt), parameter :: maxNchunks = 1
integer(pInt) file integer(pInt) file
integer(pInt), dimension(1+2*maxNchunks) :: positions integer(pInt), dimension(1+2*maxNchunks) :: positions
character(len=80) line,tag
constitutive_parse_unknownPart = '' constitutive_parse_unknownPart = ''
do while(.true.)
do read(unit=file,fmt='(a80)',end=100) line
read(unit=file,fmt='(a80)',end=100) line positions = IO_stringPos(line,maxNchunks)
positions = IO_stringPos(line,maxNchunks) tag = IO_lc(IO_stringValue(line,positions,1))
tag = IO_lc(IO_stringValue(line,positions,1)) if (tag(1:1)=='<' .and. tag(len(tag):len(tag)=='>') then
if (tag(1:1)=='<' .and. tag(len(tag):len(tag)=='>') then constitutive_parse_unknownPart = tag(2:len(tag)-1)
constitutive_parse_unknownPart = tag(2:len(tag)-1) exit
exit endif
endif enddo
end do
100 return 100 return
END FUNCTION end function
!*********************************************************** character(len=80) function constitutive_Parse_MaterialPart(file)
!*********************************************************** !*********************************************************************
character(len=80) function constitutive_parse_materialPart(file) !* This function reads a material "part" from the input file until *
!* the next part is reached *
!* INPUT: *
!* - file : file ID *
!*********************************************************************
use prec, only: pInt use prec, only: pInt
use IO, only: IO_stringPos,IO_stringValue,IO_lc use IO, only: IO_stringPos,IO_stringValue,IO_lc
implicit none implicit none
!* Definition of variables
character(len=80) line,tag
integer(pInt), parameter :: maxNchunks = 2! may be more than 2 chunks ..? integer(pInt), parameter :: maxNchunks = 2! may be more than 2 chunks ..?
integer(pInt) file,section integer(pInt) file,section
integer(pInt), dimension(1+2*maxNchunks) :: positions integer(pInt), dimension(1+2*maxNchunks) :: positions
character(len=80) line,tag
section = 0 section = 0
constitutive_parse_materialPart = '' constitutive_parse_materialPart = ''
do do while(.true.)
read(unit=file,fmt='(a80)',end=100) line read(unit=file,fmt='(a80)',end=100) line
positions = IO_stringPos(line,maxNchunks) ! parse leading chunks positions = IO_stringPos(line,maxNchunks) ! parse leading chunks
tag = IO_lc(IO_stringValue(line,positions,1)) tag = IO_lc(IO_stringValue(line,positions,1))
if (tag(1:1)=='#') then ! skip comment line if (tag(1:1)=='#') then ! skip comment line
cycle cycle
elseif (tag(1:1)=='<' .and. tag(len(tag):len(tag)=='>') then elseif (tag(1:1)=='<' .and. tag(len(tag):len(tag)=='>') then
constitutive_parse_materialPart = tag(2:len(tag)-1) constitutive_parse_materialPart = tag(2:len(tag)-1)
exit exit
elseif (tag(1:1)=='[' .and. tag(len(tag):len(tag)==']') then elseif (tag(1:1)=='[' .and. tag(len(tag):len(tag)==']') then
section = section+1 section = section+1
else else
if (section>0) then if (section>0) then
select case(tag) select case(tag)
case ('crystal_structure') ! crystal structure case ('crystal_structure')
constitutive_crystal_structure(section)=IO_intValue(line,positions,2) materials_CrystalStructure(section)=IO_intValue(line,positions,2)
case ('nslip') case ('nslip')
constitutive_Nslip(section)=IO_intValue(line,positions,2) materials_Nslip(section)=IO_intValue(line,positions,2)
case ('C11') case ('C11')
constitutive_C11(section)=IO_floatValue(line,positions,2) materials_C11(section)=IO_floatValue(line,positions,2)
case ('C12') case ('C12')
constitutive_C12(section)=IO_floatValue(line,positions,2) materials_C12(section)=IO_floatValue(line,positions,2)
case ('C13') case ('C13')
constitutive_C13(section)=IO_floatValue(line,positions,2) materials_C13(section)=IO_floatValue(line,positions,2)
case ('C33') case ('C33')
constitutive_C33(section)=IO_floatValue(line,positions,2) materials_C33(section)=IO_floatValue(line,positions,2)
case ('C44') case ('C44')
constitutive_C44(section)=IO_floatValue(line,positions,2) materials_C44(section)=IO_floatValue(line,positions,2)
case ('s0_slip') case ('s0_slip')
constitutive_s0_slip(section)=IO_floatValue(line,positions,2) materials_s0_slip(section)=IO_floatValue(line,positions,2)
case ('gdot0_slip') case ('gdot0_slip')
constitutive_gdot0_slip(section)=IO_floatValue(line,positions,2) materials_gdot0_slip(section)=IO_floatValue(line,positions,2)
case ('n_slip') case ('n_slip')
constitutive_n_slip(section)=IO_floatValue(line,positions,2) materials_n_slip(section)=IO_floatValue(line,positions,2)
case ('h0') case ('h0')
constitutive_h0(section)=IO_floatValue(line,positions,2) materials_h0(section)=IO_floatValue(line,positions,2)
case ('s_sat') case ('s_sat')
constitutive_s_sat(section)=IO_floatValue(line,positions,2) materials_s_sat(section)=IO_floatValue(line,positions,2)
case ('w0') case ('w0')
constitutive_w0(section)=IO_floatValue(line,positions,2) materials_w0(section)=IO_floatValue(line,positions,2)
case default case default
write(6,*) 'Unknown material parameter ',line write(6,*) 'Unknown material parameter ',line
end select end select
endif endif
endif endif
end do enddo
100 return 100 return
END FUNCTION end function
!*********************************************************** character(len=80) function constitutive_Parse_TexturePart(file)
!*********************************************************** !*********************************************************************
character(len=80) function constitutive_parse_texturePart(file) !* This function reads a texture "part" from the input file until *
!* the next part is reached *
!* INPUT: *
!* - file : file ID *
!*********************************************************************
use prec, only: pInt use prec, only: pInt
use IO, only: IO_stringPos,IO_stringValue,IO_lc use IO, only: IO_stringPos,IO_stringValue,IO_lc
implicit none implicit none
!* Definition of variables
character(len=80) line,tag
integer(pInt), parameter :: maxNchunks = 10 ! may be more than 10 chunks ..? integer(pInt), parameter :: maxNchunks = 10 ! may be more than 10 chunks ..?
integer(pInt) file,pos,section integer(pInt) file,pos,section
integer(pInt), dimension(1+2*maxNchunks) :: positions integer(pInt), dimension(1+2*maxNchunks) :: positions
character(len=80) line,tag
section = 0 section = 0
constitutive_parse_texturePart = '' constitutive_parse_texturePart = ''
do do while(.true.)
read(unit=file,fmt='(a80)',end=100) line read(unit=file,fmt='(a80)',end=100) line
positions = IO_stringPos(line,maxNchunks) ! parse leading chunks positions = IO_stringPos(line,maxNchunks) ! parse leading chunks
tag = IO_lc(IO_stringValue(line,positions,1)) tag = IO_lc(IO_stringValue(line,positions,1))
if (tag(1:1)=='#') then ! skip comment line if (tag(1:1)=='#') then ! skip comment line
cycle cycle
elseif (tag(1:1)=='<' .and. tag(len(tag):len(tag)=='>') then elseif (tag(1:1)=='<' .and. tag(len(tag):len(tag)=='>') then
constitutive_parse_texturePart = tag(2:len(tag)-1) constitutive_parse_texturePart = tag(2:len(tag)-1)
exit exit
elseif (tag(1:1)=='[' .and. tag(len(tag):len(tag)==']') then elseif (tag(1:1)=='[' .and. tag(len(tag):len(tag)==']') then
section = section+1 section = section+1
else else
if (section>0) then if (section>0) then
select case(tag) select case(tag)
case ('hybridIA') case ('hybridIA')
constitutive_ODFfile(section)=IO_stringValue(line,positions,2) textures_ODFfile(section)=IO_stringValue(line,positions,2)
case ('gauss') case ('gauss')
case ('fiber')
case ('ngrains')
constitutive_Ngrains(section)=IO_intValue(line,positions,2)
case ('symmetry')
constitutive_symmetry(section)=IO_stringValue(line,positions,2)
case default
write(6,*) 'Unknown texture parameter ',line
end select
endif
endif
end do
case ('fiber')
case ('ngrains')
textures_Ngrains(section)=IO_intValue(line,positions,2)
case ('symmetry')
textures_symmetry(section)=IO_stringValue(line,positions,2)
case default
write(6,*) 'Unknown texture parameter ',line
end select
endif
endif
enddo
100 return 100 return
END FUNCTION end function
subroutine constitutive_Parse_MatTexDat(filename)
subroutine constitutive_parse_MatTexDat(filename) !*********************************************************************
!*********************************************************** !* This function reads the material and texture input file *
!* Reading material parameters and texture components file * !* INPUT: *
!*********************************************************** !* - filename : name of input file *
!*********************************************************************
use prec, only: pReal,pInt use prec, only: pReal,pInt
use IO use IO
implicit none implicit none
!* Definition of variables
character(len=*) filename character(len=*) filename
character(len=80) part,formerPart character(len=80) part,formerPart
integer(pInt) sectionCount,i,j,m integer(pInt) sectionCount,i,j,m
!* Open input file
open(200,FILE=filename,ACTION='READ',STATUS='OLD',ERR=100) open(200,FILE=filename,ACTION='READ',STATUS='OLD',ERR=100)
!* First reading: number of materials and textures
!* Arrays allocation
part = '_dummy_' part = '_dummy_'
do while (part/='') do while (part/='')
formerPart = part formerPart = part
call constitutive_countSections(200,sectionCount,part) call constitutive_countSections(200,sectionCount,part)
select case (formerPart) select case (formerPart)
case ('materials') case ('materials')
materials_maxN = sectionCount materials_maxN = sectionCount
case ('textures') case ('textures')
textures_maxN = sectionCount textures_maxN = sectionCount
end select end select
end do enddo
allocate(textures_ODFfile(textures_maxN)) ; textures_ODFfile=''
allocate(constitutive_ODFfile(constitutive_Ntexts)) ; constitutive_ODFfile='' allocate(textures_Ngrains(textures_maxN)) ; textures_Ngrains=0_pInt
allocate(constitutive_Ngrains(constitutive_Ntexts)) ; constitutive_Ngrains=0_pInt allocate(textures_symmetry(textures_maxN)) ; textures_symmetry=''
allocate(constitutive_symmetry(constitutive_Ntexts)) ; constitutive_symmetry='' allocate(materials_CrystalStructure(materials_maxN)) ; materials_CrystalStructure=0_pInt
allocate(constitutive_crystal_structure(constitutive_Nmats)) ; constitutive_crystal_structure=0_pInt allocate(materials_Nslip(materials_maxN)) ; materials_Nslip=0_pInt
allocate(constitutive_Nslip(constitutive_Nmats)) ; constitutive_Nslip=0_pInt allocate(materials_C11(materials_maxN)) ; materials_C11=0.0_pReal
allocate(constitutive_C11(constitutive_Nmats)) ; constitutive_C11=0.0_pReal allocate(materials_C12(materials_maxN)) ; materials_C12=0.0_pReal
allocate(constitutive_C12(constitutive_Nmats)) ; constitutive_C12=0.0_pReal allocate(materials_C13(materials_maxN)) ; materials_C13=0.0_pReal
allocate(constitutive_C13(constitutive_Nmats)) ; constitutive_C13=0.0_pReal allocate(materials_C33(materials_maxN)) ; materials_C33=0.0_pReal
allocate(constitutive_C33(constitutive_Nmats)) ; constitutive_C33=0.0_pReal allocate(materials_C44(materials_maxN)) ; materials_C44=0.0_pReal
allocate(constitutive_C44(constitutive_Nmats)) ; constitutive_C44=0.0_pReal allocate(materials_s0_slip(materials_maxN)) ; materials_s0_slip=0.0_pReal
allocate(constitutive_s0_slip(constitutive_Nmats)) ; constitutive_s0_slip=0.0_pReal allocate(materials_gdot0_slip(materials_maxN)) ; materials_gdot0_slip=0.0_pReal
allocate(constitutive_gdot0_slip(constitutive_Nmats)) ; constitutive_gdot0_slip=0.0_pReal allocate(materials_n_slip(materials_maxN)) ; materials_n_slip=0.0_pReal
allocate(constitutive_n_slip(constitutive_Nmats)) ; constitutive_n_slip=0.0_pReal allocate(materials_h0(materials_maxN)) ; materials_h0=0.0_pReal
allocate(constitutive_h0(constitutive_Nmats)) ; constitutive_h0=0.0_pReal allocate(materials_s_sat(materials_maxN)) ; materials_s_sat=0.0_pReal
allocate(constitutive_s_sat(constitutive_Nmats)) ; constitutive_s_sat=0.0_pReal allocate(materials_w0(materials_maxN)) ; materials_w0=0.0_pReal
allocate(constitutive_w0(constitutive_Nmats)) ; constitutive_w0=0.0_pReal
!* Second reading: materials and textures are stored
part = '_dummy_' part = '_dummy_'
do while (part/='') do while (part/='')
select case (part) select case (part)
@ -514,6 +570,7 @@ do while (part/='')
part = constitutive_parse_unknownPart(200) part = constitutive_parse_unknownPart(200)
end select end select
end do end do
!* Close input file
close(200) close(200)
@ -540,18 +597,6 @@ do m=1,material_maxN
material_Cslip_3333(:,:,:,:,m) = math_66to3333(Cslip_66(:,:,m)) material_Cslip_3333(:,:,:,:,m) = math_66to3333(Cslip_66(:,:,m))
end do end do
! *** Transformation to get the MARC order ***
! *** 11,22,33,12,23,13 ***
! MISSING this should be outsourced to FEM-spec
temp=Cslip_66(4,:)
Cslip_66(4,:)=Cslip_66(6,:)
Cslip_66(6,:)=Cslip_66(5,:)
Cslip_66(5,:)=temp
temp=Cslip_66(:,4)
Cslip_66(:,4)=2.0d0*Cslip_66(:,6)
Cslip_66(:,6)=2.0d0*Cslip_66(:,5)
Cslip_66(:,5)=2.0d0*temp
! MISSING some consistency checks may be..? ! MISSING some consistency checks may be..?
@ -560,129 +605,102 @@ return
end subroutine end subroutine
subroutine constitutive_calc_SlipRates(matID,tau_slip,tauc_slip,gdot_slip,dgdot_dtaucslip) real(pReal) function constitutive_Lp(Tstar_v,ipc,ip,el)
!********************************************************************* !*********************************************************************
!* This subroutine contains the constitutive equation for the slip * !* This subroutine contains the constitutive equation for *
!* rate on each slip system * !* calculating the velocity gradient *
!* INPUT: * !* INPUT: *
!* - matID : material identifier * !* - Tstar_v : 2nd Piola Kirchhoff stress tensor *
!* - tau_slip : applied shear stress on each slip system * !* - ipc : component-ID of current integration point *
!* - tauc_slip : critical shear stress on each slip system * !* - ip : current integration point *
!* OUTPUT: * !* - el : current element *
!* - gdot_slip : slip rate on each slip system *
!* - dgdot_dtaucslip : derivative of slip rate on each slip system *
!********************************************************************* !*********************************************************************
use prec, only: pReal,pInt use prec, only: pReal,pInt
implicit none implicit none
!* Definition of variables !* Definition of variables
integer(pInt) matID,i !integer(pInt) matID,i
real(pReal) tau_slip(constitutive_Nslip(matID)) !real(pReal) tau_slip(constitutive_Nslip(matID))
real(pReal) tauc_slip(constitutive_Nslip(matID)) !real(pReal) tauc_slip(constitutive_Nslip(matID))
real(pReal) gdot_slip(constitutive_Nslip(matID)) !real(pReal) gdot_slip(constitutive_Nslip(matID))
real(pReal) dgdot_dtaucslip(constitutive_Nslip(matID)) !real(pReal) dgdot_dtaucslip(constitutive_Nslip(matID))
!* Iteration over the systems !* Iteration over the systems
do i=1,constitutive_Nslip(matID) !do i=1,constitutive_Nslip(matID)
gdot_slip(i)=constitutive_gdot0_slip(matID)*(abs(tau_slip(i))/tauc_slip(i))**constitutive_n_slip(matID)*sign(1.0_pReal,tau_slip(i)) ! gdot_slip(i)=constitutive_gdot0_slip(matID)*(abs(tau_slip(i))/tauc_slip(i))**constitutive_n_slip(matID)*sign(1.0_pReal,tau_slip(i))
dgdot_dtaucslip(i)=constitutive_gdot0_slip(matID)*(abs(tau_slip(i))/tauc_slip(i))**(constitutive_n_slip(matID)-1.0_pReal)*constitutive_n_slip(matID)/tauc_slip(i) ! dgdot_dtaucslip(i)=constitutive_gdot0_slip(matID)*(abs(tau_slip(i))/tauc_slip(i))**(constitutive_n_slip(matID)-1.0_pReal)*constitutive_n_slip(matID)/tauc_slip(i)
enddo !enddo
return return
end subroutine end function
subroutine constitutive_calc_Hardening(matID,tauc_slip,gdot_slip,dtauc_slip) subroutine constitutive_TangentLp(Tstar_v,ipc,ip,el,dLp_dTstar,dLpT_dTstar)
!********************************************************************* !*********************************************************************
!* This subroutine calculates the increment in critical shear stress * !* This subroutine contains the constitutive equation for *
!* due to plastic deformation on each slip system * !* calculating the velocity gradient *
!* INPUT: * !* INPUT: *
!* - matID : material identifier * !* - Tstar_v : 2nd Piola Kirchhoff stress tensor *
!* - tauc_slip : critical shear stress on each slip system * !* - ipc : component-ID of current integration point *
!* - gdot_slip : slip rate on each slip system * !* - ip : current integration point *
!* - el : current element *
!* OUTPUT: * !* OUTPUT: *
!* - dtauc_slip : increment of hardening due to slip on each system * !* - dLp_dTstar : derivative of Lp *
!* - dLpT_dTstar : derivative of tranposed Lp *
!********************************************************************* !*********************************************************************
use prec, only: pReal,pInt use prec, only: pReal,pInt
implicit none implicit none
!* Definition of variables !* Definition of variables
integer(pInt) matID,i,j !integer(pInt) matID,i,j
real(pReal) tauc_slip(constitutive_Nslip(matID)) !real(pReal) tauc_slip(constitutive_Nslip(matID))
real(pReal) gdot_slip(constitutive_Nslip(matID)) !real(pReal) gdot_slip(constitutive_Nslip(matID))
real(pReal) dtauc_slip(constitutive_Nslip(matID)) !real(pReal) dtauc_slip(constitutive_Nslip(matID))
real(pReal) self_hardening(constitutive_Nslip(matID)) !real(pReal) self_hardening(constitutive_Nslip(matID))
!* Self-Hardening of each system !* Self-Hardening of each system
do i=1,constitutive_Nslip(matID) !do i=1,constitutive_Nslip(matID)
self_hardening(i)=constitutive_h0(matID)*(1.0_pReal-tauc_slip(i)/constitutive_s_sat(matID))**constitutive_w0(matID)*abs(gdot_slip(i)) ! self_hardening(i)=constitutive_h0(matID)*(1.0_pReal-tauc_slip(i)/constitutive_s_sat(matID))**constitutive_w0(matID)*abs(gdot_slip(i))
enddo !enddo
!* Hardening for all systems !* Hardening for all systems
i=constitutive_Nslip(matID) !i=constitutive_Nslip(matID)
j=constitutive_crystal_structure(matID) !j=constitutive_crystal_structure(matID)
dtauc_slip=matmul(constitutive_hardening_matrix(1:i,1:i,j),self_hardening) !dtauc_slip=matmul(constitutive_hardening_matrix(1:i,1:i,j),self_hardening)
return return
end subroutine end subroutine
subroutine constitutive_calc_PlasVeloGradient(dt,tau_slip,tauc_slip_new,Lp) real(pReal) function constitutive_DotState(Tstar_v,ipc,ip,el)
!********************************************************************* !*********************************************************************
!* This subroutine calculates the plastic velocity gradient given * !* This subroutine contains the constitutive equation for *
!* the slip rates * !* calculating the velocity gradient *
!* INPUT: * !* INPUT: *
!* - matID : material identifier * !* - Tstar_v : 2nd Piola Kirchhoff stress tensor *
!* - dt : time step * !* - ipc : component-ID of current integration point *
!* - tau_slip : applied shear stress on each slip system * !* - ip : current integration point *
!* - tauc_slip : critical shear stress on each slip system * !* - el : current element *
!* OUTPUT: *
!* - Lp : plastic velocity gradient *
!********************************************************************* !*********************************************************************
use prec, only: pReal,pInt use prec, only: pReal,pInt
implicit none implicit none
!* Definition of variables !* Definition of variables
integer(pInt) matID,i !integer(pInt) matID,i
real(pReal) dt,Lp(3,3) !real(pReal) dt,Lp(3,3)
real(pReal) tau_slip(constitutive_Nslip(matID)) !real(pReal) tau_slip(constitutive_Nslip(matID))
real(pReal) tauc_slip_new(constitutive_Nslip(matID)) !real(pReal) tauc_slip_new(constitutive_Nslip(matID))
real(pReal) gdot_slip(constitutive_Nslip(matID)) !real(pReal) gdot_slip(constitutive_Nslip(matID))
!* Calculation of Lp !* Calculation of Lp
Lp=0.0_pReal !Lp=0.0_pReal
do i=1,constitutive_Nslip(matID) !do i=1,constitutive_Nslip(matID)
gdot_slip(i)=constitutive_gdot0_slip(matID)*(abs(tau_slip(i))/tauc_slip(i))**constitutive_n_slip(matID)*sign(1.0_pReal,tau_slip(i)) ! gdot_slip(i)=constitutive_gdot0_slip(matID)*(abs(tau_slip(i))/tauc_slip(i))**constitutive_n_slip(matID)*sign(1.0_pReal,tau_slip(i))
Lp=Lp+gdot_slip(i)*constitutive_Sslip(:,:,i,constitutive_crystal_structure(matID)) ! Lp=Lp+gdot_slip(i)*constitutive_Sslip(:,:,i,constitutive_crystal_structure(matID))
enddo !enddo
return return
end subroutine end function
!function CPFEM_Cauchy(Estar_v,Fe,C66)
! ***************************************************************
! Subroutine calculates the cauchy from the elastic strain tensor
! Input: Estar_v : elastic strain tensor (in vector form)
! Fe : elastic deformation gradient
! C66 : Stiffness Tensor
! Output: cs : cauchy stress
! Local: Tstar_v,Tstar,mm,det
! ***************************************************************
!use math
!use prec
!implicit none
!real(pRe) Estar_v(6),Fe(3,3),C66(6,6),CPFEM_Cauchy(6)
!real(pRe) det,mm(3,3),Tstar(3,3)
!integer(pIn) i
!det = math_det(Fe)
!Tstar = math_6to33(matmul(C66,Estar_v))
!mm=matmul(matmul(Fe,Tstar),transpose(Fe))/det
!CPFEM_Cauchy = math_33to6(mm)
!return
!end function
END MODULE END MODULE