OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
hm_read_eos_ideal_gas_vt.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_vt ../starter/source/materials/eos/hm_read_eos_ideal_gas_vt.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_vt(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 WITH CP(T) FUNCTION
48C Cp(T) = A0 + A1.T + A2.T^2 + A3.T^3 + A4.T^4 + A5.T^5
49C
50C clarification :
51C Cp : J/K/kg
52C Cv : J/K/kg
53C R : J.K/mol
54C r : J/kg/K
55C-----------------------------------------------
56C C o m m e n t s
57C-----------------------------------------------
58C RHOI = PM(89) -> provided by /MAT
59C RHOR = PM(01) -> provided by /MAT (can be erased by EOS if present : obsolete)
60C => MU0 = RHO/RHOR-1.
61C PM(31) = P(MU0,T0) -> will be used to initialize diagonal of stress tensor SIG(1:3,*)
62C-----------------------------------------------
63C I m p l i c i t T y p e s
64C-----------------------------------------------
65#include "implicit_f.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 IIN,IOUT,IUNIT
71 my_real pm(npropm)
72 TYPE(submodel_data), DIMENSION(NSUBMOD), INTENT(IN) :: LSUBMODEL
73 TYPE(matparam_struct_),INTENT(INOUT) :: MAT_PARAM
74 INTEGER,INTENT(IN) :: IMIDEOS
75C-----------------------------------------------
76C C o m m o n B l o c k s
77C-----------------------------------------------
78#include "param_c.inc"
79C-----------------------------------------------
80C L o c a l V a r i a b l e s
81C-----------------------------------------------
82 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
83 my_real :: r_gas,r_gas_, m_gas, a0, a1, a2, a3, a4, a5, cp
84 INTEGER :: USER_CURVEID, CURVEID, JJ
85 LOGICAL :: IS_ENCRYPTED, IS_AVAILABLE, IS_AVAILABLE_RHO0
86C-----------------------------------------------
87C S o u r c e L i n e s
88C-----------------------------------------------
89 is_encrypted = .false.
90 is_available = .false.
91 is_available_rho0 = .false.
92
93 CALL hm_option_is_encrypted(is_encrypted)
94
95 gamma=zero
96
97 CALL hm_get_floatv('MAT_R', r_gas_, is_available,lsubmodel,unitab)
98 CALL hm_get_floatv('LAW5_P0', p0, is_available,lsubmodel,unitab)
99 CALL hm_get_floatv('LAW5_PSH', psh, is_available,lsubmodel,unitab)
100 CALL hm_get_floatv('T_Initial', t0, is_available,lsubmodel,unitab)
101 CALL hm_get_floatv('Refer_Rho', rho0, is_available_rho0,lsubmodel,unitab)
102 CALL hm_get_floatv('MAT_C0', a0, is_available,lsubmodel,unitab)
103 CALL hm_get_floatv('MAT_C1', a1, is_available,lsubmodel,unitab)
104 CALL hm_get_floatv('MAT_C2', a2, is_available,lsubmodel,unitab)
105 CALL hm_get_floatv('MAT_C3', a3, is_available,lsubmodel,unitab)
106 CALL hm_get_floatv('MAT_C4', a4, is_available,lsubmodel,unitab)
107
108 rhor = pm(1)
109 rhoi = pm(89)
110
111 IF(rho0 > zero) THEN
112 rhor = rho0
113 pm(1)= rho0
114 mat_param%RHO = rho0
115 ELSE
116 rho0=rhor
117 ENDIF
118
119 IF(p0*t0 /= zero)THEN
120 CALL ancmsg(msgid=67,msgtype=msgerror,anmode=aninfo,
121 . i1=imideos,
122 . c1='/EOS/IDEAL-GAS-VT',
123 . c2='P0 AND T0 CANNOT BE BOTH DEFINED')
124 ENDIF
125
126 IF(r_gas_ <= zero)THEN
127 CALL ancmsg(msgid=67,msgtype=msgerror,anmode=aninfo,i1=imideos,
128 . c1='/EOS/IDEAL-GAS-VT',
129 . c2='GAS CONSTANT r MUST BE STRICTLY POSITIVE')
130 p0 = zero
131 ELSE
132 ! P0= rho0.r.T0
133 ! r = r/m
134 IF(t0 > zero) THEN
135 p0 = r_gas_ * rho0 * t0
136 ELSEIF(p0 /= zero .AND. rho0 /= zero)THEN
137 t0 = p0/r_gas_/rho0
138 ELSE
139 t0=0
140 p0=zero
141 ENDIF
142
143 ENDIF
144
145 IF(p0 <= zero)THEN
146 CALL ancmsg(msgid=67,msgtype=msgerror,anmode=aninfo,
147 . i1=imideos,
148 . c1='/EOS/IDEAL-GAS-VT',
149 . c2='INITIAL PRESSURE MUST BE POSITIVE')
150 ENDIF
151
152 IF(t0 < zero)THEN
153 CALL ancmsg(msgid=67,msgtype=msgerror,anmode=aninfo,
154 . i1=imideos,
155 . c1='/EOS/IDEAL-GAS-VT',
156 . c2='TEMPERATURE MUST BE POSITIVE (UNIT:KELVIN)')
157 ENDIF
158
159
160 IF(rhoi == zero)THEN
161 mu0 = zero ! error 683 already displayed
162 ELSE
163 IF(rhor /= zero)THEN
164 mu0 = rhoi/rhor-one
165 ELSE
166 mu0 = zero ! error 683 already displayed
167 ENDIF
168 ENDIF
169
170 IF(rhoi /= zero)THEN
171 df = rhor/rhoi
172 ELSE
173 df = zero
174 ENDIF
175
176 cp = a0 + a1*t0 + a2*t0*t0 + a3*t0**3 + a4*t0**4
177
178 IF(cp < r_gas_)THEN
179 CALL ancmsg(msgid=67,msgtype=msgerror,anmode=aninfo,
180 . i1=imideos,
181 . c1='/EOS/IDEAL-GAS-VT',
182 . c2='Cp(0) < r IS NOT EXPECTED. CHECK INPUT FUNCTION')
183 ENDIF
184
185 e0 = rho0 * (a0 * t0 + half * a1 * t0**2 + third * a2 * t0**3 + fourth * a3 * t0**4 +
186 . one_fifth * a4 * t0**5 - r_gas_ * t0)
187
188 pm(88) = psh
189 pm(23) = e0
190 pm(31) = p0-psh !used to init stress tensor
191 pm(32) = a0
192 pm(104)=p0-psh
193
194 mat_param%EOS%NUPARAM = 7
195 mat_param%EOS%NIPARAM = 0
196 mat_param%EOS%NFUNC = 0
197 mat_param%EOS%NTABLE = 0
198 CALL mat_param%EOS%CONSTRUCT() !allocations
199
200 mat_param%EOS%UPARAM(1) = a0
201 mat_param%EOS%UPARAM(2) = a1
202 mat_param%EOS%UPARAM(3) = a2
203 mat_param%EOS%UPARAM(4) = a3
204 mat_param%EOS%UPARAM(5) = a4
205 mat_param%EOS%UPARAM(6) = r_gas_ ! r=R_GAS/M
206 mat_param%EOS%UPARAM(7) = p0-psh
207 IF (t0 == zero) t0 = three100
208 mat_param%THERM%TINI =three100
209 pm(79) = three100
210
211 !SSP0
212 cv = cp - r_gas_
213 IF(cv /= zero)THEN
214 gamma = cp/cv
215 ELSE
216 gamma = zero ! this error is managed above (CP < r_GAS_)
217 ENDIF
218
219 mat_param%EOS%PSH = psh
220 mat_param%EOS%CV = cv
221 mat_param%EOS%E0 = e0
222
223 ssp0 = sqrt(gamma*r_gas_*t0)
224 g0 = pm(22) ! 0.0 with physical input.However mathematical model allows any positive value.
225 rhoi = pm(89)
226 dpdmu = rho0*gamma*r_gas_*t0
227
228 dpdmu=max(zero,dpdmu)
229 IF(rhor > zero) ssp0 = sqrt((dpdmu + two_third*g0)/rhor)
230 pm(27)=ssp0
231
232 WRITE(iout,1000)
233
234 IF(is_encrypted)THEN
235 WRITE(iout,'(5X,A,//)')'CONFIDENTIAL DATA'
236 ELSE
237 WRITE(iout,1500)r_gas_,t0,p0,psh,cp,a0,a1,a2,a3,a4
238 IF(is_available_rho0)WRITE(iout,1501)pm(1)
239 ENDIF
240
241 RETURN
242 1000 FORMAT(
243 & 5x,' IDEAL GAS EOS (VOLUME-TEMPERATURE) : P=rho.r.T ',/,
244 & 5x,' ---------------------------------------------- ',/)
245 1500 FORMAT(
246 & 5x,'GAS CONSTANT (r). . . . . . . . . . . . .=',1pg20.13/,
247 & 5x,'INITIAL TEMPERATURE . . . . . . . . . . .=',1pg20.13/,
248 & 5x,'INITIAL PRESSURE. . . . . . . . . . . . .=',1pg20.13/,
249 & 5x,'PRESSURE SHIFT. . . . . . . . . . . . . .=',1pg20.13/,
250 & 5x,'INITIAL MASSIC HEAT CAPACTITY . . . . . .=',1pg20.13/,
251 & 5x,'A0. . . . . . . . . . . . . . . . . . . .=',1pg20.13/,
252 & 5x,'A1. . . . . . . . . . . . . . . . . . . .=',1pg20.13/,
253 & 5x,'A2. . . . . . . . . . . . . . . . . . . .=',1pg20.13/,
254 & 5x,'A3. . . . . . . . . . . . . . . . . . . .=',1pg20.13/,
255 & 5x,'A4. . . . . . . . . . . . . . . . . . . .=',1pg20.13)
256 1501 FORMAT(
257 & 5x,'EOS REFERENCE DENSITY . . . . . . . . . .=',1pg20.13)
258
259 RETURN
260
261 END SUBROUTINE hm_read_eos_ideal_gas_vt
#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_vt(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:895