OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
fvinjt8.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!|| fvinjt8 ../engine/source/airbag/fvinjt8.F
25!||--- called by ------------------------------------------------------
26!|| fv_up_switch ../engine/source/airbag/fv_up_switch.F
27!|| fvbag1 ../engine/source/airbag/fvbag1.F
28!||--- uses -----------------------------------------------------
29!|| finter_mixed_mod ../engine/source/tools/finter_mixed.F90
30!|| python_funct_mod ../common_source/modules/python_mod.F90
31!|| sensor_mod ../common_source/modules/sensor_mod.F90
32!||====================================================================
33 SUBROUTINE fvinjt8(NJET , IBAGJET , RBAGJET , NPC , TF,
34 2 NSENSOR,SENSOR_TAB, SCALT, IGEO, GEO,
35 3 PM , IVOLU, DATAINJ ,PYTHON)
36C-----------------------------------------------
37C M o d u l e s
38C-----------------------------------------------
39 USE python_funct_mod, ONLY : python_
40 use finter_mixed_mod, ONLY : finter_mixed
41 USE sensor_mod
42C-----------------------------------------------
43C I m p l i c i t T y p e s
44C-----------------------------------------------
45#include "implicit_f.inc"
46C-----------------------------------------------
47C C o m m o n B l o c k s
48C-----------------------------------------------
49#include "com04_c.inc"
50#include "com08_c.inc"
51#include "param_c.inc"
52C-----------------------------------------------
53C D u m m y A r g u m e n t s
54C-----------------------------------------------
55 INTEGER ,INTENT(IN) :: NSENSOR
56 INTEGER NJET, IBAGJET(NIBJET,*), NPC(*), IGEO(NPROPGI,*), IVOLU(*)
57C REAL
59 . rbagjet(nrbjet,*), tf(*),scalt,
60 . geo(npropg,*), pm(npropm,*), datainj(6,njet)
61 TYPE (SENSOR_STR_) ,DIMENSION(NSENSOR) ,INTENT(IN) :: SENSOR_TAB
62 type(python_) :: python
63C-----------------------------------------------
64C L o c a l V a r i a b l e s
65C-----------------------------------------------
66 INTEGER I_INJ, I_TYPINJ, NGASES, ISENS, IFLU, IMASS, ITEMP, IMOL,
67 . I_GAS, IJ, IK, IL, IMASS1, I_GAS1, IMOL1, KK
69 . tstart, astime, dgmassi, gmtot_old, gmass_old, gmol_old, fmass,
70 . ftemp, molfr, gmass, gmass_dt, gmtot, dgmass, efac ,
71 . tsg, rmwg, temp,
72 . cpa, cpb, cpc, cpd, cpe, cpf, mw,
73 . cpa_new, cpb_new, cpc_new, cpd_new, cpe_new, cpf_new,mwmix_new,
74 . dmass_mix, dmol_mix, dmassg_mix, dteps, mass_mix, mass_mix_dt,
75 . mwmix, fmass1, mw1, molfr1, r_igc1, dgmout
76C-----------------------------------------------
77 r_igc1 =pm(27,ivolu(66))
78C---------------------
79C INJECTEURS
80C---------------------
81 DO ij=1,njet
82 i_inj = ibagjet(13,ij)
83 i_typinj = igeo(22,i_inj)
84 ngases = igeo(23,i_inj)
85C
86 isens = ibagjet(4,ij)
87 IF(isens==0)THEN
88 tstart=zero
89 ELSE
90 tstart=sensor_tab(isens)%TSTART
91 ENDIF
92 iflu =igeo(24,i_inj)
93 astime = geo(201,i_inj)
94 dgmassi=zero
95 cpa_new=zero
96 cpb_new=zero
97 cpc_new=zero
98 cpd_new=zero
99 cpe_new=zero
100 cpf_new=zero
101 gmtot_old=rbagjet(8,ij)
102 gmass_old=rbagjet(7,ij)
103 gmol_old=rbagjet(20,ij)
104C
105 DO ik=1,ngases
106 IF (i_typinj==1) THEN
107 fmass=geo(208+(ik-1)*2+1,i_inj)
108 IF (iflu==1)fmass=fmass/astime
109 ftemp=geo(208+(ik-1)*2+2,i_inj)
110 imass=igeo(100+(ik-1)*3+2,i_inj)
111 itemp=igeo(100+(ik-1)*3+3,i_inj)
112 ELSE IF (i_typinj==2) THEN
113 fmass=geo(209,i_inj)
114 IF (iflu==1)fmass=fmass/astime
115 ftemp=geo(210,i_inj)
116 molfr=geo(211+(ik-1)+1,i_inj)
117 imass=igeo(25,i_inj)
118 itemp=igeo(26,i_inj)
119 imol =igeo(100+(ik-1)*2+2,i_inj)
120 END IF
121C
122 IF (i_typinj==1) THEN
123 i_gas=igeo(100+(ik-1)*3+1,i_inj)
124 ELSE IF (i_typinj==2) THEN
125 i_gas=igeo(100+(ik-1)*2+1,i_inj)
126 END IF
127 mw =pm(20,i_gas)
128 cpa =pm(21,i_gas)
129 cpb =pm(22,i_gas)
130 cpc =pm(23,i_gas)
131 cpd =pm(24,i_gas)
132 cpe =pm(25,i_gas)
133 cpf =pm(26,i_gas)
134 IF(tt>=tstart)THEN
135 tsg = (tt-tstart)/astime
136C
137 IF(itemp>0) THEN
138 temp=ftemp*finter_mixed(python,nfunct,itemp,tsg,npc,tf)
139 ELSE
140 temp=ftemp
141 ENDIF
142 efac= temp*(cpa+half*cpb*temp+third*cpc*temp*temp
143 . +fourth*cpd*temp*temp*temp
144 . -cpe/(temp*temp)
145 . +one_fifth*cpf*temp*temp*temp*temp)
146 ELSE
147 efac=zero
148 ENDIF
149C
150 dmass_mix=zero
151 dmol_mix=zero
152 dmassg_mix=zero
153
154 IF(tt>=tstart)THEN
155 dteps=dt1/astime
156 IF (dt1==zero) dteps=em15
157C
158 IF (i_typinj==1) THEN
159C --- calcul masse Cette boucle devrait etre faite en dehors de la boucle IK
160 DO il=1,ngases
161C
162 i_gas1=igeo(100+(il-1)*3+1,i_inj)
163 imass1=igeo(100+(il-1)*3+2,i_inj)
164 fmass1=geo(208+(il-1)*2+1,i_inj)
165 IF (iflu==1) fmass1=fmass1/astime
166 mw1=pm(20,i_gas1)
167C
168 IF(imass1>0) THEN
169 gmass=fmass1*finter_mixed(python,nfunct,imass1,tsg,npc,tf)
170 ELSE
171 gmass=fmass1
172 END IF
173C
174 IF (iflu==1) THEN
175 dmass_mix=dmass_mix+gmass
176 dmol_mix=dmol_mix+gmass/mw1
177 ELSEIF (iflu==0) THEN
178 IF(imass1>0) THEN
179 gmass_dt=fmass1*finter_mixed(python,nfunct,imass1,tsg+dteps,npc,tf)
180 ELSE
181 gmass_dt=fmass1
182 END IF
183 dmass_mix=dmass_mix+(gmass_dt-gmass)
184 dmol_mix=dmol_mix+(gmass_dt-gmass)/mw1
185 END IF
186 END DO ! end boucle sur IL
187C
188 IF(imass>0) THEN
189 gmass=fmass*finter_mixed(python,nfunct,imass,tsg,npc,tf)
190 ELSE
191 gmass=fmass
192 END IF
193 dmassg_mix=gmass
194 IF (iflu==0) THEN
195 IF(imass>0) THEN
196 gmass_dt=fmass*finter_mixed(python,nfunct,imass,tsg+dteps,npc,tf)
197 ELSE
198 gmass_dt=fmass
199 END IF
200 dmassg_mix=gmass_dt-gmass
201 END IF
202 ELSE IF (i_typinj==2) THEN
203C --- MASS_MIX correspond sert uniquement au calcul de GMASS
204C --- c est un cumul pour retrouver la fonction d input de masse
205C
206C --- MASS_MIX ne peut etre nulle car somme des fractions molaire = 1
207C --- et les MWs sont strictement positifs
208C
209C --- DMASS_MIX qui sert uniquement au calcul de CP[A-F]
210 mass_mix=zero
211 mass_mix_dt=zero
212 DO il=1,ngases
213C
214 i_gas1=igeo(100+(il-1)*2+1,i_inj)
215 imass1=igeo(25,i_inj)
216 fmass1=geo(209,i_inj)
217 IF (iflu==1) fmass1=fmass1/astime
218 mw1=pm(20,i_gas1)
219C
220 imol1=igeo(100+(il-1)*2+2,i_inj)
221 molfr1=geo(211+(il-1)+1,i_inj)
222C
223 IF (imol1==0) THEN
224 gmass=molfr1
225 . *mw1
226 ELSE
227 gmass=molfr1
228 . *finter_mixed(python,nfunct,imol1,tsg,npc,tf)
229 . *mw1
230 END IF
231 IF (iflu==1) THEN
232 dmass_mix=dmass_mix+gmass
233 dmol_mix=dmol_mix+gmass/mw1
234C
235 mass_mix=mass_mix+gmass
236C
237 ELSEIF (iflu==0) THEN
238 IF (imol1==0) THEN
239 gmass_dt=molfr1
240 . *mw1
241 ELSE
242 gmass_dt=molfr1
243 . *finter_mixed(python,nfunct,imol1,tsg+dteps,npc,tf)
244 . *mw1
245 END IF
246C --- la fraction molaire n est pas un debit
247C --- pas de recalcul de DMASS_MIX avec DTEPS
248 dmass_mix=dmass_mix+gmass
249 dmol_mix=dmol_mix+gmass/mw1
250 mass_mix=mass_mix+gmass
251 mass_mix_dt=mass_mix_dt+gmass_dt
252C
253 END IF
254 END DO
255C --- Somme de masse (masse x masse_molaire)/masse_mixture
256 IF (imol==0) THEN
257 gmass=fmass*molfr
258 . *mw
259 ELSE
260 gmass=fmass*molfr
261 . *finter_mixed(python,nfunct,imol,tsg,npc,tf)
262 . *mw
263 END IF
264 gmass=gmass
265 . *finter_mixed(python,nfunct,imass,tsg,npc,tf)/mass_mix
266 dmass_mix=fmass*dmass_mix
267 . *finter_mixed(python,nfunct,imass,tsg,npc,tf)/mass_mix
268 dmol_mix =fmass*dmol_mix
269 . *finter_mixed(python,nfunct,imass,tsg,npc,tf)/mass_mix
270 dmassg_mix=gmass
271 IF (iflu==0) THEN
272 IF (imol==0) THEN
273 gmass_dt=fmass*molfr
274 . *mw
275 ELSE
276 gmass_dt=fmass*molfr
277 . *finter_mixed(python,nfunct,imol,tsg+dteps,npc,tf)
278 . *mw
279 END IF
280C --- la fraction molaire n est pas un debit
281C --- pas de recalcul de DMASSG_MIX avec DTEPS
282 gmass_dt=gmass_dt*finter_mixed(python,nfunct,imass,tsg+dteps,npc,tf)/mass_mix_dt
283 END IF
284 END IF
285C
286 IF (dmass_mix/=zero)THEN
287 mwmix_new =dmass_mix/dmol_mix
288 cpa_new =cpa_new +cpa*dmassg_mix/dmass_mix
289 cpb_new =cpb_new +cpb*dmassg_mix/dmass_mix
290 cpc_new =cpc_new +cpc*dmassg_mix/dmass_mix
291 cpd_new =cpd_new +cpd*dmassg_mix/dmass_mix
292 cpe_new =cpe_new +cpe*dmassg_mix/dmass_mix
293 cpf_new =cpf_new +cpf*dmassg_mix/dmass_mix
294 END IF
295C
296 kk=20+(ik-1)*4
297 IF(iflu==1) THEN
298 gmass_old = rbagjet(kk+1,ij)
299 gmass =gmass*dt1 + gmass_old
300 dgmass=max(zero,gmass-gmass_old)
301 ELSE
302 dgmass=max(zero,gmass_dt-gmass)
303 END IF
304 rbagjet(kk+1,ij) = rbagjet(kk+1,ij) + dgmass
305 rbagjet(kk+2,ij) = rbagjet(kk+2,ij) + dgmass
306 dgmassi=dgmassi+dgmass
307 ELSE
308 dgmass=zero
309 gmass =zero
310 ENDIF !TT >= TSTART
311C
312 IF(dmass_mix/=zero) THEN
313 datainj(4,ij)=datainj(4,ij)+efac*dmassg_mix/dmass_mix
314 ENDIF
315C
316 END DO
317C Fin de boucle sur les gas inject s
318C
319 IF (dt1>zero) THEN
320 datainj(2,ij)=dgmassi/dt1
321 ELSE
322 datainj(2,ij)=zero
323 ENDIF
324C
325 IF (dmass_mix/=zero)THEN
326 mwmix=mwmix_new
327 rbagjet(2 ,ij)=cpa_new
328 rbagjet(3 ,ij)=cpb_new
329 rbagjet(4 ,ij)=cpc_new
330 rbagjet(16,ij)=cpd_new
331 rbagjet(17,ij)=cpe_new
332 rbagjet(18,ij)=cpf_new
333 END IF
334C
335 cpa = rbagjet(2,ij)
336 cpb = rbagjet(3,ij)
337 cpc = rbagjet(4,ij)
338 cpd = rbagjet(16,ij)
339 cpe = rbagjet(17,ij)
340 cpf = rbagjet(18,ij)
341 IF (dmass_mix/=zero)THEN
342 rmwg=r_igc1/mwmix
343 rbagjet(1,ij)=rmwg
344 ELSE
345 rmwg=rbagjet(1,ij)
346 END IF
347C
348 gmtot =gmtot_old+dgmassi
349C
350 rbagjet(1,ij)=rmwg
351 rbagjet(8,ij)=gmtot
352 rbagjet(7,ij)=rbagjet(7,ij)+dgmassi
353 rbagjet(20,ij)=dmol_mix
354 ENDDO
355C fin de boucle sur injecteurs
356C------
357 RETURN
358 END
#define my_real
Definition cppsort.cpp:32
subroutine fvinjt8(njet, ibagjet, rbagjet, npc, tf, nsensor, sensor_tab, scalt, igeo, geo, pm, ivolu, datainj, python)
Definition fvinjt8.F:36
#define max(a, b)
Definition macros.h:21