OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
hm_read_eos_polynomial.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_polynomial ../starter/source/materials/eos/hm_read_eos_polynomial.F
25!||--- called by ------------------------------------------------------
26!|| hm_read_eos ../starter/source/materials/eos/hm_read_eos.F
27!||--- calls -----------------------------------------------------
28!|| hm_get_floatv ../starter/source/devtools/hm_reader/hm_get_floatv.F
29!|| hm_option_is_encrypted ../starter/source/devtools/hm_reader/hm_option_is_encrypted.F
30!||--- uses -----------------------------------------------------
31!|| message_mod ../starter/share/message_module/message_mod.F
32!|| submodel_mod ../starter/share/modules1/submodel_mod.F
33!||====================================================================
34 SUBROUTINE hm_read_eos_polynomial(IOUT,PM,UNITAB,IUNIT,LSUBMODEL,IMIDEOS,ISFLUID,MAT_PARAM)
35C-----------------------------------------------
36C M o d u l e s
37C-----------------------------------------------
38 USE unitab_mod
39 USE submodel_mod
40 USE message_mod
41 USE matparam_def_mod, ONLY : matparam_struct_
42C-----------------------------------------------
43C D e s c r i p t i o n
44C-----------------------------------------------
45C reading parameters for
46C POLYNOMIAL 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 IOUT, IUNIT
63 my_real pm(npropm)
64 TYPE(submodel_data), DIMENSION(NSUBMOD), INTENT(IN) :: LSUBMODEL
65 TYPE(matparam_struct_),INTENT(INOUT) :: MAT_PARAM
66 INTEGER,INTENT(IN) :: IMIDEOS
67 INTEGER,INTENT(INOUT) :: ISFLUID
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 :: c0, c1, c2, c3, c4, c5, c6, e0, psh, rho0,rhor,mu0,mu02,rhoi, g0, ssp0, df, dpdmu
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('MAT_C0', c0, is_available,lsubmodel,unitab)
87 CALL hm_get_floatv('MAT_C1', c1, is_available,lsubmodel,unitab)
88 CALL hm_get_floatv('MAT_C2', c2, is_available,lsubmodel,unitab)
89 CALL hm_get_floatv('MAT_C3', c3, is_available,lsubmodel,unitab)
90 CALL hm_get_floatv('MAT_C4', c4, is_available,lsubmodel,unitab)
91 CALL hm_get_floatv('MAT_C5', c5, is_available,lsubmodel,unitab)
92 CALL hm_get_floatv('MAT_C6', c6, is_available,lsubmodel,unitab)
93 CALL hm_get_floatv('MAT_EA', e0, is_available,lsubmodel,unitab)
94 CALL hm_get_floatv('MAT_PSH', psh, is_available,lsubmodel,unitab)
95 CALL hm_get_floatv('Refer_Rho', rho0, is_available_rho0,lsubmodel,unitab)
96!-------------------------------------------------------------------------------
97 rhor = pm(1)
98 rhoi = pm(89)
99
100 IF(rho0 > zero) THEN
101 rhor = rho0
102 pm(1)= rho0
103 mat_param%RHO = rho0
104 ELSE
105 rho0=rhor
106 ENDIF
107
108 pm(23)=e0
109 !PM(32) = C1 !legacy value
110 pm(32)=c1+c4*e0 !BULK MODULUS = (1+ยต)*dP/dmu (partial derivative at constant E)
111 pm(88)=psh
112
113 mat_param%EOS%NUPARAM = 7
114 mat_param%EOS%NIPARAM = 0
115 mat_param%EOS%NFUNC = 0
116 mat_param%EOS%NTABLE = 0
117 CALL mat_param%EOS%CONSTRUCT() !allocations
118
119 mat_param%EOS%UPARAM(1) = c0-psh
120 mat_param%EOS%UPARAM(2) = c1
121 mat_param%EOS%UPARAM(3) = c2
122 mat_param%EOS%UPARAM(4) = c3
123 mat_param%EOS%UPARAM(5) = c4
124 mat_param%EOS%UPARAM(6) = c5
125 mat_param%EOS%UPARAM(7) = c6
126 mat_param%EOS%PSH = psh
127 mat_param%EOS%E0 = e0
128 IF (mat_param%THERM%TINI == zero) THEN
129 mat_param%THERM%TINI =three100
130 pm(79) = three100
131 END IF
132
133 !initial pressure for stress tensor
134 IF(rhoi == zero)THEN
135 mu0 = zero ! error 683 already displayed
136 ELSE
137 IF(rhor /= zero)THEN
138 mu0 = rhoi/rhor-one
139 ELSE
140 mu0 = zero ! error 683 already displayed
141 ENDIF
142 ENDIF
143 mu02 = mu0*max(zero,mu0)
144
145 IF(rhoi /= zero)THEN
146 df = rhor/rhoi
147 ELSE
148 df = zero
149 ENDIF
150
151 pm(31) = c0-psh+c1*mu0+c2*mu02+c3*mu0**3+(c4+c5*mu0+c6*mu02)*e0
152 pm(104) = c0-psh
153
154 !SSP0
155 ssp0 = zero
156 g0 = pm(22)
157 rhoi = pm(89)
158 dpdmu = c1 + two*c2*max(zero,mu0) + three*c3*mu0*mu0 + (c5+c6*max(zero,mu0))*e0 + (c4 +c5*mu0 +c6*mu02)*df*df*(pm(31)+psh)
159 dpdmu=max(zero,dpdmu)
160 IF(rhor > zero) ssp0 = sqrt((dpdmu + two_third*g0)/rhor)
161 pm(27)=ssp0
162
163 IF(c1 == zero .AND. c2 == zero .AND. c3 == zero .AND. c4 == c5 .AND. c4 > one .AND. c6 == zero)THEN
164 isfluid = 1
165 ENDIF
166
167 WRITE(iout,1000)
168 IF(is_encrypted)THEN
169 WRITE(iout,'(5X,A,//)')'CONFIDENTIAL DATA'
170 ELSE
171 WRITE(iout,1500)c0,c1,c2,c3,c4,c5,c6,e0,pm(104),psh
172 IF(is_available_rho0)WRITE(iout,1501)pm(1)
173 ENDIF
174
175 RETURN
176 1000 FORMAT(
177 & 5x,' POLYNOMIAL EOS ',/,
178 & 5x,' -------------- ',/)
179 1500 FORMAT(
180 & 5x,'C0. . . . . . . . . . . . . . . . . . . .=',1pg20.13/,
181 & 5x,'c1. . . . . . . . . . . . . . . . . . . .=',1PG20.13/,
182 & 5X,'c2. . . . . . . . . . . . . . . . . . . .=',1PG20.13/,
183 & 5X,'c3. . . . . . . . . . . . . . . . . . . .=',1PG20.13/,
184 & 5X,'c4. . . . . . . . . . . . . . . . . . . .=',1PG20.13/,
185 & 5X,'c5. . . . . . . . . . . . . . . . . . . .=',1PG20.13/,
186 & 5X,'c6. . . . . . . . . . . . . . . . . . . .=',1PG20.13/,
187 & 5X,'initial internal energy per unit volume .=',1PG20.13/,
188 & 5X,'initial pressure. . . . . . . . . . . . .=',1PG20.13/,
189 & 5X,'pressure shift. . . . . . . . . . . . . .=',1PG20.13)
190 1501 FORMAT(
191 & 5X,'eos reference density . . . . . . . . . .=',1PG20.13)
192
193 RETURN
194 END SUBROUTINE HM_READ_EOS_POLYNOMIAL
195
#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_polynomial(iout, pm, unitab, iunit, lsubmodel, imideos, isfluid, mat_param)
#define max(a, b)
Definition macros.h:21