OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
hm_read_monvol_type2.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_monvol_type2_mod ../starter/source/airbag/hm_read_monvol_type2.F
25!||--- called by ------------------------------------------------------
26!|| read_monvol ../starter/source/airbag/read_monvol.F
27!||====================================================================
29 CONTAINS
30!||====================================================================
31!|| hm_read_monvol_type2 ../starter/source/airbag/hm_read_monvol_type2.F
32!||--- called by ------------------------------------------------------
33!|| read_monvol ../starter/source/airbag/read_monvol.f
34!||--- calls -----------------------------------------------------
35!|| ancmsg ../starter/source/output/message/message.F
36!|| freerr ../starter/source/starter/freform.F
37!|| hm_get_floatv ../starter/source/devtools/hm_reader/hm_get_floatv.F
38!|| hm_get_intv ../starter/source/devtools/hm_reader/hm_get_intv.f
39!|| monvol_check_surfclose ../starter/share/modules1/monvol_struct_mod.F
40!|| monvol_compute_volume ../starter/share/modules1/monvol_struct_mod.F
41!|| monvol_orient_surf ../starter/share/modules1/monvol_struct_mod.F
42!|| monvol_reverse_normals ../starter/share/modules1/monvol_struct_mod.F
43!||--- uses -----------------------------------------------------
44!|| message_mod ../starter/share/message_module/message_mod.F
45!|| monvol_struct_mod ../starter/share/modules1/monvol_struct_mod.F
46!|| submodel_mod ../starter/share/modules1/submodel_mod.F
47!||====================================================================
48 SUBROUTINE hm_read_monvol_type2(T_MONVOLN,
49 . UNITAB, LUID, NPC, IGRSURF,
50 . ITAB, X, PM, GEO, IXC, IXTG,LSUBMODEL)
51C-----------------------------------------------
52C M o d u l e s
53C-----------------------------------------------
54 USE unitab_mod
55 USE groupdef_mod
56 USE message_mod
58 USE submodel_mod
59 USE unitab_mod
60 use element_mod , only : nixc,nixtg
61C-----------------------------------------------
62C I m p l i c i t T y p e s
63C-----------------------------------------------
64#include "implicit_f.inc"
65C-----------------------------------------------
66C C o m m o n B l o c k s
67C-----------------------------------------------
68C NSURF, NFUNCT
69#include "com04_c.inc"
70C KMONVO, IREC
71C NIMV, NRVOLU
72#include "param_c.inc"
73C IIN
74#include "units_c.inc"
75C-----------------------------------------------
76C D u m m y A r g u m e n t s
77C-----------------------------------------------
78 TYPE(UNIT_TYPE_), INTENT(IN) :: UNITAB
79 INTEGER, INTENT(IN) :: LUID
80 INTEGER, INTENT(IN) :: NPC(*), ITAB(*), IXC(NIXC, *), IXTG(NIXTG, *)
81 my_real, INTENT(IN) :: x(3, *), geo(npropg, *), pm(npropm, *)
82 TYPE (SURF_), INTENT(INOUT), DIMENSION(NSURF) :: IGRSURF
83 TYPE(monvol_struct_), INTENT(INOUT) :: T_MONVOLN
84 TYPE(submodel_data), DIMENSION(NSUBMOD), INTENT(IN) :: LSUBMODEL
85C-----------------------------------------------
86C L o c a l V a r i a b l e s
87C-----------------------------------------------
88 INTEGER :: II
89 INTEGER :: SURFID, IFUNC, ITYPFUN, LOC_IFUNC
90 my_real :: ffunc, fac_m, fac_l, fac_t, fac_c
91 my_real :: scal_t, scal_p, scal_s, scal_a, scal_d
92 LOGICAL :: FOUND
93 my_real :: sa, rot, vol, vmin, veps, amu, sv
94 LOGICAL :: IS_AVAILABLE
95C-----------------------------------------------
96C B e g i n n i n g o f s o u r c e
97C-----------------------------------------------
98C =======
99C Reading
100C =======
101C Line 1
102 CALL hm_get_intv('entityiddisplayed', surfid, is_available, lsubmodel)
103C Line 2
104 CALL hm_get_floatv('Scal_T', scal_t, is_available, lsubmodel, unitab)
105C Line 3
106 CALL hm_get_intv('FUN_A1', ifunc, is_available, lsubmodel)
107 CALL hm_get_floatv('Ffunc', ffunc, is_available, lsubmodel, unitab)
108 CALL hm_get_intv('Itype', itypfun, is_available, lsubmodel)
109C ================
110C Check operations
111C ================
112C External surface check
113 t_monvoln%IVOLU(4) = 0
114 found = .false.
115 DO ii = 1, nsurf
116 IF (surfid == igrsurf(ii)%ID) THEN
117 t_monvoln%IVOLU(4) = ii
118 t_monvoln%EXT_SURFID = ii
119 found = .true.
120 EXIT
121 ENDIF
122 ENDDO
123 IF (.NOT. found) THEN
124 CALL freerr(3)
125 ELSEIF (igrsurf(t_monvoln%EXT_SURFID)%ISH4N3N == 0) THEN
126 CALL ancmsg(msgid = 18, anmode = aninfo, msgtype = msgerror,
127 . i1 = t_monvoln%ID, c1 = t_monvoln%TITLE, i2 = surfid)
128 CALL freerr(3)
129 ENDIF
130
131C Check surface closure
132 CALL monvol_check_surfclose(t_monvoln, itab, igrsurf(t_monvoln%EXT_SURFID), x)
133C Set all normal on same side
134 CALL monvol_orient_surf(t_monvoln, t_monvoln%TITLE, t_monvoln%IVOLU, itab,
135 . igrsurf(t_monvoln%EXT_SURFID),ixc, ixtg, x, 2)
136C Compute Monvon volume
137 CALL monvol_compute_volume(t_monvoln, t_monvoln%TITLE, t_monvoln%IVOLU, igrsurf(t_monvoln%EXT_SURFID),
138 . itab, x, pm, geo, ixc, ixtg,
139 . sa, rot, vol, vmin, veps, sv)
140C Reverse all normals to ensure positive volume
141 CALL monvol_reverse_normals(t_monvoln, t_monvoln%TITLE, t_monvoln%IVOLU, itab,
142 . igrsurf(t_monvoln%EXT_SURFID),ixc,ixtg,vol, x, 2)
143
144C Function id check
145 found = .false.
146 loc_ifunc = 0
147 DO ii = 1, nfunct
148 IF (ifunc == npc(ii)) THEN
149 loc_ifunc = ii
150 found = .true.
151 EXIT
152 ENDIF
153 ENDDO
154 IF (.NOT. found) THEN
155 CALL ancmsg(msgid = 9, anmode = aninfo, msgtype = msgerror,
156 . i2 = ifunc, i1 = t_monvoln%ID, c1 = t_monvoln%TITLE, c2 = 'PRESSURE')
157 ENDIF
158C =====
159C Units
160C =====
161 fac_m = unitab%FAC_M(luid)
162 fac_l = unitab%FAC_L(luid)
163 fac_t = unitab%FAC_T(luid)
164 fac_c = fac_m / (fac_l * fac_t * fac_t)
165C Default value for time scale factor
166 IF (scal_t == zero) THEN
167 scal_t = one * fac_t
168 ENDIF
169 scal_p = one * fac_c
170 scal_s = one * fac_l * fac_l
171 scal_a = one
172 scal_d = one * fac_l
173C Default value for FFUNC
174 IF (ffunc == zero) THEN
175 ffunc = one * fac_c
176 ENDIF
177
178C =====
179C Store
180C =====
181 t_monvoln%RVOLU(15) = ffunc
182C Store in data structure
183 t_monvoln%RVOLU(26) = one / scal_t
184 t_monvoln%RVOLU(27) = one / scal_p
185 t_monvoln%RVOLU(28) = one / scal_s
186 t_monvoln%RVOLU(29) = one / scal_a
187 t_monvoln%RVOLU(30) = one / scal_d
188C
189 t_monvoln%RVOLU(3) = zero
190 veps = max(zero, vmin - vol)
191 t_monvoln%RVOLU(4) = vol + veps
192 t_monvoln%RVOLU(5) = zero
193 t_monvoln%RVOLU(12) = zero
194 t_monvoln%RVOLU(17) = veps
195 t_monvoln%IVOLU(7) = loc_ifunc
196 t_monvoln%IVOLU(19) = itypfun
197C
198 amu = zero
199 t_monvoln%RVOLU(2) = amu
200 t_monvoln%RVOLU(16) = vol + veps
201 t_monvoln%RVOLU(18) = sa
202 t_monvoln%RVOLU(21) = rot
203 t_monvoln%RVOLU(22:24) = zero
204
205C =========
206C Print out
207C =========
208 WRITE(iout, 1005) surfid
209 WRITE(iout, 1003) scal_t, scal_p, scal_s, scal_a, scal_d
210 WRITE(iout, 1002) sa, sv, vol
211 WRITE(iout,1200) ifunc, itypfun
212C-----------------------------------------------
213C E n d o f s o u r c e
214C-----------------------------------------------
215
216 RETURN
217 1002 FORMAT(
218 . /5x,'INITIAL SURFACE OF MONITORED VOLUME . .=',1pg20.13,
219 . /5x,'SURFACE ERROR(NE.0 FOR NON CLOSED SURF)=',1pg20.13,
220 . /5x,'INITIAL VOLUME OF MONITORED VOLUME. . .=',1pg20.13)
221 1003 FORMAT(
222 . 5x,'UNIT SCALE FOR TIME FUNCTIONS =',1pg20.13,
223 . /5x,'UNIT SCALE FOR PRESSURE FUNCTIONS =',1pg20.13,
224 . /5x,'UNIT SCALE FOR AREA FUNCTIONS =',1pg20.13,
225 . /5x,'UNIT SCALE FOR ANGLE FUNCTIONS =',1pg20.13,
226 . /5x,'UNIT SCALE FOR DISTANCE FUNCTIONS =',1pg20.13)
227 1005 FORMAT( 5x,'EXTERNAL SURFACE ID . . . . . . . . . .=',i10)
228 1200 FORMAT( 5x,'LOAD CURVE NUMBER . . . . . . . . . . .=',i10,
229 . /5x,'CURVE TYPE . . . . . . . . . . . . . .=',i10,
230 . /5x,' 0 : P=F(1/V)',
231 . /5x,' 1 : P=F(T)',
232 . /5x,' 2 : P=F(V)',
233 . /5x,' 3 : P=(1/V) F(T)'/)
234 END SUBROUTINE hm_read_monvol_type2
235 END MODULE hm_read_monvol_type2_mod
#define my_real
Definition cppsort.cpp:32
subroutine hm_get_floatv(name, rval, is_available, lsubmodel, unitab)
subroutine hm_get_intv(name, ival, is_available, lsubmodel)
#define max(a, b)
Definition macros.h:21
subroutine hm_read_monvol_type2(t_monvoln, unitab, luid, npc, igrsurf, itab, x, pm, geo, ixc, ixtg, lsubmodel)
subroutine monvol_compute_volume(t_monvoln, title, ivolu, surf, itab, node_coord, pm, geo, ixc, ixtg, sa, rot, vol, vmin, veps, sv)
subroutine monvol_check_surfclose(t_monvoln, itab, surf, x)
subroutine read_monvol(t_monvol, t_monvol_metadata, itab, itabm1, ipm, igeo, x, pm, geo, ixc, ixtg, sensors, unitab, npc, npt, pld, igrsurf, igrbric, nom_opt, iframe, xframe, lsubmodel)
Definition read_monvol.F:66
subroutine monvol_orient_surf(t_monvoln, title, ivolu, itab, surf, ixc, ixtg, x, itype)
subroutine monvol_reverse_normals(t_monvoln, title, ivolu, itab, surf, ixc, ixtg, vol, x, itype)
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
subroutine freerr(it)
Definition freform.F:501
program starter
Definition starter.F:39