OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
hm_read_inject1.F File Reference
#include "implicit_f.inc"
#include "units_c.inc"
#include "param_c.inc"
#include "com04_c.inc"
#include "tablen_c.inc"

Go to the source code of this file.

Functions/Subroutines

subroutine hm_read_inject1 (geo, igeo, prop_tag, igtyp, prop_id, idtitl, unitab, lsubmodel, ipm, pm, npc, pld)

Function/Subroutine Documentation

◆ hm_read_inject1()

subroutine hm_read_inject1 ( dimension(*), intent(inout) geo,
integer, dimension(*) igeo,
type(prop_tag_), dimension(0:maxprop) prop_tag,
integer, intent(in) igtyp,
integer, intent(in) prop_id,
character(len=nchartitle) idtitl,
type (unit_type_), intent(in) unitab,
type(submodel_data), dimension(*), intent(in) lsubmodel,
integer, dimension(npropmi,nummat), intent(in) ipm,
dimension(npropm,nummat), intent(in) pm,
integer, dimension(*), intent(in) npc,
dimension(*), intent(in) pld )

Definition at line 43 of file hm_read_inject1.F.

46C============================================================================
47C M o d u l e s
48C-----------------------------------------------
49 USE unitab_mod
50 USE elbuftag_mod
51 USE message_mod
52 USE submodel_mod
55C-----------------------------------------------
56C I m p l i c i t T y p e s
57C-----------------------------------------------
58#include "implicit_f.inc"
59C-----------------------------------------------
60C C o m m o n B l o c k s
61C-----------------------------------------------
62#include "units_c.inc"
63#include "param_c.inc"
64#include "com04_c.inc"
65#include "tablen_c.inc"
66C-----------------------------------------------
67C D u m m y A r g u m e n t s
68C-----------------------------------------------
69 TYPE (UNIT_TYPE_),INTENT(IN) ::UNITAB
70 INTEGER IGEO(*)
71 INTEGER ,INTENT(IN) :: IGTYP,PROP_ID,IPM(NPROPMI,NUMMAT),NPC(*)
72 my_real, INTENT(IN) :: pld(*),pm(npropm,nummat)
73 my_real, INTENT(INOUT) :: geo(*)
74 CHARACTER(LEN=NCHARTITLE)::IDTITL
75 TYPE(PROP_TAG_) , DIMENSION(0:MAXPROP) :: PROP_TAG
76 TYPE(SUBMODEL_DATA),INTENT(IN)::LSUBMODEL(*)
77C-----------------------------------------------
78C L o c a l V a r i a b l e s
79C-----------------------------------------------
80 INTEGER IG,I,J,K,NGASES,IFLOW,IJET,NOD1,NOD2,NOD3,
81 . ICURPT
82 INTEGER MAT_ID(2,100),F_IDMASS(2,100),F_IDTEMP(2,100),
83 . F_IDMF(2,100),MW_MIXTURE,MW_MIXTURE_OK,
84 . NB_POINTS,NB_POINTS_1,NB_POINTS_OLD,
85 . IFUN_REF,IFUN_TMP,IFUN_TMP_USR
87 . fsmass(100),fstemp(100),astime,
88 . molfr(100),
89 . cpai_mix,cpbi_mix,cpci_mix,cpdi_mix,cpei_mix,cpfi_mix,
90 . mf_tot,mol_tot,mass_tot,mass_ini,mol_ini,mwi_mixture,
91 . stp_gama_mix,stp_temp,mass_mol,init_mass,cpi_mix,
92 . r_igc1, fac_time, fac_mass, fac_temp
93 CHARACTER MESS*40
94 DATA mess/'INJECTOR PROPERTY SET '/
95 DATA stp_temp/293.15/
96 LOGICAL IS_AVAILABLE, IS_ENCRYPTED
97C-----------------------------------------------
98C E x t e r n a l F u n c t i o n s
99C-----------------------------------------------
100 INTEGER NINTRI,USR2SYS
101C=======================================================================
102C
103 is_encrypted = .false.
104 is_available = .false.
105C----------------------
106C FROM LECGEO - GENERAL
107C----------------------
108 igeo( 1)=prop_id
109 igeo(11)=igtyp
110 geo(12) =igtyp+0.1
111C----------------------
112
113 ig=igeo(1)
114 igeo(22)=1 !I_INJECT : Injectors (1:'INJECT1' or 2:'INJECT2')
115
116C Initialisation
117 mat_id=0
118 f_idmass=0
119 f_idtemp=0
120 f_idmf=0
121 molfr=0
122 fsmass=zero
123 fstemp=zero
124 astime=zero
125 cpai_mix=0
126 cpbi_mix=0
127 cpci_mix=0
128 cpdi_mix=0
129 cpei_mix=0
130 cpfi_mix=0
131 fac_time=one
132C Lecture carte 1
133 CALL hm_get_intv('NIP',ngases,is_available,lsubmodel)
134 CALL hm_get_intv('IFLOW',iflow,is_available,lsubmodel)
135 CALL hm_get_floatv('A_SCALE_X',astime,is_available,lsubmodel,unitab)
136 CALL hm_get_floatv_dim('A_SCALE_X',fac_time,is_available,lsubmodel,unitab)
137
138C Verification
139 IF (ngases<1.OR.100<ngases) THEN
140 CALL ancmsg(msgid=696,
141 . msgtype=msgerror,
142 . anmode=aninfo,
143 . i1=prop_id,
144 . c1=idtitl,
145 . i2=ngases,
146 . i3=100)
147 END IF
148 IF (iflow/=0.AND.iflow/=1) THEN
149 CALL ancmsg(msgid=697,
150 . msgtype=msgerror,
151 . anmode=aninfo,
152 . i1=prop_id,
153 . c1=idtitl)
154 END IF
155C Lecture NGASES cartes
156 IF(ngases>0)THEN
157 CALL hm_get_float_array_index_dim('ABG_Smass',fac_mass,1,is_available,lsubmodel,unitab)
158 CALL hm_get_float_array_index_dim('ABG_Stemp',fac_temp,1,is_available,lsubmodel,unitab)
159 ENDIF
160
161 DO i=1,ngases
162 CALL hm_get_int_array_index('materialIds',mat_id(1,i),i,is_available,lsubmodel)
163 CALL hm_get_int_array_index('ABG_Imass',f_idmass(1,i),i,is_available,lsubmodel)
164 CALL hm_get_int_array_index('ABG_Itemp',f_idtemp(1,i),i,is_available,lsubmodel)
165 CALL hm_get_float_array_index('ABG_Smass',fsmass(i),i,is_available,lsubmodel,unitab)
166 CALL hm_get_float_array_index('ABG_Stemp',fstemp(i),i,is_available,lsubmodel,unitab)
167C Verification existence materiaux et functions
168C ---
169C --- Materiaux
170 IF(fsmass(i) == zero)fsmass(i)=one*fac_mass
171 IF(fstemp(i) == zero)fstemp(i)=one*fac_temp
172 mat_id(2,i) = nintri(mat_id(1,i),ipm,npropmi,nummat,1)
173 IF(mat_id(2,i) == 0) THEN
174 CALL ancmsg(msgid=698,
175 . msgtype=msgerror,
176 . anmode=aninfo_blind_1,
177 . i1=prop_id,
178 . c1=idtitl,
179 . i2=mat_id(1,i))
180 ELSEIF(ipm(2,mat_id(2,i))/=999) THEN
181 CALL ancmsg(msgid=857,
182 . msgtype=msgerror,
183 . anmode=aninfo_blind_1,
184 . i1=prop_id,
185 . c1=idtitl,
186 . i2=mat_id(1,i))
187 END IF
188C --- Fonctions
189 IF(f_idmass(1,i) > 0) THEN
190 DO j=1,nfunct
191 IF(npc(nfunct+1+j) == f_idmass(1,i)) f_idmass(2,i)=j
192 ENDDO
193 ENDIF
194 IF(f_idtemp(1,i) > 0) THEN
195 DO j=1,nfunct
196 IF(npc(nfunct+1+j) == f_idtemp(1,i)) f_idtemp(2,i)=j
197 ENDDO
198 ENDIF
199 IF(f_idmass(1,i)/=0.AND.f_idmass(2,i) == 0)THEN
200 CALL ancmsg(msgid=708,
201 . msgtype=msgerror,
202 . anmode=aninfo_blind_1,
203 . i1=prop_id,
204 . c1=idtitl,
205 . i2=f_idmass(1,i))
206 ENDIF
207 IF(f_idtemp(1,i)/=0.AND.f_idtemp(2,i) == 0)THEN
208 CALL ancmsg(msgid=708,
209 . msgtype=msgerror,
210 . anmode=aninfo_blind_1,
211 . i1=prop_id,
212 . c1=idtitl,
213 . i2=f_idtemp(1,i))
214 ENDIF
215 ENDDO ! i=1,ngases
216
217C Conversion d unites ----------------------
218 IF(astime == zero)astime=one*fac_time
219 r_igc1=pm(27,mat_id(2,1))
220C Verification de la croissance des fonctions de masse
221 DO i=1,ngases
222 ifun_tmp=0
223 ifun_tmp_usr=0
224 IF (igeo(22) == 1) THEN
225 IF (f_idmass(2,i)/=0) THEN
226 ifun_tmp=f_idmass(2,i)
227 ifun_tmp_usr=f_idmass(1,i)
228 END IF
229 ELSE IF (igeo(22) == 2) THEN
230 IF (f_idmf(2,i)/=0) THEN
231 ifun_tmp=f_idmf(2,i)
232 ifun_tmp_usr=f_idmf(1,i)
233 END IF
234 END IF
235 IF (ifun_tmp/=0) THEN
236 IF ((npc(ifun_tmp+1)-npc(ifun_tmp)) >= 4) THEN
237 IF (iflow == 0) THEN
238 DO j = npc(ifun_tmp),npc(ifun_tmp+1)-3,2
239 IF (pld(j+1) > pld(j+3)) THEN
240 CALL ancmsg(msgid=720,
241 . msgtype=msgwarning,
242 . anmode=aninfo_blind_1,
243 . i1=prop_id,
244 . c1=idtitl,
245 . i2=ifun_tmp_usr,i3=i)
246 END IF
247 END DO
248 ELSE IF (iflow == 1) THEN
249 DO j = npc(ifun_tmp),npc(ifun_tmp+1)-1,2
250 IF (pld(j+1) < zero) THEN
251 CALL ancmsg(msgid=721,
252 . msgtype=msgwarning,
253 . anmode=aninfo_blind_1,
254 . i1=prop_id,
255 . c1=idtitl,
256 . i2=ifun_tmp_usr,i3=i)
257 END IF
258 END DO
259 END IF
260 END IF
261 END IF
262 END DO
263
264C Calcul des caracteristiques initiales du melange
265 mwi_mixture=zero
266 cpai_mix=zero
267 cpbi_mix=zero
268 cpci_mix=zero
269 cpdi_mix=zero
270 cpei_mix=zero
271 cpfi_mix=zero
272 mass_ini=zero
273 mol_ini=zero
274 mass_tot=zero
275 mol_tot=zero
276 init_mass=zero
277
278C Calcul de la masse totale
279 DO i=1,ngases
280 IF (f_idmass(2,i) > 0) THEN
281 mass_tot = mass_tot + pld(npc(f_idmass(2,i))+3)*fsmass(i)
282 ENDIF
283 END DO
284 DO i=1,ngases
285C Moyenne simple dans le cas d une masse nulle
286C on considere que chaque gaz arrive avec la meme masse
287C attention dans ce cas la moyenne faite pour mw est :
288C mw = somme (moles) / somme (masses)
289C mw = somme (1/masse_molaire) / somme (masses=1)=ngases
290 IF (mass_tot == zero .OR. f_idmass(2,i) == 0) THEN
291 init_mass=one
292 ELSE
293 init_mass=pld(npc(f_idmass(2,i))+3)*fsmass(i)
294 END IF
295 mol_tot=mol_tot + init_mass/pm(20,mat_id(2,i))
296 cpai_mix = cpai_mix + init_mass*pm(21,mat_id(2,i))
297 cpbi_mix = cpbi_mix + init_mass*pm(22,mat_id(2,i))
298 cpci_mix = cpci_mix + init_mass*pm(23,mat_id(2,i))
299 cpdi_mix = cpdi_mix + init_mass*pm(24,mat_id(2,i))
300 cpei_mix = cpei_mix + init_mass*pm(25,mat_id(2,i))
301 cpfi_mix = cpfi_mix + init_mass*pm(26,mat_id(2,i))
302 END DO
303C on utilise mass tot pour detecter
304C comment calculer init_mass
305 IF (mass_tot == zero) THEN
306 mass_tot=ngases
307 END IF
308 mwi_mixture=mass_tot/mol_tot
309 cpai_mix = cpai_mix / mass_tot
310 cpbi_mix = cpbi_mix / mass_tot
311 cpci_mix = cpci_mix / mass_tot
312 cpdi_mix = cpdi_mix / mass_tot
313 cpei_mix = cpei_mix / mass_tot
314 cpfi_mix = cpfi_mix / mass_tot
315C ------------------------------------------
316 igeo(23)=ngases
317 igeo(24)=iflow
318 DO i=1,ngases
319 igeo(100+(i-1)*3+1)=mat_id(2,i)
320 igeo(100+(i-1)*3+2)=f_idmass(2,i)
321 igeo(100+(i-1)*3+3)=f_idtemp(2,i)
322 END DO
323C ------------------------------------------
324 geo(201)=astime
325 geo(202)=mwi_mixture
326 geo(203)=cpai_mix
327 geo(204)=cpbi_mix
328 geo(205)=cpci_mix
329 geo(206)=cpdi_mix
330 geo(207)=cpei_mix
331 geo(208)=cpfi_mix
332 cpi_mix =cpai_mix
333 . +cpbi_mix*stp_temp
334 . +cpci_mix*stp_temp*stp_temp
335 . +cpdi_mix*stp_temp*stp_temp*stp_temp
336 . +cpei_mix/(stp_temp*stp_temp)
337 . +cpfi_mix*stp_temp*stp_temp*stp_temp*stp_temp
338 stp_gama_mix=cpi_mix/(cpi_mix-r_igc1/mwi_mixture)
339
340 DO i=1,ngases
341 geo(208+(i-1)*2+1)=fsmass(i)
342 geo(208+(i-1)*2+2)=fstemp(i)
343 END DO
344C ------------------------------------------
345 IF(is_encrypted)THEN
346 WRITE(iout,1000)prop_id
347 ELSE
348 WRITE(iout,1100)ig,iflow,astime
349 WRITE(iout,1110)ngases
350 WRITE(iout,1115)mwi_mixture,stp_gama_mix,
351 . cpai_mix,cpbi_mix,cpci_mix,
352 . cpdi_mix,cpei_mix,cpfi_mix
353 DO i=1,ngases
354 WRITE(iout,1120)mat_id(1,i),f_idmass(1,i),f_idtemp(1,i), fsmass(i),fstemp(i)
355 END DO
356 WRITE(iout,'(//)')
357 ENDIF
358C
359C----------------------
360C FROM LECGEO - GENERAL
361C----------------------
362 IF(geo(39)/=zero.AND.igeo( 9)== 0) igeo( 9)=nint(geo(39))
363 IF(geo(171)/=zero.AND.igeo(10)== 0) igeo(10)=nint(geo(171))
364C----------------------
365
366 RETURN
367 1000 FORMAT(
368 & 5x,'INJECTOR PROPERTY SET (/PROP/INJECT1)'/,
369 & 5x,'--------------------------------------',/,
370 & 5x,'PROPERTY SET NUMBER . . . . . . . . . .=',i10,/,
371 & 5x,'CONFIDENTIAL DATA'//)
372 1100 FORMAT(
373 & 5x,'INJECTOR PROPERTY SET (/PROP/INJECT1)'/,
374 & 5x,'PROPERTY SET NUMBER . . . . . . . . . .=',i10,/,
375 & 5x,'INCOMING MASS FLAG FOR FUNCTIONS. . . .=',i10,/,
376 & 5x,'(0:MASS/TIME, 1:MASS FLOW/TIME)',/,
377 & 5x,'ABSCISSA SCALE FACTOR',/,
378 & 5x,' FOR TIME BASED FUNCTIONS . . . . .=',1pg20.13,/)
379 1110 FORMAT(
380 & 5x,'MIXTURE DEFINTION'/,
381 & 5x,'NUMBER OF GASES . . . . . . . . . . . .=',i10,/)
382 1115 FORMAT(
383 & 5x,'INITIAL CHARACTERISTICS OF MIXTURE',/,
384 & 5x,'----------------------------------',/,
385 & 5x,'MOLECULAR WEIGHT. . . . . . . . . . . .=',1pg20.13,/,
386 & 5x,'STP GAMMA . . . . . . . . . . . . . . .=',1pg20.13,/,
387 & 5x,'COEFFICIENT CPA . . . . . . . . . . . .=',1pg20.13,/,
388 & 5x,'COEFFICIENT CPB . . . . . . . . . . . .=',1pg20.13,/,
389 & 5x,'COEFFICIENT CPC . . . . . . . . . . . .=',1pg20.13,/,
390 & 5x,'COEFFICIENT CPD . . . . . . . . . . . .=',1pg20.13,/,
391 & 5x,'COEFFICIENT CPE . . . . . . . . . . . .=',1pg20.13,/,
392 & 5x,'COEFFICIENT CPF . . . . . . . . . . . .=',1pg20.13,/)
393 1120 FORMAT(
394 & 10x,'GAS NUMBER. . . . . . . . . . . . . . .=',i10,/,
395 & 10x,'TIME FUNCTION FOR INCOMING MASS . . . .=',i10,/,
396 & 10x,'TIME FUNCTION FOR INCOMING GAS TEMP . .=',i10,/,
397 & 10x,'SCALE FACTOR FOR INCOMING MASS. . . . .=',1pg20.13,/,
398 & 10x,'SCALE FACTOR FOR INCOMING GAS TEMP. . .=',1pg20.13,/)
399 999 CALL freerr(3)
400 RETURN
#define my_real
Definition cppsort.cpp:32
subroutine hm_get_float_array_index(name, rval, index, is_available, lsubmodel, unitab)
subroutine hm_get_float_array_index_dim(name, dim_fac, index, is_available, lsubmodel, unitab)
subroutine hm_get_floatv(name, rval, is_available, lsubmodel, unitab)
subroutine hm_get_floatv_dim(name, dim_fac, 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)
integer, parameter nchartitle
integer function nintri(iext, antn, m, n, m1)
Definition nintrr.F:46
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
subroutine freerr(it)
Definition freform.F:506