OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
stiffgas.F File Reference
#include "implicit_f.inc"
#include "comlock.inc"
#include "param_c.inc"
#include "com04_c.inc"
#include "com06_c.inc"
#include "com08_c.inc"
#include "vect01_c.inc"
#include "scr06_c.inc"

Go to the source code of this file.

Functions/Subroutines

subroutine stiffgas (iflag, nel, pm, off, eint, mu, mu2, espe, dvol, df, vnew, mat, psh, pnew, dpdm, dpde)

Function/Subroutine Documentation

◆ stiffgas()

subroutine stiffgas ( integer iflag,
integer nel,
pm,
off,
eint,
mu,
mu2,
espe,
dvol,
df,
vnew,
integer, dimension(nel) mat,
dimension(nel), intent(inout) psh,
pnew,
dpdm,
dpde )

Definition at line 28 of file stiffgas.F.

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
#define my_real
Definition cppsort.cpp:32
#define max(a, b)
Definition macros.h:21