OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
stiffgas.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!|| stiffgas ../common_source/eos/stiffgas.F
25!||--- called by ------------------------------------------------------
26!|| eosmain ../common_source/eos/eosmain.F
27!||====================================================================
28 SUBROUTINE stiffgas
29 1 (iflag,nel, pm ,off ,eint ,mu ,mu2 ,
30 2 espe ,dvol ,df ,vnew ,mat ,psh ,
31 3 pnew ,dpdm ,dpde )
32C-----------------------------------------------
33C M o d u l e s
34C-----------------------------------------------
35C
36C-----------------------------------------------
37C D e s c r i p t i o n
38C-----------------------------------------------
39C This subroutine contains numerical solving
40C of STIFFENED-GAS EOS
41!----------------------------------------------------------------------------
42!! \details STAGGERED SCHEME IS EXECUTED IN TWO PASSES IN EOSMAIN : IFLG=0 THEN IFLG=1
43!! \details COLLOCATED SCHEME IS DOING A SINGLE PASS : IFLG=2
44!! \details
45!! \details STAGGERED SCHEME
46!! \details EOSMAIN / IFLG = 0 : DERIVATIVE CALCULATION FOR SOUND SPEED ESTIMATION c[n+1] REQUIRED FOR PSEUDO-VISCOSITY (DPDE:partial derivative, DPDM:total derivative)
47!! \details MQVISCB : PSEUDO-VISCOSITY Q[n+1]
48!! \details MEINT : INTERNAL ENERGY INTEGRATION FOR E[n+1] : FIRST PART USING P[n], Q[n], and Q[n+1] CONTRIBUTIONS
49!! \details EOSMAIN / IFLG = 1 : UPDATE P[n+1], T[N+1]
50!! \details INTERNAL ENERGY INTEGRATION FOR E[n+1] : LAST PART USING P[n+1] CONTRIBUTION
51!! \details (second order integration dE = -P.dV where P = 0.5(P[n+1] + P[n]) )
52!! \details COLLOCATED SCHEME
53!! \details EOSMAIN / IFLG = 2 : SINGLE PASS FOR P[n+1] AND DERIVATIVES
54!----------------------------------------------------------------------------
55C-----------------------------------------------
56C I m p l i c i t T y p e s
57C-----------------------------------------------
58#include "implicit_f.inc"
59#include "comlock.inc"
60C-----------------------------------------------
61C C o m m o n B l o c k s
62C-----------------------------------------------
63#include "param_c.inc"
64#include "com04_c.inc"
65#include "com06_c.inc"
66#include "com08_c.inc"
67#include "vect01_c.inc"
68#include "scr06_c.inc"
69C-----------------------------------------------
70C D u m m y A r g u m e n t s
71C-----------------------------------------------
72 INTEGER MAT(NEL), IFLAG, NEL
73 my_real pm(npropm,nummat),
74 . off(nel) ,eint(nel) ,mu(nel) ,
75 . mu2(nel) ,espe(nel) ,dvol(nel) ,df(nel) ,
76 . vnew(nel) ,pnew(nel) ,dpdm(nel),
77 . dpde(nel)
78 my_real, INTENT(INOUT) :: psh(nel)
79C-----------------------------------------------
80C L o c a l V a r i a b l e s
81C-----------------------------------------------
82 INTEGER I, MX
83 my_real :: p0,gamma,t0,e0,sph,aa, bb, dvv, pp, pstar, pc
84C-----------------------------------------------
85C S o u r c e L i n e s
86C-----------------------------------------------
87 IF(iflag == 0) THEN
88 mx = mat(1)
89 e0 = pm(23,mx)
90 gamma = pm(34,mx)
91 p0 = pm(32,mx)
92 psh(1:nel) = pm(88,mx)
93 pstar = pm(35,mx)
94 sph = pm(69,mx)
95 pc = pm(37,mx)
96 DO i=1,nel
97 pp = -gamma*pstar-psh(i) + (gamma-one)*(one+mu(i))*espe(i)
98 dpdm(i) = (gamma-one) *espe(i)+(gamma-one)*(one+mu(i))*df(i)*df(i)*(pp+psh(i) )
99 dpde(i) = (gamma-one)*(one+mu(i))
100 pnew(i) = max(pp,pc-psh(i))*off(i) ! P(mu[n+1],E[n])
101 ENDDO
102
103 ELSEIF(iflag == 1) THEN
104 mx = mat(1)
105 e0 = pm(23,mx)
106 gamma = pm(34,mx)
107 p0 = pm(32,mx)
108 psh(1:nel) = pm(88,mx)
109 pstar = pm(35,mx)
110 sph = pm(69,mx)
111 pc = pm(37,mx)
112 DO i=1,nel
113 aa = -gamma*pstar-psh(i)
114 bb = (gamma-one)*(one+mu(i))
115 dpde(i) = (gamma-one)*(one+mu(i))
116 dvv = half*dvol(i)*df(i) / max(em15,vnew(i))
117 pnew(i) = (aa+bb*(espe(i)-psh(i) *dvv))/(one+bb*dvv)
118 pnew(i) = max(pnew(i),pc-psh(i) )*off(i) ! P(mu[n+1],E[n+1])
119 eint(i) = eint(i) - half*dvol(i)*(pnew(i)+psh(i) )
120 ENDDO
121
122 ELSEIF(iflag == 2) THEN
123 mx = mat(1)
124 e0 = pm(23,mx)
125 gamma = pm(34,mx)
126 p0 = pm(32,mx)
127 psh(1:nel) = pm(88,mx)
128 pstar = pm(35,mx)
129 sph = pm(69,mx)
130 pc = pm(37, mx)
131 DO i=1, nel
132 IF (vnew(i) > zero) THEN
133 pnew(i) = (gamma-one)*(one+mu(i))*espe(i) - gamma*pstar
134 pnew(i) = max(pnew(i),pc)*off(i)
135 !EINT(I) = (PNEW(I) + PSH(I) + GAMMA * PSTAR) / (GAMMA - ONE)
136 dpdm(i) = (gamma-one)*(espe(i)+pnew(i)*df(i)) !total derivative
137 dpde(i) = (gamma-one)*(one+mu(i)) !partial derivative
138 pnew(i) = pnew(i)-psh(i)
139 ENDIF
140 ENDDO
141 ENDIF
142C-----------------------------------------------
143 RETURN
144 END
#define my_real
Definition cppsort.cpp:32
#define max(a, b)
Definition macros.h:21
subroutine stiffgas(iflag, nel, pm, off, eint, mu, mu2, espe, dvol, df, vnew, mat, psh, pnew, dpdm, dpde)
Definition stiffgas.F:32