OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
hm_read_eos_ideal_gas_vt.F File Reference
#include "implicit_f.inc"
#include "param_c.inc"

Go to the source code of this file.

Functions/Subroutines

subroutine hm_read_eos_ideal_gas_vt (iout, pm, unitab, iunit, lsubmodel, imideos)

Function/Subroutine Documentation

◆ hm_read_eos_ideal_gas_vt()

subroutine hm_read_eos_ideal_gas_vt ( integer iout,
pm,
type (unit_type_), intent(in) unitab,
integer iunit,
type(submodel_data), dimension(nsubmod), intent(in) lsubmodel,
integer, intent(in) imideos )

Definition at line 35 of file hm_read_eos_ideal_gas_vt.F.

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