FrontISTR  6.0.0
Large-scale structural analysis program with finit element method
material.f90
Go to the documentation of this file.
1 !-------------------------------------------------------------------------------
2 ! Copyright (c) 2019 FrontISTR Commons
3 ! This software is released under the MIT License, see LICENSE.txt
4 !-------------------------------------------------------------------------------
6 module mmaterial
7  use hecmw_util
8  use m_table
9  use table_dicts
10  implicit none
11 
12  ! Following algorithm type
13  integer(kind=kint), parameter :: infinitesimal = 0
14  integer(kind=kint), parameter :: totallag = 1
15  integer(kind=kint), parameter :: updatelag = 2
16 
17  ! Following material types. All material type number consists with integer of six digits.
18  ! First digit: Indicates physical type
19  ! 1: mechanical deformation analysis
20  ! 2: heat conduct analysis
21  ! ......
22  ! Second digit:
23  ! Mechanical analysis
24  ! 1: Elastic
25  ! 2: Elastoplastic
26  ! 3: Hyperelastic
27  ! 4: Viscoelastic
28  ! 5: Viscoplastic
29  ! 6: Incomp newtonian
30  ! 7: Connector(Spring, Dashpot, Joint etc.)
31  ! Heat conductiovity
32  ! ......
33  ! Third digit:
34  ! For elastic or elastoplastic deformation, elastic
35  ! 0: isotropic ie. 110000
36  ! 1: with transever anisotropity 111000
37  ! For hyperelastic deformation
38  ! 0: Neo-Hooke 130000
39  ! 1: Mooney-Rivlin 131000
40  ! 2: Arruda-Boyce 132000
41  ! For spring or dashpot, joint etc.
42  ! 0: spring dof ie. 170000
43  ! 1: spring axial 171000
44  ! 2: dashpot dof 172000
45  ! 3: dashpot axial 173000
46  ! Fourth digit
47  ! For spring_d or dashpot_d, joint_d etc.
48  ! k: number of dof param (1st digit)
49  ! Fifth digit:
50  ! For elastoplastic deformation, hardening law
51  ! 0: Linear hardening i.e. 120000
52  ! 1: Multilinear hardening 120010
53  ! 2: Swift
54  ! 3: Ramberg-Osgood
55  ! 4: linear kinematic
56  ! 5: combined (linear kinematic + linear isotropic)
57  ! For spring_d or dashpot_d, joint_d etc.
58  ! k: number of dof param (2nd digit)
59  ! Six digit:
60  ! For visco-elastoplastic deformation, visco law
61  ! 0: Norton i.e. 150000
62  ! 1: Striab 150001
63  integer(kind=kint), parameter :: usermaterial = 100000
64 
65  integer(kind=kint), parameter :: elastic = 110000
66  integer(kind=kint), parameter :: mn_orthoelastic = 111000
67  integer(kind=kint), parameter :: userelastic = 112000
68 
69  integer(kind=kint), parameter :: eplastic = 120000
70 
71  integer(kind=kint), parameter :: neohooke = 130000
72  integer(kind=kint), parameter :: mooneyrivlin = 131000
73  integer(kind=kint), parameter :: arrudaboyce = 132000
74  integer(kind=kint), parameter :: userhyperelastic = 133000
75  integer(kind=kint), parameter :: mooneyrivlin_aniso = 134000
76 
77  integer(kind=kint), parameter :: viscoelastic = 140000
78  integer(kind=kint), parameter :: norton = 150000
79 
80  integer(kind=kint), parameter :: incomp_newtonian = 160000
81  integer(kind=kint), parameter :: connector = 170000
82 
83  ! Following section type
84  integer(kind=kint), parameter :: d3 = -1
85  integer(kind=kint), parameter :: planestress = 1
86  integer(kind=kint), parameter :: planestrain = 0
87  integer(kind=kint), parameter :: axissymetric = 2
88  integer(kind=kint), parameter :: shell = 3
89 
90  ! Material constants are saved in an array of size 100 and their physical meaning
91  ! correspond to their position in the array
92  integer(kind=kint), parameter :: m_youngs = 1
93  integer(kind=kint), parameter :: m_poisson = 2
94  integer(kind=kint), parameter :: m_density = 3
95 
96  ! following plastic constitutive parameter
97  integer(kind=kint), parameter :: m_plconst1 = 5
98  integer(kind=kint), parameter :: m_plconst2 = 6
99  integer(kind=kint), parameter :: m_plconst3 = 7
100  integer(kind=kint), parameter :: m_plconst4 = 8
101  integer(kind=kint), parameter :: m_plconst5 = 9
102  integer(kind=kint), parameter :: m_kinehard = 10
103 
104  integer(kind=kint), parameter :: m_exapnsion = 20
105 
106  integer(kind=kint), parameter :: m_alpha_over_mu = 21
107 
108  integer(kind=kint), parameter :: m_beam_radius = 22
109  integer(kind=kint), parameter :: m_beam_angle1 = 23
110  integer(kind=kint), parameter :: m_beam_angle2 = 24
111  integer(kind=kint), parameter :: m_beam_angle3 = 25
112  integer(kind=kint), parameter :: m_beam_angle4 = 26
113  integer(kind=kint), parameter :: m_beam_angle5 = 27
114  integer(kind=kint), parameter :: m_beam_angle6 = 28
115 
116  integer(kind=kint), parameter :: m_viscocity = 29
117 
118  ! additional plastic constitutive parameter
119  integer(kind=kint), parameter :: m_plconst6 = 30
120  integer(kind=kint), parameter :: m_plconst7 = 31
121  integer(kind=kint), parameter :: m_plconst8 = 32
122  integer(kind=kint), parameter :: m_plconst9 = 33
123  integer(kind=kint), parameter :: m_plconst10 = 34
124 
125  integer(kind=kint), parameter :: m_damping_rm = 35
126  integer(kind=kint), parameter :: m_damping_rk = 36
127 
128  integer(kind=kint), parameter :: m_spring_dof = 0
129  integer(kind=kint), parameter :: m_spring_axial = 1
130  integer(kind=kint), parameter :: m_dashpot_dof = 2
131  integer(kind=kint), parameter :: m_dashpot_axial = 3
132 
133  integer(kind=kint), parameter :: m_spring_d_ndoffset = 0
134  integer(kind=kint), parameter :: m_spring_a_ndoffset = 72
135  integer(kind=kint), parameter :: m_dashpot_d_ndoffset = 73
136  integer(kind=kint), parameter :: m_dashpot_a_ndoffset = 145
137 
138  ! Dictionary constants
139  character(len=DICT_KEY_LENGTH) :: mc_isoelastic= 'ISOELASTIC' ! youngs modulus, poisson's ratio
140  character(len=DICT_KEY_LENGTH) :: mc_orthoelastic= 'ORTHOELASTIC' ! ortho elastic modulus
141  character(len=DICT_KEY_LENGTH) :: mc_yield = 'YIELD' ! plastic strain, yield stress
142  character(len=DICT_KEY_LENGTH) :: mc_themoexp = 'THEMOEXP' ! thermo expansion coefficient
143  character(len=DICT_KEY_LENGTH) :: mc_orthoexp = 'ORTHOEXP' ! thermo expansion coefficient
144  character(len=DICT_KEY_LENGTH) :: mc_viscoelastic = 'VISCOELASTIC' ! Prony coeff only curr.
145  character(len=DICT_KEY_LENGTH) :: mc_norton = 'NORTON' ! NOrton's creep law
146  character(len=DICT_KEY_LENGTH) :: mc_incomp_newtonian = 'INCOMP_FLUID' ! viscocity
147  character(len=DICT_KEY_LENGTH) :: mc_spring= 'SPRING' ! spring
148  character(len=DICT_KEY_LENGTH) :: mc_dashpot= 'DASHPOT' ! dashpot
149 
151  integer(kind=kint) :: ortho
152  real(kind=kreal) :: ee
153  real(kind=kreal) :: pp
154  real(kind=kreal) :: ee2
155  real(kind=kreal) :: g12
156  real(kind=kreal) :: g23
157  real(kind=kreal) :: g31
158  real(kind=kreal) :: angle
159  real(kind=kreal) :: rho
160  real(kind=kreal) :: alpha
161  real(kind=kreal) :: alpha_over_mu
162  real(kind=kreal) :: weight
163  end type tshellmat
164 
167  integer(kind=kint) :: nlgeom_flag
168  integer(kind=kint) :: mtype
169  integer(kind=kint) :: nfstatus
170  character(len=30) :: name
171  real(kind=kreal) :: variables(200)
172  integer(kind=kint) :: variables_i(200)
173  type(tshellmat), pointer :: shell_var(:) => null()
174  integer(kind=kint) :: totallyr
175  integer(kind=kint) :: cdsys_id
176  integer(kind=kint) :: n_table
177  real(kind=kreal), pointer :: table(:)=>null()
178  type(dict_struct), pointer :: dict
179  logical :: is_elem_rayleigh_damping
180  end type tmaterial
181 
182  type(tmaterial), allocatable :: materials(:)
183 
184 contains
185 
187  subroutine initmaterial( material )
188  type( tmaterial ), intent(inout) :: material
189  material%mtype = -1 ! not defined yet
190  material%nfstatus = 0 ! Default: no status
191  material%nlgeom_flag = infinitesimal ! Default: INFINITESIMAL ANALYSIS
192  material%variables = 0.d0 ! not defined yet
193  material%variables_i = 0 ! not defined yet
194  material%totallyr = 0 ! not defined yet
195  material%is_elem_Rayleigh_damping = .false. ! not defined yet
196 
197  call dict_create( material%dict, 'INIT', dict_null )
198  end subroutine
199 
201  subroutine finalizematerial( material )
202  type( tmaterial ), intent(inout) :: material
203  if( associated(material%table) ) deallocate( material%table )
204  if( associated(material%dict) ) call dict_destroy( material%dict )
205  end subroutine finalizematerial
206 
208  subroutine initializematls( nm )
209  integer, intent(in) :: nm
210  integer :: i
211  if( allocated(materials) ) deallocate( materials )
212  allocate( materials( nm ) )
213  do i=1,nm
214  call initmaterial( materials(i) )
215  enddo
216  end subroutine
217 
219  subroutine finalizematls()
220  integer :: i
221  if( allocated( materials ) ) then
222  do i=1,size(materials)
223  call finalizematerial( materials(i) )
224  enddo
225  deallocate( materials )
226  endif
227  end subroutine
228 
230  integer function fetchdigit( npos, cnum )
231  integer, intent(in) :: npos
232  integer, intent(in) :: cnum
233  integer :: i, idum,cdum,dd
234  fetchdigit = -1
235  cdum = cnum
236  if( npos<=0 .or. npos>6) return
237  if( cnum<100000 .or. cnum>999999 ) return
238  dd = 100000
239  do i=1,npos-1
240  idum = cdum/dd
241  cdum = cdum-idum*dd
242  dd = dd/10
243  enddo
244  fetchdigit = cdum/10**(6-npos)
245  end function
246 
248  subroutine setdigit( npos, ival, mtype )
249  integer, intent(in) :: npos
250  integer, intent(in) :: ival
251  integer, intent(inout) :: mtype
252  integer :: i, idum,cdum, cdum1, dd
253  cdum = mtype
254  if( npos<=0 .or. npos>6 ) return
255  if( ival<0 .or. ival>9 ) return
256  dd =100000
257  cdum1 = 0
258  do i=1,npos-1
259  idum = cdum/dd
260  cdum1 = cdum1+ idum*dd
261  cdum = cdum-idum*dd
262  dd=dd/10
263  enddo
264  cdum1 = cdum1 + ival*dd
265  idum = cdum/dd
266  cdum = cdum-idum*dd
267  dd=dd/10
268  do i=npos+1,6
269  idum = cdum/dd
270  cdum1 = cdum1+ idum*dd
271  cdum = cdum-idum*dd
272  dd=dd/10
273  enddo
274  mtype = cdum1
275  end subroutine
276 
278  integer function getelastictype( mtype )
279  integer, intent(in) :: mtype
280  integer :: itype
281  getelastictype = -1
282  itype = fetchdigit( 1, mtype )
283  if( itype/=1 ) return ! not defomration problem
284  itype = fetchdigit( 2, mtype )
285  if( itype/=1 .and. itype/=2 ) return ! not defomration problem
286  getelastictype = fetchdigit( 3, mtype )
287  end function
288 
290  integer function getyieldfunction( mtype )
291  integer, intent(in) :: mtype
292  integer :: itype
293  getyieldfunction = -1
294  itype = fetchdigit( 1, mtype )
295  if( itype/=1 ) return ! not defomration problem
296  itype = fetchdigit( 2, mtype )
297  if( itype/=2 ) return ! not elstoplastic problem
298  getyieldfunction = fetchdigit( 4, mtype )
299  end function
300 
302  integer function gethardentype( mtype )
303  integer, intent(in) :: mtype
304  integer :: itype
305  gethardentype = -1
306  itype = fetchdigit( 1, mtype )
307  if( itype/=1 ) return ! not defomration problem
308  itype = fetchdigit( 2, mtype )
309  if( itype/=2 ) return ! not elstoplastic problem
310  gethardentype = fetchdigit( 5, mtype )
311  end function
312 
314  logical function iskinematicharden( mtype )
315  integer, intent(in) :: mtype
316  integer :: itype
317  iskinematicharden = .false.
318  itype = fetchdigit( 5, mtype )
319  if( itype==4 .or. itype==5 ) iskinematicharden = .true.
320  end function
321 
323  logical function iselastic( mtype )
324  integer, intent(in) :: mtype
325  integer :: itype
326  iselastic = .false.
327  itype = fetchdigit( 2, mtype )
328  if( itype==1 ) iselastic = .true.
329  end function
330 
332  logical function iselastoplastic( mtype )
333  integer, intent(in) :: mtype
334  integer :: itype
335  iselastoplastic = .false.
336  itype = fetchdigit( 2, mtype )
337  if( itype==2 ) iselastoplastic = .true.
338  end function
339 
341  logical function ishyperelastic( mtype )
342  integer, intent(in) :: mtype
343  integer :: itype
344  ishyperelastic = .false.
345  itype = fetchdigit( 2, mtype )
346  if( itype==3 ) ishyperelastic = .true.
347  end function
348 
350  logical function isviscoelastic( mtype )
351  integer, intent(in) :: mtype
352  integer :: itype
353  isviscoelastic = .false.
354  itype = fetchdigit( 2, mtype )
355  if( itype==4 ) isviscoelastic = .true.
356  end function
357 
359  subroutine ep2e( mtype )
360  integer, intent(inout) :: mtype
361  if( .not. iselastoplastic( mtype ) ) return
362  call setdigit( 2, 1, mtype )
363  end subroutine
364 
366  integer function getconnectortype( mtype )
367  integer, intent(in) :: mtype
368  integer :: itype
369  getconnectortype = -1
370  itype = fetchdigit( 1, mtype )
371  if( itype/=1 ) return ! not defomration problem
372  itype = fetchdigit( 2, mtype )
373  if( itype/=7 ) return ! not connector
374  getconnectortype = fetchdigit( 3, mtype )
375  end function
376 
378  integer function getnumofspring_dparam( material )
379  type( tmaterial ), intent(in) :: material
380  getnumofspring_dparam = material%variables_i(m_spring_d_ndoffset+1)
381  end function
382 
384  integer function getnumofspring_aparam( material )
385  type( tmaterial ), intent(in) :: material
386  getnumofspring_aparam = material%variables_i(m_spring_a_ndoffset+1)
387  end function
388 
390  integer function getnumofdashpot_dparam( material )
391  type( tmaterial ), intent(in) :: material
392  getnumofdashpot_dparam = material%variables_i(m_dashpot_d_ndoffset+1)
393  end function
394 
396  integer function getnumofdashpot_aparam( material )
397  type( tmaterial ), intent(in) :: material
398  getnumofdashpot_aparam = material%variables_i(m_dashpot_a_ndoffset+1)
399  end function
400 
401 end module
402 
403 
404 
I/O and Utility.
Definition: hecmw_util_f.F90:7
This module provides data structure table which would be dictionaried afterwards.
Definition: ttable.f90:7
type(ttable), parameter dict_null
Definition: ttable.f90:30
This module summarizes all information of material properties.
Definition: material.f90:6
integer(kind=kint), parameter m_dashpot_axial
Definition: material.f90:131
integer(kind=kint), parameter m_youngs
Definition: material.f90:92
integer function getyieldfunction(mtype)
Get type of yield function.
Definition: material.f90:291
integer(kind=kint), parameter m_plconst5
Definition: material.f90:101
character(len=dict_key_length) mc_incomp_newtonian
Definition: material.f90:146
integer(kind=kint), parameter m_plconst6
Definition: material.f90:119
integer(kind=kint), parameter connector
Definition: material.f90:81
integer(kind=kint), parameter mooneyrivlin
Definition: material.f90:72
integer(kind=kint), parameter m_beam_radius
Definition: material.f90:108
integer(kind=kint), parameter mooneyrivlin_aniso
Definition: material.f90:75
integer(kind=kint), parameter planestress
Definition: material.f90:85
integer(kind=kint), parameter m_spring_axial
Definition: material.f90:129
character(len=dict_key_length) mc_viscoelastic
Definition: material.f90:144
integer(kind=kint), parameter m_plconst4
Definition: material.f90:100
integer(kind=kint), parameter viscoelastic
Definition: material.f90:77
integer(kind=kint), parameter m_exapnsion
Definition: material.f90:104
integer function getelastictype(mtype)
Get elastic type.
Definition: material.f90:279
integer(kind=kint), parameter m_plconst1
Definition: material.f90:97
logical function ishyperelastic(mtype)
If it is a hyperelastic material?
Definition: material.f90:342
integer function getnumofdashpot_dparam(material)
Get number of dashpot_d parameters.
Definition: material.f90:391
integer function gethardentype(mtype)
Get type of hardening.
Definition: material.f90:303
character(len=dict_key_length) mc_themoexp
Definition: material.f90:142
character(len=dict_key_length) mc_spring
Definition: material.f90:147
character(len=dict_key_length) mc_norton
Definition: material.f90:145
integer(kind=kint), parameter d3
Definition: material.f90:84
integer(kind=kint), parameter planestrain
Definition: material.f90:86
type(tmaterial), dimension(:), allocatable materials
Definition: material.f90:182
integer(kind=kint), parameter m_dashpot_a_ndoffset
Definition: material.f90:136
integer(kind=kint), parameter m_beam_angle6
Definition: material.f90:114
integer function getnumofdashpot_aparam(material)
Get number of dashpot_a parameters.
Definition: material.f90:397
integer(kind=kint), parameter m_plconst10
Definition: material.f90:123
integer(kind=kint), parameter elastic
Definition: material.f90:65
integer(kind=kint), parameter m_plconst2
Definition: material.f90:98
integer(kind=kint), parameter arrudaboyce
Definition: material.f90:73
integer(kind=kint), parameter shell
Definition: material.f90:88
integer(kind=kint), parameter mn_orthoelastic
Definition: material.f90:66
integer(kind=kint), parameter incomp_newtonian
Definition: material.f90:80
integer(kind=kint), parameter m_beam_angle3
Definition: material.f90:111
integer(kind=kint), parameter totallag
Definition: material.f90:14
integer(kind=kint), parameter m_density
Definition: material.f90:94
subroutine initializematls(nm)
Initializer.
Definition: material.f90:209
integer(kind=kint), parameter m_beam_angle4
Definition: material.f90:112
integer(kind=kint), parameter m_kinehard
Definition: material.f90:102
integer function getnumofspring_aparam(material)
Get number of spring_a parameters.
Definition: material.f90:385
subroutine setdigit(npos, ival, mtype)
Modify material type.
Definition: material.f90:249
integer(kind=kint), parameter norton
Definition: material.f90:78
integer(kind=kint), parameter m_plconst9
Definition: material.f90:122
integer(kind=kint), parameter m_damping_rk
Definition: material.f90:126
character(len=dict_key_length) mc_dashpot
Definition: material.f90:148
integer(kind=kint), parameter m_poisson
Definition: material.f90:93
subroutine finalizematerial(material)
Finalizer.
Definition: material.f90:202
integer(kind=kint), parameter m_plconst8
Definition: material.f90:121
integer(kind=kint), parameter m_damping_rm
Definition: material.f90:125
integer(kind=kint), parameter axissymetric
Definition: material.f90:87
integer(kind=kint), parameter m_beam_angle1
Definition: material.f90:109
integer(kind=kint), parameter m_dashpot_dof
Definition: material.f90:130
character(len=dict_key_length) mc_orthoexp
Definition: material.f90:143
integer(kind=kint), parameter infinitesimal
Definition: material.f90:13
character(len=dict_key_length) mc_yield
Definition: material.f90:141
integer(kind=kint), parameter userelastic
Definition: material.f90:67
integer(kind=kint), parameter m_viscocity
Definition: material.f90:116
integer(kind=kint), parameter neohooke
Definition: material.f90:71
integer(kind=kint), parameter m_plconst7
Definition: material.f90:120
subroutine finalizematls()
Finalizer.
Definition: material.f90:220
logical function iskinematicharden(mtype)
If it is a kinematic hardening material?
Definition: material.f90:315
integer(kind=kint), parameter usermaterial
Definition: material.f90:63
integer function fetchdigit(npos, cnum)
Fetch material type.
Definition: material.f90:231
integer(kind=kint), parameter m_beam_angle5
Definition: material.f90:113
integer(kind=kint), parameter m_spring_dof
Definition: material.f90:128
character(len=dict_key_length) mc_isoelastic
Definition: material.f90:139
integer(kind=kint), parameter m_beam_angle2
Definition: material.f90:110
logical function iselastic(mtype)
If it is an elastic material?
Definition: material.f90:324
integer function getnumofspring_dparam(material)
Get number of spring_d parameters.
Definition: material.f90:379
integer(kind=kint), parameter userhyperelastic
Definition: material.f90:74
integer(kind=kint), parameter m_plconst3
Definition: material.f90:99
character(len=dict_key_length) mc_orthoelastic
Definition: material.f90:140
integer(kind=kint), parameter updatelag
Definition: material.f90:15
subroutine ep2e(mtype)
Set material type of elastoplastic to elastic.
Definition: material.f90:360
integer(kind=kint), parameter m_alpha_over_mu
Definition: material.f90:106
integer(kind=kint), parameter m_spring_d_ndoffset
Definition: material.f90:133
integer(kind=kint), parameter m_dashpot_d_ndoffset
Definition: material.f90:135
logical function isviscoelastic(mtype)
If it is an viscoelastic material?
Definition: material.f90:351
subroutine initmaterial(material)
Initializer.
Definition: material.f90:188
integer(kind=kint), parameter m_spring_a_ndoffset
Definition: material.f90:134
logical function iselastoplastic(mtype)
If it is an elastoplastic material?
Definition: material.f90:333
integer(kind=kint), parameter eplastic
Definition: material.f90:69
integer function getconnectortype(mtype)
Get type of connector.
Definition: material.f90:367
This module provides data structure of dictionaried table list.
Definition: ttable.f90:140
Structure to manage all material related data.
Definition: material.f90:166