OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
hm_read_eos_stiffened_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_stiffened_gas ../starter/source/materials/eos/hm_read_eos_stiffened_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_stiffened_gas(IOUT,PM,UNITAB,IUNIT,LSUBMODEL,IMIDEOS)
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 LINEAR EQUATION OF STATE
47C-----------------------------------------------
48C C o m m e n t s
49C-----------------------------------------------
50C RHOI = PM(89) -> provided by /MAT
51C RHOR = PM(01) -> provided by /MAT (can be erased by EOS if present : obsolete)
52C => MU0 = RHO/RHOR-1.
53C PM(31) = P(MU0,E0) -> will be used to initialize diagonal of stress tensor SIG(1:3,*)
54C-----------------------------------------------
55C I m p l i c i t T y p e s
56C-----------------------------------------------
57#include "implicit_f.inc"
58C-----------------------------------------------
59C D u m m y A r g u m e n t s
60C-----------------------------------------------
61 TYPE (UNIT_TYPE_),INTENT(IN) ::UNITAB
62 INTEGER IIN,IOUT,IUNIT
63 my_real pm(npropm)
64 TYPE(submodel_data), DIMENSION(NSUBMOD), INTENT(IN) :: LSUBMODEL
65 INTEGER,INTENT(IN) :: IMIDEOS
66C-----------------------------------------------
67C C o m m o n B l o c k s
68C-----------------------------------------------
69#include "param_c.inc"
70C-----------------------------------------------
71C L o c a l V a r i a b l e s
72C-----------------------------------------------
73 my_real gamma, p0, e0, psh, rho0,fac_l,fac_t,fac_m,fac_c,pstar,rhoi,rhor,mu0,pp,df,ssp0,g0,dpdmu
74 LOGICAL :: IS_ENCRYPTED, IS_AVAILABLE, IS_AVAILABLE_RHO0
75C-----------------------------------------------
76C S o u r c e L i n e s
77C-----------------------------------------------
78 is_encrypted = .false.
79 is_available = .false.
80 is_available_rho0 = .false.
81
82 CALL hm_option_is_encrypted(is_encrypted)
83
84 CALL hm_get_floatv('Gamma', gamma, is_available,lsubmodel,unitab)
85 CALL hm_get_floatv('LAW5_P0', p0, is_available,lsubmodel,unitab)
86 CALL hm_get_floatv('LAW5_PSH', psh, is_available,lsubmodel,unitab)
87 CALL hm_get_floatv('P_star', pstar, is_available,lsubmodel,unitab)
88 CALL hm_get_floatv('Refer_Rho', rho0, is_available_rho0,lsubmodel,unitab)
89
90 rhor = pm(1)
91 rhoi = pm(89)
92
93 IF(rho0 > zero) THEN
94 rhor = rho0
95 pm(1)= rho0
96 ELSE
97 rho0=rhor
98 ENDIF
99
100 IF(gamma /= one)THEN
101 e0=(p0+gamma*pstar)/(gamma-one)
102 ELSE
103 e0 = zero ! error managed below
104 ENDIf
105
106 !ERREURS :
107 ! GAMMA <=0
108
109 IF(gamma <= one)THEN
110 CALL ancmsg(msgid=67,msgtype=msgerror,anmode=aninfo,i1=imideos,c1='/EOS/STIFF-GAS',c2='GAMMA MUST BE GREATER THAN 1.0')
111 ENDIF
112
113
114 pm(34)=gamma
115 pm(32)=p0
116 pm(88)=psh
117 pm(23)=e0
118 pm(35)=pstar
119
120 !P0
121 IF(rhoi == zero)THEN
122 mu0 = zero ! error 683 already displayed
123 ELSE
124 IF(rhor /= zero)THEN
125 mu0 = rhoi/rhor-one
126 ELSE
127 mu0 = zero ! error 683 already displayed
128 ENDIF
129 ENDIF
130
131 IF(rhoi /= zero)THEN
132 df = rhor/rhoi
133 ELSE
134 df = zero
135 ENDIF
136
137 pp = -gamma*pstar-psh + (gamma-one)*(one+mu0)*e0
138 pm(31)=p0-psh
139 IF(pm(79)==zero)pm(79)=three100
140 pm(104)=p0-psh
141
142 !SSP0
143 ssp0 = zero
144 g0 = pm(22)
145 rhoi = pm(89)
146 dpdmu = (gamma-one) *e0+(gamma-one)*(one+mu0)*df*df*(pp+psh)
147 dpdmu=max(zero,dpdmu)
148 IF(rhor > zero) ssp0 = sqrt((dpdmu + two_third*g0)/rhor)
149 pm(27)=ssp0
150
151 WRITE(iout,1000)
152
153 IF(is_encrypted)THEN
154 WRITE(iout,'(5X,A,//)')'CONFIDENTIAL DATA'
155 ELSE
156 WRITE(iout,1500)gamma,p0,psh,pstar,e0
157 IF(is_available_rho0)WRITE(iout,1501)pm(1)
158 ENDIF
159
160 RETURN
161 1000 FORMAT(
162 & 5x,' STIFFENED GAS EOS ',/,
163 & 5x,' ----------------- ',/)
164 1500 FORMAT(
165 & 5x,'GAMMA . . . . . . . . . . . . . . . . . .=',1pg20.13/,
166 & 5x,'P0. . . . . . . . . . . . . . . . . . . .=',1pg20.13/,
167 & 5x,'PSH . . . . . . . . . . . . . . . . . . .=',1pg20.13/,
168 & 5x,'PSTAR . . . . . . . . . . . . . . . . . .=',1pg20.13/,
169 & 5x,'COMPUTED E0 . . . . . . . . . . . . . . .=',1pg20.13)
170 1501 FORMAT(
171 & 5x,'eos reference density . . . . . . . . . .=',1PG20.13)
172
173 RETURN
174 END
#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_stiffened_gas(iout, pm, unitab, iunit, lsubmodel, imideos)
#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
program starter
Definition starter.F:39