OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
hm_read_eos_ideal_gas.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_eos_ideal_gas ../starter/source/materials/eos/hm_read_eos_ideal_gas.F
25!||--- called by ------------------------------------------------------
26!|| hm_read_eos ../starter/source/materials/eos/hm_read_eos.F
27!||--- calls -----------------------------------------------------
28!|| ancmsg ../starter/source/output/message/message.F
29!|| hm_get_floatv ../starter/source/devtools/hm_reader/hm_get_floatv.F
30!|| hm_option_is_encrypted ../starter/source/devtools/hm_reader/hm_option_is_encrypted.F
31!||--- uses -----------------------------------------------------
32!|| message_mod ../starter/share/message_module/message_mod.F
33!|| submodel_mod ../starter/share/modules1/submodel_mod.F
34!||====================================================================
35 SUBROUTINE hm_read_eos_ideal_gas(IOUT,PM,UNITAB,IUNIT,LSUBMODEL,IMIDEOS,MAT_PARAM)
36C-----------------------------------------------
37C M o d u l e s
38C-----------------------------------------------
39 USE unitab_mod
40 USE submodel_mod
41 USE message_mod
42 USE matparam_def_mod, ONLY : matparam_struct_
43C-----------------------------------------------
44C D e s c r i p t i o n
45C-----------------------------------------------
46C reading parameters for
47C IDEAL-GAS EQUATION OF STATE
48C-----------------------------------------------
49C C o m m e n t s
50C-----------------------------------------------
51C RHOI = PM(89) -> provided by /MAT
52C RHOR = PM(01) -> provided by /MAT (can be erased by EOS if present : obsolete)
53C => MU0 = RHO/RHOR-1.
54C PM(31) = P(MU0,E0) -> will be used to initialize diagonal of stress tensor SIG(1:3,*)
55C-----------------------------------------------
56C I m p l i c i t T y p e s
57C-----------------------------------------------
58#include "implicit_f.inc"
59C-----------------------------------------------
60C D u m m y A r g u m e n t s
61C-----------------------------------------------
62 TYPE (UNIT_TYPE_),INTENT(IN) ::UNITAB
63 INTEGER IIN,IOUT,IUNIT
64 my_real pm(npropm)
65 TYPE(submodel_data), DIMENSION(NSUBMOD), INTENT(IN) :: LSUBMODEL
66 INTEGER,INTENT(IN) :: IMIDEOS
67 TYPE(matparam_struct_),INTENT(INOUT) :: MAT_PARAM
68C-----------------------------------------------
69C C o m m o n B l o c k s
70C-----------------------------------------------
71#include "param_c.inc"
72C-----------------------------------------------
73C L o c a l V a r i a b l e s
74C-----------------------------------------------
75 my_real gamma, p0,t0, e0, psh, rho0,fac_l,fac_t,fac_m,fac_c,cv,mu0,pp,rhoi,rhor,g0,ssp0,dpdmu,df
76 LOGICAL :: IS_ENCRYPTED, IS_AVAILABLE, IS_AVAILABLE_RHO0
77C-----------------------------------------------
78C S o u r c e L i n e s
79C-----------------------------------------------
80 is_encrypted = .false.
81 is_available = .false.
82 is_available_rho0 = .false.
83
84 CALL hm_option_is_encrypted(is_encrypted)
85
86 CALL hm_get_floatv('Gamma', gamma, is_available,lsubmodel,unitab)
87 CALL hm_get_floatv('LAW5_P0', p0, is_available,lsubmodel,unitab)
88 CALL hm_get_floatv('LAW5_PSH', psh, is_available,lsubmodel,unitab)
89 CALL hm_get_floatv('T_Initial', t0, is_available,lsubmodel,unitab)
90 CALL hm_get_floatv('Refer_Rho', rho0, is_available_rho0,lsubmodel,unitab)
91
92 rhor = pm(1)
93 rhoi = pm(89)
94
95 IF(rho0 > zero) THEN
96 rhor = rho0
97 pm(1)= rho0
98 ELSE
99 rho0=rhor
100 ENDIF
101
102 IF(rhoi == zero)THEN
103 mu0 = zero ! error 683 already displayed
104 ELSE
105 IF(rhor /= zero)THEN
106 mu0 = rhoi/rhor-one
107 ELSE
108 mu0 = zero ! error 683 already displayed
109 ENDIF
110 ENDIF
111
112 IF(rhoi /= zero)THEN
113 df = rhor/rhoi
114 ELSE
115 df = zero
116 ENDIF
117
118 IF(gamma > one) THEN
119 e0 = p0/(gamma-one)/(one+mu0)
120 ELSE
121 e0 = zero !manage this error below
122 ENDIF
123
124 !ERREURS :
125 ! P0 <=0
126 ! GAMMA <=ONE
127 IF(p0 <= zero)THEN
128 CALL ancmsg(msgid=67,msgtype=msgerror,anmode=aninfo,
129 . i1=imideos,
130 . c1='/EOS/IDEAL-GAS',
131 . c2='INITIAL PRESSURE MUST BE POSITIVE')
132 ENDIF
133
134 IF(gamma <= one)THEN
135 CALL ancmsg(msgid=67,msgtype=msgerror,anmode=aninfo,
136 . i1=imideos,
137 . c1='/EOS/IDEAL-GAS',
138 . c2='SPECIFIC HEAT RATIO (GAMMA) MUST BE GREATER THAN 1.0')
139 ENDIF
140
141 IF(t0 == zero)t0=three100
142 cv = zero
143 IF(rho0*t0 /= zero) THEN
144 ! this situation is not expected unless in case of input inconsistency (eos_uid does not match mat_uid)
145 cv = e0/rho0/t0
146 ENDIF
147
148 pm(32) = gamma
149 pm(88) = psh
150 pm(23) = e0
151 pm(35) = t0
152 pm(36) = cv
153 pm(31) = p0-psh
154 pm(79) = t0
155 pm(104)=p0-psh
156
157 mat_param%EOS%Cv = cv
158 mat_param%EOS%Cp = gamma * cv
159
160 !SSP0
161 ssp0 = zero
162 g0 = pm(22)
163 rhoi = pm(89)
164 dpdmu = (gamma-one)*e0+(one+mu0)*(gamma-one)*df*df*(pm(31)+psh)
165
166 dpdmu=max(zero,dpdmu)
167 IF(rhor > zero) ssp0 = sqrt((dpdmu + two_third*g0)/rhor)
168 pm(27)=ssp0
169
170 WRITE(iout,1000)
171
172 IF(is_encrypted)THEN
173 WRITE(iout,'(5X,A,//)')'CONFIDENTIAL DATA'
174 ELSE
175 WRITE(iout,1500)gamma,p0,psh,t0,e0,cv
176 ENDIF
177 IF(is_available_rho0)WRITE(iout,1501)pm(1)
178
179 RETURN
180 1000 FORMAT(
181 & 5x,' IDEAL GAS EOS ',/,
182 & 5x,' ------------- ',/)
183 1500 FORMAT(
184 & 5x,'GAMMA . . . . . . . . . . . . . . . . . .=',1pg20.13/,
185 & 5x,'P0. . . . . . . . . . . . . . . . . . . .=',1pg20.13/,
186 & 5x,'PSH . . . . . . . . . . . . . . . . . . .=',1pg20.13/,
187 & 5x,'T0. . . . . . . . . . . . . . . . . . . .=',1pg20.13/,
188 & 5x,'E0. . . . . . . . . . . . . . . . . . . .=',1pg20.13/,
189 & 5x,'COMPUTED HEAT CAPACITY (Cv) . . . . . . .=',1pg20.13)
190 1501 FORMAT(
191 & 5x,'EOS REFERENCE DENSITY . . . . . . . . . .=',1pg20.13)
192
193 RETURN
194
195 END SUBROUTINE hm_read_eos_ideal_gas
#define my_real
Definition cppsort.cpp:32
subroutine hm_get_floatv(name, rval, is_available, lsubmodel, unitab)
subroutine hm_option_is_encrypted(is_encrypted)
subroutine hm_read_eos_ideal_gas(iout, pm, unitab, iunit, lsubmodel, imideos, mat_param)
#define max(a, b)
Definition macros.h:21
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