OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
hm_read_eos_osborne.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_osborne ../starter/source/materials/eos/hm_read_eos_osborne.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_osborne(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 constant_mod, ONLY : zero, one, two, three100, four, half, four, two_third
43 USE matparam_def_mod, ONLY : matparam_struct_
44C-----------------------------------------------
45C D e s c r i p t i o n
46C-----------------------------------------------
47C reading parameters for
48C OSBORNE EQUATION OF STATE
49C-----------------------------------------------
50C C o m m e n t s
51C-----------------------------------------------
52C RHOI = PM(89) -> provided by /MAT
53C RHOR = PM(01) -> provided by /MAT (can be erased by EOS if present : obsolete)
54C => MU0 = RHO/RHOR-1.
55C PM(31) = P(MU0,E0) -> will be used to initialize diagonal of stress tensor SIG(1:3,*)
56C-----------------------------------------------
57C I m p l i c i t T y p e s
58C-----------------------------------------------
59 IMPLICIT NONE
60#include "my_real.inc"
61C-----------------------------------------------
62C D u m m y A r g u m e n t s
63C-----------------------------------------------
64 TYPE (UNIT_TYPE_),INTENT(IN) ::UNITAB
65 INTEGER IOUT, IUNIT
66 my_real pm(npropm)
67 TYPE(submodel_data), DIMENSION(NSUBMOD), INTENT(IN) :: LSUBMODEL
68 TYPE(matparam_struct_),INTENT(INOUT) :: MAT_PARAM
69 INTEGER,INTENT(IN) :: IMIDEOS
70C-----------------------------------------------
71C C o m m o n B l o c k s
72C-----------------------------------------------
73#include "param_c.inc"
74C-----------------------------------------------
75C L o c a l V a r i a b l e s
76C-----------------------------------------------
77 my_real p0, e0, psh, rho0
78 my_real a1,a2,b0,b1,b2,c0,c1,d0,rhoi,rhor,dpdmu_partial,dpde,df,mu0,dpdmu,a2_,g0,ssp0, denom
79 LOGICAL :: IS_ENCRYPTED, IS_AVAILABLE, IS_AVAILABLE_RHO0
80C-----------------------------------------------
81C S o u r c e L i n e s
82C-----------------------------------------------
83 is_encrypted = .false.
84 is_available = .false.
85 is_available_rho0 = .false.
86
87 CALL hm_option_is_encrypted(is_encrypted)
88
89 CALL hm_get_floatv('EOS_A1', a1, is_available,lsubmodel,unitab)
90 CALL hm_get_floatv('EOS_A2', a2, is_available,lsubmodel,unitab)
91 CALL hm_get_floatv('EOS_B0', b0, is_available,lsubmodel,unitab)
92 CALL hm_get_floatv('EOS_B1', b1, is_available,lsubmodel,unitab)
93 CALL hm_get_floatv('EOS_B2', b2, is_available,lsubmodel,unitab)
94
95 CALL hm_get_floatv('EOS_C0', c0, is_available,lsubmodel,unitab)
96 CALL hm_get_floatv('EOS_C_1', c1, is_available,lsubmodel,unitab)
97 CALL hm_get_floatv('EOS_D0', d0, is_available,lsubmodel,unitab)
98 CALL hm_get_floatv('LAW5_P0', p0, is_available,lsubmodel,unitab)
99
100 CALL hm_get_floatv('Refer_Rho', rho0, is_available_rho0,lsubmodel,unitab)
101
102 rhor = pm(1)
103 rhoi = pm(89)
104
105 IF(rho0 > zero) THEN
106 rhor = rho0
107 pm(1)= rho0
108 mat_param%RHO = rho0
109 ELSE
110 rho0=rhor
111 ENDIF
112
113 IF(
114 . a1 <= zero .OR.
115 . a2 <= zero .OR.
116 . b0 <= zero .OR.
117 . b1 <= zero .OR.
118 . b2 <= zero .OR.
119 . c0 <= zero .OR.
120 . c1 <= zero .OR.
121 . d0 <= zero .OR.
122 . rho0 <= zero
123 . )THEN
124 CALL ancmsg(msgid=67, msgtype=msgerror, anmode=aninfo,
125 . i1=imideos,
126 . c1='/EOS/OSBORNE',
127 . c2='PARAMETERS MUST BE STRICTLY POSITIVE')
128 ENDIF
129
130 !solve P(0,E0)=P0 : 2 roots
131 !E0 =-HALF*(B0-P0+SQRT(FOUR*C0*D0*P0+B0**TWO-TWO*B0*P0+P0**TWO))/C0 !root-1
132 e0 =-half*(b0-p0-sqrt(four*c0*d0*p0+b0**two-two*b0*p0+p0**two))/c0 !root-2
133
134
135 pm(23) = e0
136 pm(32) = (a1+b1+c1*e0*e0) / (e0+d0) !BULK = (1+ยต)*dP/dmu (partial derivative at constant E)
137 psh = zero
138 pm(88) = psh
139 pm(31) = p0
140
141 mat_param%EOS%NUPARAM = 9
142 mat_param%EOS%NIPARAM = 0
143 mat_param%EOS%NFUNC = 0
144 mat_param%EOS%NTABLE = 0
145 CALL mat_param%EOS%CONSTRUCT() !allocations
146
147 mat_param%EOS%UPARAM(1) = a1
148 mat_param%EOS%UPARAM(2) = a2
149 mat_param%EOS%UPARAM(3) = b0
150 mat_param%EOS%UPARAM(4) = b1
151 mat_param%EOS%UPARAM(5) = b2
152 mat_param%EOS%UPARAM(6) = c0
153 mat_param%EOS%UPARAM(7) = c1
154 mat_param%EOS%UPARAM(8) = d0
155 mat_param%EOS%UPARAM(9) = p0
156
157 mat_param%EOS%PSH = psh
158 mat_param%EOS%E0 = e0
159 IF (mat_param%THERM%TINI == zero) THEN
160 mat_param%THERM%TINI =three100
161 pm(79) = three100
162 END IF
163
164 !P0
165 IF(rhoi == zero)THEN
166 mu0 = zero ! error 683 already displayed
167 ELSE
168 IF(rhor /= zero)THEN
169 mu0 = rhoi/rhor-one
170 ELSE
171 mu0 = zero ! error 683 already displayed
172 ENDIF
173 ENDIF
174
175 IF(rhoi /= zero)THEN
176 df = rhor/rhoi
177 ELSE
178 df = zero
179 ENDIF
180
181 !SSP0
182 ssp0 = zero
183 g0 = pm(22)
184 rhoi = pm(89)
185
186 a2_=a2
187 IF(mu0 < zero)a2_=-a2
188 denom = (e0+d0)
189 dpdmu_partial = (a1+2*a2_*mu0+(two*b2*mu0+b1)*e0+c1*e0*e0)/denom
190 dpde = (((b2*mu0+b1)*mu0+b0)+(two*(c1*mu0+c0))*e0 - p0/denom)/denom
191 dpdmu = dpdmu_partial + dpde*df*df*(p0) !total derivative
192
193 dpdmu=max(zero,dpdmu)
194 IF(rhor > zero) ssp0 = sqrt((dpdmu + two_third*g0)/rhor)
195 pm(27)=ssp0
196
197 WRITE(iout,1000)
198
199 IF(is_encrypted)THEN
200 WRITE(iout,'(5X,A,//)')'CONFIDENTIAL DATA'
201 ELSE
202 WRITE(iout,1500)a1,a2,b0,b1,b2,c0,c1,d0,p0
203 IF(is_available_rho0)WRITE(iout,1501)pm(1)
204 ENDIF
205
206 RETURN
207 1000 FORMAT(
208 & 5x,' OSBORNE EOS ',/,
209 & 5x,' ----------- ',/)
210 1500 FORMAT(
211 & 5x,'A1. . . . . . . . . . . . . . . . . . . .=',1pg20.13/,
212 & 5x,'A2. . . . . . . . . . . . . . . . . . . .=',1pg20.13/,
213 & 5x,'B0. . . . . . . . . . . . . . . . . . . .=',1pg20.13/,
214 & 5x,'B1. . . . . . . . . . . . . . . . . . . .=',1pg20.13/,
215 & 5x,'B2. . . . . . . . . . . . . . . . . . . .=',1pg20.13/,
216 & 5x,'C0. . . . . . . . . . . . . . . . . . . .=',1pg20.13/,
217 & 5x,'C1. . . . . . . . . . . . . . . . . . . .=',1pg20.13/,
218 & 5x,'D0. . . . . . . . . . . . . . . . . . . .=',1pg20.13/,
219 & 5x,'P0. . . . . . . . . . . . . . . . . . . .=',1pg20.13)
220 1501 FORMAT(
221 & 5x,'EOS REFERENCE DENSITY . . . . . . . . . .=',1pg20.13)
222
223 RETURN
224 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_osborne(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
program starter
Definition starter.F:39