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_mod ../common_source/eos/stiffgas.F
25!||--- called by ------------------------------------------------------
26!|| eosmain ../common_source/eos/eosmain.F
27!|| eosmain51 ../engine/source/materials/mat/mat051/eosmain51.F90
28!||====================================================================
30 IMPLICIT NONE
31 CONTAINS
32!||====================================================================
33!|| stiffgas ../common_source/eos/stiffgas.F
34!||--- called by ------------------------------------------------------
35!|| eosmain ../common_source/eos/eosmain.F
36!|| eosmain51 ../engine/source/materials/mat/mat051/eosmain51.F90
37!||--- uses -----------------------------------------------------
38!|| constant_mod ../common_source/modules/constant_mod.F
39!|| eos_param_mod ../common_source/modules/mat_elem/eos_param_mod.F90
40!||====================================================================
41 SUBROUTINE stiffgas(
42 1 IFLAG,NEL ,PMIN ,OFF ,EINT ,MU ,MU2 ,
43 2 ESPE ,DVOL ,DF ,VNEW ,PSH ,
44 3 PNEW ,DPDM ,DPDE ,EOS_STRUCT)
45C-----------------------------------------------
46C M o d u l e s
47C-----------------------------------------------
48 USE constant_mod , ONLY : zero, em15, half, one, two, three, three100
49 USE eos_param_mod , ONLY : eos_param_
50C-----------------------------------------------
51C D e s c r i p t i o n
52C-----------------------------------------------
53C This subroutine contains numerical solving
54C of STIFFENED-GAS EOS
55!----------------------------------------------------------------------------
56!! \details STAGGERED SCHEME IS EXECUTED IN TWO PASSES IN EOSMAIN : IFLG=0 THEN IFLG=1
57!! \details COLLOCATED SCHEME IS DOING A SINGLE PASS : IFLG=2
58!! \details
59!! \details STAGGERED SCHEME
60!! \details EOSMAIN / IFLG = 0 : DERIVATIVE CALCULATION FOR SOUND SPEED ESTIMATION c[n+1] REQUIRED FOR PSEUDO-VISCOSITY (DPDE:partial derivative, DPDM:total derivative)
61!! \details MQVISCB : PSEUDO-VISCOSITY Q[n+1]
62!! \details MEINT : INTERNAL ENERGY INTEGRATION FOR E[n+1] : FIRST PART USING P[n], Q[n], and Q[n+1] CONTRIBUTIONS
63!! \details EOSMAIN / IFLG = 1 : UPDATE P[n+1], T[N+1]
64!! \details INTERNAL ENERGY INTEGRATION FOR E[n+1] : LAST PART USING P[n+1] CONTRIBUTION
65!! \details (second order integration dE = -P.dV where P = 0.5(P[n+1] + P[n]) )
66!! \details COLLOCATED SCHEME
67!! \details EOSMAIN / IFLG = 2 : SINGLE PASS FOR P[n+1] AND DERIVATIVES
68!----------------------------------------------------------------------------
69C-----------------------------------------------
70C I m p l i c i t T y p e s
71C-----------------------------------------------
72 IMPLICIT NONE
73#include "my_real.inc"
74C-----------------------------------------------
75C D u m m y A r g u m e n t s
76C-----------------------------------------------
77 INTEGER,INTENT(IN) :: IFLAG, NEL
78 my_real,INTENT(IN) :: OFF(NEL),MU(NEL),MU2(NEL),ESPE(NEL),DVOL(NEL),DF(NEL),VNEW(NEL)
79 my_real, INTENT(INOUT) :: PSH(NEL),PNEW(NEL) ,DPDM(NEL), DPDE(NEL),EINT(NEL)
80 my_real,INTENT(IN) :: pmin
81 TYPE(eos_param_),INTENT(IN) :: EOS_STRUCT
82C-----------------------------------------------
83C L o c a l V a r i a b l e s
84C-----------------------------------------------
85 INTEGER I
86 my_real :: P0,GAMMA,E0,AA, BB, DVV, PP, PSTAR
87C-----------------------------------------------
88C S o u r c e L i n e s
89C-----------------------------------------------
90 gamma = eos_struct%UPARAM(1)
91 p0 = eos_struct%UPARAM(2)
92 pstar = eos_struct%UPARAM(3)
93 psh(1:nel) = eos_struct%PSH
94 e0 = eos_struct%E0
95
96 IF(iflag == 0) THEN
97 DO i=1,nel
98 pp = -gamma*pstar-psh(i) + (gamma-one)*(one+mu(i))*espe(i)
99 dpdm(i) = (gamma-one) *espe(i)+(gamma-one)*(one+mu(i))*df(i)*df(i)*(pp+psh(i) )
100 dpde(i) = (gamma-one)*(one+mu(i))
101 pnew(i) = max(pp,pmin-psh(i))*off(i)
102 ENDDO
103
104 ELSEIF(iflag == 1) THEN
105 DO i=1,nel
106 aa = -gamma*pstar-psh(i)
107 bb = (gamma-one)*(one+mu(i))
108 dpde(i) = (gamma-one)*(one+mu(i))
109 dvv = half*dvol(i)*df(i) / max(em15,vnew(i))
110 pnew(i) = (aa+bb*(espe(i)-psh(i) *dvv))/(one+bb*dvv)
111 pnew(i) = max(pnew(i),pmin-psh(i) )*off(i)
112 eint(i) = eint(i) - half*dvol(i)*(pnew(i)+psh(i) )
113 ENDDO
114
115 ELSEIF(iflag == 2) THEN
116 DO i=1, nel
117 IF (vnew(i) > zero) THEN
118 pnew(i) = (gamma-one)*(one+mu(i))*espe(i) - gamma*pstar
119 pnew(i) = max(pnew(i),pmin)*off(i)
120 !EINT(I) = (PNEW(I) + PSH(I) + GAMMA * PSTAR) / (GAMMA - ONE)
121 dpdm(i) = (gamma-one)*(espe(i)+pnew(i)*df(i)) !total derivative
122 dpde(i) = (gamma-one)*(one+mu(i)) !partial derivative
123 pnew(i) = pnew(i)-psh(i)
124 ENDIF
125 ENDDO
126 ENDIF
127C-----------------------------------------------
128 RETURN
129 END SUBROUTINE stiffgas
130 END MODULE stiffgas_mod
#define max(a, b)
Definition macros.h:21
subroutine stiffgas(iflag, nel, pmin, off, eint, mu, mu2, espe, dvol, df, vnew, psh, pnew, dpdm, dpde, eos_struct)
Definition stiffgas.F:45