OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
hm_read_mat151.F
Go to the documentation of this file.
1Copyright> OpenRadioss
2Copyright> Copyright (C) 1986-2025 Altair Engineering Inc.
3Copyright>
4Copyright> This program is free software: you can redistribute it and/or modify
5Copyright> it under the terms of the GNU Affero General Public License as published by
6Copyright> the Free Software Foundation, either version 3 of the License, or
7Copyright> (at your option) any later version.
8Copyright>
9Copyright> This program is distributed in the hope that it will be useful,
10Copyright> but WITHOUT ANY WARRANTY; without even the implied warranty of
11Copyright> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12Copyright> GNU Affero General Public License for more details.
13Copyright>
14Copyright> You should have received a copy of the GNU Affero General Public License
15Copyright> along with this program. If not, see <https://www.gnu.org/licenses/>.
16Copyright>
17Copyright>
18Copyright> Commercial Alternative: Altair Radioss Software
19Copyright>
20Copyright> As an alternative to this open-source version, Altair also offers Altair Radioss
21Copyright> software under a commercial license. Contact Altair to discuss further if the
22Copyright> commercial version may interest you: https://www.altair.com/radioss/.
23!||====================================================================
24!|| hm_read_mat151 ../starter/source/materials/mat/mat151/hm_read_mat151.F
25!||--- called by ------------------------------------------------------
26!|| hm_read_mat ../starter/source/materials/mat/hm_read_mat.F90
27!||--- calls -----------------------------------------------------
28!|| ancmsg ../starter/source/output/message/message.F
29!|| hm_get_float_array_index ../starter/source/devtools/hm_reader/hm_get_float_array_index.F
30!|| hm_get_int_array_index ../starter/source/devtools/hm_reader/hm_get_int_array_index.F
31!|| hm_get_intv ../starter/source/devtools/hm_reader/hm_get_intv.F
32!|| init_mat_keyword ../starter/source/materials/mat/init_mat_keyword.F
33!||--- uses -----------------------------------------------------
34!|| elbuftag_mod ../starter/share/modules1/elbuftag_mod.F
35!|| inivol_def_mod ../starter/share/modules1/inivol_mod.F
36!|| message_mod ../starter/share/message_module/message_mod.F
37!|| submodel_mod ../starter/share/modules1/submodel_mod.F
38!||====================================================================
39 SUBROUTINE hm_read_mat151( MTAG, PM, IPM, ID, TITR, MULTI_FVM, UNITAB, LSUBMODEL, MATPARAM )
40C-----------------------------------------------
41C M o d u l e s
42C-----------------------------------------------
43 USE unitab_mod
44 USE elbuftag_mod
45 USE message_mod
46 USE multi_fvm_mod
47 USE submodel_mod
49 USE matparam_def_mod, ONLY : matparam_struct_
51C-----------------------------------------------
52C I m p l i c i t T y p e s
53C-----------------------------------------------
54#include "implicit_f.inc"
55C-----------------------------------------------
56C C o m m o n B l o c k s
57C-----------------------------------------------
58#include "units_c.inc"
59#include "param_c.inc"
60C-----------------------------------------------
61C D u m m y A r g u m e n t s
62C-----------------------------------------------
63 CHARACTER(LEN=NCHARTITLE) ,INTENT(IN) :: TITR
64 INTEGER,INTENT(INOUT) :: IPM(NPROPMI)
65 INTEGER,INTENT(IN) :: ID
66 my_real,INTENT(INOUT) :: pm(npropm)
67 TYPE (UNIT_TYPE_),INTENT(IN) :: UNITAB
68 TYPE(mlaw_tag_),INTENT(INOUT) :: MTAG
69 TYPE(multi_fvm_struct), INTENT(INOUT) :: MULTI_FVM
70 TYPE(submodel_data),INTENT(IN) :: LSUBMODEL(NSUBMOD)
71 TYPE(matparam_struct_) ,INTENT(INOUT) :: MATPARAM
72C-----------------------------------------------
73C L o c a l V a r i a b l e s
74C-----------------------------------------------
75 LOGICAL :: IS_AVAILABLE
76 INTEGER :: NBMAT, MAT_ID ! Number of declared materials
77 INTEGER :: II
78 my_real :: frac_vol, sum_frac_vol
79 my_real :: vfrac(21)
80 INTEGER :: IMID(21)
81C-----------------------------------------------
82C B o d y
83C-----------------------------------------------
84 is_available = .false.
85 nbmat = 0
86 CALL hm_get_intv('NIP',nbmat,is_available,lsubmodel)
87 multi_fvm%NBMAT = max(multi_fvm%NBMAT, nbmat)
88
89 IF (nbmat > 21) THEN
90 !! Limitation to 20 material
91 CALL ancmsg(msgid = 87, msgtype = msgerror, anmode = aninfo)
92 ENDIF
93
94 ! Storing number of materials
95 ipm(20) = nbmat
96 pm(20) = nbmat + em01
97 matparam%MULTIMAT%NB = nbmat
98 ! Multimaterial data
99 IF(.NOT.ALLOCATED(matparam%multimat%vfrac))ALLOCATE(matparam%multimat%vfrac(nbmat))
100 IF(.NOT.ALLOCATED(matparam%multimat%mid)) ALLOCATE(matparam%multimat%mid(nbmat))
101
102 ! Reading submaterial IDS and corresponding volumic fractions
103 sum_frac_vol = zero
104 DO ii = 1, nbmat
105 CALL hm_get_int_array_index('MAT_ID_ARRAY',mat_id,ii,is_available,lsubmodel)
106 CALL hm_get_float_array_index('VOL_FRAC_ARRAY',frac_vol,ii,is_available,lsubmodel,unitab)
107 ipm(20 + ii) = mat_id
108 pm(20 + ii) = frac_vol
109 imid(ii) = mat_id
110 vfrac(ii) = frac_vol
111 sum_frac_vol = sum_frac_vol + frac_vol
112 IF (frac_vol < zero .OR. frac_vol > one) THEN
113 IF (num_inivol == 0) THEN
114 CALL ancmsg(msgid = 1511, msgtype = msgerror, anmode = aninfo, c1 = "ERROR", i1 = id, i2 = mat_id, r1 = frac_vol)
115 ELSE
116 CALL ancmsg(msgid = 1511, msgtype = msgwarning, anmode = aninfo, c1 = "WARNING", i1 = id, i2 = mat_id, r1 = frac_vol)
117 ENDIF
118 ENDIF
119 ENDDO
120
121 ! Warning and Error messages
122 IF (sum_frac_vol /= one) THEN
123 IF (num_inivol == 0) THEN
124 CALL ancmsg(msgid = 1512, msgtype = msgerror, anmode = aninfo, c1 = "ERROR", i1 = id, r1 = sum_frac_vol)
125 ELSE
126 CALL ancmsg(msgid = 1512, msgtype = msgwarning, anmode = aninfo, c1 = "WARNING", i1 = id, r1 = sum_frac_vol)
127 IF(sum_frac_vol == zero)THEN
128 pm(20 + 1) = one !default submaterial is submat #1
129 vfrac(1) = one
130 ENDIF
131 ENDIF
132 ENDIF
133
134 ! Material Buffer
135 mtag%L_FRAC = 1
136 mtag%G_DELTAX = 1
137 mtag%L_DELTAX = 1
138 mtag%G_RHO = 1
139 mtag%L_RHO = 1
140
141 ! MATPARAM keywords
142 CALL init_mat_keyword(matparam,"INCOMPRESSIBLE")
143
144 ! Material compatibility with /EOS option
145 CALL init_mat_keyword(matparam,"EOS")
146
147 ! EOS/Thermo keyword for pressure treatment in elements
148 CALL init_mat_keyword(matparam,"HYDRO_EOS")
149
150 ! Properties compatibility
151 CALL init_mat_keyword(matparam,"SOLID_ISOTROPIC")
152
153 ! Multimaterial data
154 matparam%multimat%vfrac(1:nbmat) = vfrac(1:nbmat)
155 matparam%multimat%mid(1:nbmat) = imid(1:nbmat)
156
157 ! Starter listing output
158 WRITE(iout,1000) nbmat
159 DO ii = 1, nbmat
160 WRITE(iout, 1010) matparam%multimat%mid(ii), matparam%multimat%vfrac(ii)
161 ENDDO
162
163 1000 FORMAT(
164 & 5x,' MULTIFLUID LAW ',/,
165 & 5x,' -------------- ',/,
166 & 5x,' NUMBER OF MATERIALS. . . . . . .=',i8//)
167 1010 FORMAT(
168 & 5x,' MATERIAL ID', i8, ' ; VOLUME FRACTION',1pg20.13/)
169 RETURN
170
171C-----------------------------------------------
172 END SUBROUTINE hm_read_mat151
#define my_real
Definition cppsort.cpp:32
subroutine hm_get_float_array_index(name, rval, index, is_available, lsubmodel, unitab)
subroutine hm_get_int_array_index(name, ival, index, is_available, lsubmodel)
subroutine hm_get_intv(name, ival, is_available, lsubmodel)
subroutine hm_read_mat151(mtag, pm, ipm, id, titr, multi_fvm, unitab, lsubmodel, matparam)
subroutine init_mat_keyword(matparam, keyword)
#define max(a, b)
Definition macros.h:21
integer num_inivol
Definition inivol_mod.F:85
integer, parameter nchartitle
subroutine ancmsg(msgid, msgtype, anmode, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, r1, r2, r3, r4, r5, r6, r7, r8, r9, c1, c2, c3, c4, c5, c6, c7, c8, c9, prmode)
Definition message.F:889