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 my_real :: fac
81 INTEGER :: IMID(21)
82C-----------------------------------------------
83C B o d y
84C-----------------------------------------------
85 is_available = .false.
86 nbmat = 0
87 CALL hm_get_intv('NIP',nbmat,is_available,lsubmodel)
88 multi_fvm%NBMAT = max(multi_fvm%NBMAT, nbmat)
89
90 IF (nbmat > 21) THEN
91 !! Limitation to 20 material
92 CALL ancmsg(msgid = 87, msgtype = msgerror, anmode = aninfo)
93 ENDIF
94
95 ! Storing number of materials
96 ipm(20) = nbmat
97 pm(20) = nbmat + em01
98 matparam%MULTIMAT%NB = nbmat
99 ! Multimaterial data
100 IF(.NOT.ALLOCATED(matparam%multimat%vfrac))ALLOCATE(matparam%multimat%vfrac(nbmat))
101 IF(.NOT.ALLOCATED(matparam%multimat%mid)) ALLOCATE(matparam%multimat%mid(nbmat))
102
103 ! Reading submaterial IDS and corresponding volumic fractions
104 sum_frac_vol = zero
105 DO ii = 1, nbmat
106 CALL hm_get_int_array_index('MAT_ID_ARRAY',mat_id,ii,is_available,lsubmodel)
107 CALL hm_get_float_array_index('VOL_FRAC_ARRAY',frac_vol,ii,is_available,lsubmodel,unitab)
108 ipm(20 + ii) = mat_id
109 pm(20 + ii) = frac_vol
110 imid(ii) = mat_id
111 vfrac(ii) = frac_vol
112 sum_frac_vol = sum_frac_vol + frac_vol
113 IF (frac_vol < zero .OR. frac_vol > one) THEN
114 IF (num_inivol == 0) THEN
115 CALL ancmsg(msgid = 1511, msgtype = msgerror, anmode = aninfo, c1 = "ERROR", i1 = id, i2 = mat_id, r1 = frac_vol)
116 ELSE
117 CALL ancmsg(msgid = 1511, msgtype = msgwarning, anmode = aninfo, c1 = "WARNING", i1 = id, i2 = mat_id, r1 = frac_vol)
118 ENDIF
119 ENDIF
120 ENDDO
121
122 ! Warning and Error messages SUM_FRAC_VOL /= 1.0
123 IF (abs(one-sum_frac_vol) > em14) THEN
124 IF (num_inivol == 0) THEN
125 CALL ancmsg(msgid = 1512, msgtype = msgerror, anmode = aninfo, c1 = "ERROR", i1 = id, r1 = sum_frac_vol)
126 ELSE
127 CALL ancmsg(msgid = 1512, msgtype = msgwarning, anmode = aninfo, c1 = "WARNING", i1 = id, r1 = sum_frac_vol)
128 IF(sum_frac_vol == zero)THEN
129 pm(20 + 1) = one !default submaterial is submat #1
130 vfrac(1) = one
131 ENDIF
132 ENDIF
133 ENDIF
134
135 ! Material Buffer
136 mtag%L_FRAC = 1
137 mtag%G_DELTAX = 1
138 mtag%L_DELTAX = 1
139 mtag%G_RHO = 1
140 mtag%L_RHO = 1
141
142 ! MATPARAM keywords
143 CALL init_mat_keyword(matparam,"INCOMPRESSIBLE")
144
145 ! Material compatibility with /EOS option
146 CALL init_mat_keyword(matparam,"EOS")
147
148 ! EOS/Thermo keyword for pressure treatment in elements
149 CALL init_mat_keyword(matparam,"HYDRO_EOS")
150
151 ! Properties compatibility
152 CALL init_mat_keyword(matparam,"SOLID_ISOTROPIC")
153
154 ! Multimaterial data
155 matparam%multimat%vfrac(1:nbmat) = vfrac(1:nbmat)
156 matparam%multimat%mid(1:nbmat) = imid(1:nbmat)
157
158 ! Starter listing output
159 WRITE(iout,1000) nbmat
160 DO ii = 1, nbmat
161 WRITE(iout, 1010) matparam%multimat%mid(ii), matparam%multimat%vfrac(ii)
162 ENDDO
163
164 1000 FORMAT(
165 & 5x,' MULTIFLUID LAW ',/,
166 & 5x,' -------------- ',/,
167 & 5x,' NUMBER OF MATERIALS. . . . . . .=',i8//)
168 1010 FORMAT(
169 & 5x,' MATERIAL ID', i8, ' ; VOLUME FRACTION',1pg20.13/)
170 RETURN
171
172C-----------------------------------------------
173 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:895