OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
multifluid_init2t.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!|| multifluid_init2t ../starter/source/multifluid/multifluid_init2t.F
25!||--- called by ------------------------------------------------------
26!|| initia ../starter/source/elements/initia/initia.F
27!||--- calls -----------------------------------------------------
28!|| ancmsg ../starter/source/output/message/message.F
29!|| c3veok3 ../starter/source/elements/sh3n/coque3n/c3veok3.F
30!|| m5in2t ../starter/source/initial_conditions/detonation/m5in2t.F
31!|| matini ../starter/source/materials/mat_share/matini.F
32!||--- uses -----------------------------------------------------
33!|| detonators_mod ../starter/share/modules1/detonators_mod.F
34!|| message_mod ../starter/share/message_module/message_mod.F
35!||====================================================================
36 SUBROUTINE multifluid_init2t(ELBUF_STR, NEL, NSIGS, NVC, IPARG, IXTG, ALE_CONNECTIVITY,
37 . IGEO, IPART, IPARTTG, IPM, PTSH3N, NPF, ILOADP,
38 . XGRID, PM, GEO, SIGI, SKEW, TF, BUFMAT, FACLOAD, MULTI_FVM,
39 . ERROR_THROWN, DETONATORS,MAT_PARAM)
40C-----------------------------------------------
41C M o d u l e s
42C-----------------------------------------------
43 USE elbufdef_mod
44 USE multi_fvm_mod
45 USE message_mod
48 USE matparam_def_mod, ONLY : matparam_struct_
49C-----------------------------------------------
50C I m p l i c i t T y p e s
51C-----------------------------------------------
52#include "implicit_f.inc"
53C-----------------------------------------------
54C G l o b a l P a r a m e t e r s
55C-----------------------------------------------
56! MVSIZ
57#include "mvsiz_p.inc"
58C-----------------------------------------------
59C C o m m o n B l o c k s
60C-----------------------------------------------
61! NIXTG, NPROPMI, NPROPM, LFACLOAD
62#include "param_c.inc"
63! JEUL, NFT
64#include "vect01_c.inc"
65! NUMSH3N
66#include "scry_c.inc"
67! LIPART1
68#include "scr17_c.inc"
69! SIZLOADP
70#include "com04_c.inc"
71! N2D
72#include "com01_c.inc"
73C-----------------------------------------------
74C D u m m y A r g u m e n t s
75C-----------------------------------------------
76 TYPE(elbuf_struct_), INTENT(IN), TARGET :: ELBUF_STR
77 INTEGER, INTENT(IN) :: NEL, NSIGS, IXTG(NIXTG, *),
78 . IGEO(*), PTSH3N(*), NPF(*), ILOADP(SIZLOADP, *),
79 . ipart(lipart1, *), iparttg(*), ipm(npropmi, *)
80 INTEGER, INTENT(INOUT) :: IPARG(*)
81 INTEGER, INTENT(OUT) :: NVC
82 my_real, INTENT(IN) :: XGRID(3, *), FACLOAD(LFACLOAD, *)
83 my_real,INTENT(INOUT) :: pm(npropm, *)
84 my_real, INTENT(INOUT) :: geo(*), sigi(nsigs, *), skew(lskew, *),
85 . tf(*), bufmat(*)
86 TYPE(multi_fvm_struct) :: MULTI_FVM
87 LOGICAL :: ERROR_THROWN
88 TYPE(DETONATORS_STRUCT_) DETONATORS
89 TYPE(t_ale_connectivity), INTENT(INOUT) :: ALE_CONNECTIVITY
90 TYPE(matparam_struct_) ,DIMENSION(NUMMAT) ,INTENT(IN) :: MAT_PARAM
91C-----------------------------------------------
92C L o c a l V a r i a b l e s
93C-----------------------------------------------
94 TYPE(l_bufel_) ,POINTER :: LBUF
95 TYPE(G_BUFEL_) ,POINTER :: GBUF
96 TYPE(BUF_MAT_) ,POINTER :: MBUF
97 INTEGER :: NLAY, NGL(MVSIZ), MAT(MVSIZ), IX1(MVSIZ), IX2(MVSIZ), IX3(MVSIZ)
98 my_real ::
99 . y1(mvsiz), z1(mvsiz),
100 . y2(mvsiz), z2(mvsiz),
101 . y3(mvsiz), z3(mvsiz),
102 . nx(mvsiz), ny(mvsiz), nz(mvsiz),
103 . lgth1(mvsiz), lgth2(mvsiz), lgth3(mvsiz),pres,vfrac
104 my_real :: tempel(nel)
105 INTEGER :: II, I, IP, IBID, ILAY, MATLAW
106C-----------------------------------------------
107C P r e - C o n d i t i o n s
108C-----------------------------------------------
109 IF(n2d>0 .AND. mtn /=151) THEN
110 CALL ancmsg(msgid=1646,
111 . msgtype=msgerror,
112 . anmode=aninfo_blind_1)
113 RETURN
114 ENDIF
115C-----------------------------------------------
116C B e g i n n i n g o f s u b r o u t i n e
117C-----------------------------------------------
118 tempel(:) = zero
119C Global buffer
120 gbuf => elbuf_str%GBUF
121C Number of layers ( = number of material in law 151)
122 nlay = elbuf_str%NLAY
123C Gather nodale coordinates, compute surface (and volume)
124 DO ii = 1, nel
125 i = ii + nft
126 ix1(ii) = ixtg(1 + 1, i)
127 ix2(ii) = ixtg(1 + 2, i)
128 ix3(ii) = ixtg(1 + 3, i)
129 y1(ii) = xgrid(2, ixtg(1 + 1, i))
130 z1(ii) = xgrid(3, ixtg(1 + 1, i))
131 y2(ii) = xgrid(2, ixtg(1 + 2, i))
132 z2(ii) = xgrid(3, ixtg(1 + 2, i))
133 y3(ii) = xgrid(2, ixtg(1 + 3, i))
134 z3(ii) = xgrid(3, ixtg(1 + 3, i))
135 ngl(ii) = ixtg(6, i)
136 nx(ii) = half * ((y2(ii) - y1(ii)) * (z3(ii) - z1(ii)) -
137 . (z2(ii) - z1(ii)) * (y3(ii) - y1(ii)))
138 ny(ii) = zero
139 nz(ii) = zero
140 gbuf%AREA(ii) = sqrt(nx(ii) * nx(ii) + ny(ii) * ny(ii) + nz(ii) * nz(ii))
141 IF (n2d /= 1) THEN
142 gbuf%VOL(ii) = gbuf%AREA(ii)
143 ELSE
144 gbuf%VOL(ii) = (y1(ii) + y2(ii) + y3(ii)) * (
145 . y1(ii) * (z2(ii) - z3(ii)) +
146 . y2(ii) * (z3(ii) - z1(ii)) +
147 . y3(ii) * (z1(ii) - z2(ii))) * one_over_6
148 ENDIF
149 ! TODO(DC) Calcul volume axi
150 lgth1(ii) = sqrt((y2(ii) - y1(ii)) * (y2(ii) - y1(ii)) +
151 . (z2(ii) - z1(ii)) * (z2(ii) - z1(ii)))
152 lgth2(ii) = sqrt((y3(ii) - y2(ii)) * (y3(ii) - y2(ii)) +
153 . (z3(ii) - z2(ii)) * (z3(ii) - z2(ii)))
154 lgth3(ii) = sqrt((y1(ii) - y3(ii)) * (y1(ii) - y3(ii)) +
155 . (z1(ii) - z3(ii)) * (z1(ii) - z3(ii)))
156 gbuf%DELTAX(ii) = gbuf%AREA(ii) / max(lgth1(ii), lgth2(ii), lgth3(ii))
157 ENDDO
158
159 CALL c3veok3(nvc ,ix1 ,ix2 ,ix3 )
160
161 pm(104,ixtg(1, 1 + nft)) = zero !global pressure
162
163C Loop over the materials
164 DO ilay = 1, nlay
165C Layer buffer
166 lbuf => elbuf_str%BUFLY(ilay)%LBUF(1,1,1)
167 mbuf => elbuf_str%BUFLY(ilay)%MAT(1,1,1)
168 DO ii = 1, nel
169C Material
170 mat(ii) = mat_param( ixtg(1,ii+nft) )%MULTIMAT%MID(ilay)
171C Partial volumes
172 lbuf%VOL(ii) = mat_param( ixtg(1,ii+nft) )%MULTIMAT%VFRAC(ilay) * gbuf%VOL(ii)
173 ENDDO
174C Material initialization
175 ip = 1
176 ibid = 0
177 CALL matini(pm, ixtg, nixtg, xgrid,
178 . geo, ale_connectivity, detonators, iparg,
179 . sigi, nel, skew, igeo,
180 . ipart,iparttg,
181 . mat, ipm, nsigs, numsh3n, ptsh3n,
182 . ip, ngl, npf, tf, bufmat,
183 . gbuf, lbuf, mbuf, elbuf_str, iloadp,
184 . facload, gbuf%DELTAX,tempel)
185
186 vfrac = mat_param( ixtg(1,1+nft) )%MULTIMAT%VFRAC(ilay)
187 pres = pm(104, mat_param( ixtg(1,1+nft) )%MULTIMAT%MID(ilay) )
188 pm(104,ixtg(1, 1 + nft)) = pm(104,ixtg(1, 1 + nft)) + vfrac * pres !global pressure
189
190 matlaw = ipm(2, mat(1))
191 IF (matlaw == 5) THEN
192! JWL MAT
193 IF (.NOT. error_thrown) THEN
194 IF (pm(44, mat(1)) == zero) THEN
195 CALL ancmsg(msgid = 1623, msgtype = msgerror, anmode = aninfo,
196 . i1 = ipm(1, ixtg(1, 1 + nft)), i2 = ipm(1, mat(1)))
197 ENDIF
198 error_thrown = .true.
199 ENDIF
200 CALL m5in2t(pm, mat, ipm(1, ixtg(1,1+nft)), detonators, lbuf%TB, xgrid, ixtg, nixtg)
201 ENDIF
202 ENDDO
203
204 IF (nlay > 1) THEN
205
206C Mass globalization
207 gbuf%RHO(1:nel)=zero
208 DO ilay = 1, nlay
209 lbuf => elbuf_str%BUFLY(ilay)%LBUF(1,1,1)
210 DO ii = 1, nel
211 gbuf%RHO(ii) = gbuf%RHO(ii) + lbuf%RHO(ii) * mat_param( ixtg(1,ii+nft) )%MULTIMAT%VFRAC(ilay)
212 ENDDO
213 ENDDO
214
215C Temperature globalization. We must solve later T such as e+p/rho=integral(Cp_global(T),dT)
216 gbuf%TEMP(1:nel)=zero
217 DO ilay = 1, nlay
218 lbuf => elbuf_str%BUFLY(ilay)%LBUF(1,1,1)
219 DO ii = 1, nel
220 gbuf%TEMP(ii) = gbuf%TEMP(ii) + lbuf%TEMP(ii) *
221 . mat_param( ixtg(1,ii+nft) )%MULTIMAT%VFRAC(ilay)*lbuf%RHO(ii)/gbuf%RHO(ii) !volfrac*densfrac=massfrac
222 ENDDO
223 ENDDO
224
225 ENDIF
226 END SUBROUTINE multifluid_init2t
subroutine c3veok3(nvc, ix1, ix2, ix3)
Definition c3veok3.F:36
subroutine m5in2t(pm, mat, m151_id, detonators, tb, x, ix, nix)
Definition m5in2t.F:36
#define max(a, b)
Definition macros.h:21
subroutine matini(pm, ix, nix, x, geo, ale_connectivity, detonators, iparg, sigi, nel, skew, igeo, ipart, ipartel, mat, ipm, nsig, nums, pt, ipt, ngl, npf, tf, bufmat, gbuf, lbuf, mbuf, elbuf_str, iloadp, facload, ddeltax, tempel)
Definition matini.F:81
subroutine multifluid_init2t(elbuf_str, nel, nsigs, nvc, iparg, ixtg, ale_connectivity, igeo, ipart, iparttg, ipm, ptsh3n, npf, iloadp, xgrid, pm, geo, sigi, skew, tf, bufmat, facload, multi_fvm, error_thrown, detonators, mat_param)
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