OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
nasg.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!|| nasg_mod ../common_source/eos/nasg.F
25!||--- called by ------------------------------------------------------
26!|| eosmain ../common_source/eos/eosmain.F
27!|| eosmain51 ../engine/source/materials/mat/mat051/eosmain51.F90
28!||====================================================================
29 MODULE nasg_mod
30 IMPLICIT NONE
31 CONTAINS
32!||====================================================================
33!|| nasg ../common_source/eos/nasg.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 nasg(
42 1 IFLAG ,NEL ,PMIN ,OFF ,EINT ,MU ,
43 2 ESPE ,DVOL ,VNEW ,PSH ,
44 3 PNEW ,DPDM ,DPDE ,EOS_STRUCT)
45C-----------------------------------------------
46C M o d u l e s
47C-----------------------------------------------
48 USE constant_mod , ONLY : half,two,zero,one
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 NOBLE ABEL STIFFENED GAS EOS
55C 2nd order integration in time
56!----------------------------------------------------------------------------
57!! \details STAGGERED SCHEME IS EXECUTED IN TWO PASSES IN EOSMAIN : IFLG=0 THEN IFLG=1
58!! \details COLLOCATED SCHEME IS DOING A SINGLE PASS : IFLG=2
59!! \details
60!! \details STAGGERED SCHEME
61!! \details EOSMAIN / IFLG = 0 : DERIVATIVE CALCULATION FOR SOUND SPEED ESTIMATION c[n+1] REQUIRED FOR PSEUDO-VISCOSITY (DPDE:partial derivative, DPDM:total derivative)
62!! \details MQVISCB : PSEUDO-VISCOSITY Q[n+1]
63!! \details MEINT : INTERNAL ENERGY INTEGRATION FOR E[n+1] : FIRST PART USING P[n], Q[n], and Q[n+1] CONTRIBUTIONS
64!! \details EOSMAIN / IFLG = 1 : UPDATE P[n+1], T[N+1]
65!! \details INTERNAL ENERGY INTEGRATION FOR E[n+1] : LAST PART USING P[n+1] CONTRIBUTION
66!! \details (second order integration dE = -P.dV where P = 0.5(P[n+1] + P[n]) )
67!! \details COLLOCATED SCHEME
68!! \details EOSMAIN / IFLG = 2 : SINGLE PASS FOR P[n+1] AND DERIVATIVES
69!----------------------------------------------------------------------------
70C-----------------------------------------------
71C I m p l i c i t T y p e s
72C-----------------------------------------------
73 IMPLICIT NONE
74#include "my_real.inc"
75C-----------------------------------------------
76C D u m m y A r g u m e n t s
77C-----------------------------------------------
78 INTEGER,INTENT(IN) :: IFLAG, NEL
79 my_real,INTENT(IN) :: PMIN, OFF(NEL) ,MU(NEL) , ESPE(NEL) ,DVOL(NEL) ,VNEW(NEL)
80 my_real, INTENT(INOUT) :: PSH(NEL), PNEW(NEL) ,DPDM(NEL), DPDE(NEL), EINT(NEL)
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,PP,PSTAR,V0
87 my_real :: Q,Q_,RHO0,NUM,DENOM,UNPMU,B,RHO
88C-----------------------------------------------
89C S o u r c e L i n e s
90C-----------------------------------------------
91 e0 = eos_struct%E0
92 psh(1:nel) = eos_struct%PSH
93 gamma = eos_struct%UPARAM(1)
94 p0 = eos_struct%UPARAM(2)
95 pstar = eos_struct%UPARAM(3)
96 q = eos_struct%UPARAM(4)
97 q_ = eos_struct%UPARAM(5)
98 b = eos_struct%UPARAM(6)
99 rho0 = eos_struct%UPARAM(7)
100
101 IF(iflag == 0) THEN
102 DO i=1,nel
103 unpmu = one+mu(i)
104 denom = (one-rho0*b*unpmu)
105 num = (espe(i)-rho0*q)
106 pp = (gamma-one)*unpmu*num/denom - gamma*pstar
107 dpde(i) = (gamma-one)*unpmu / denom !partial derivative
108 dpdm(i) = (gamma-one)*num/denom/denom + dpde(i)*(pp+psh(i))/unpmu/unpmu !total derivative
109 pnew(i) = max(pp,-gamma*pstar)*off(i) ! P(mu[n+1],E[n])
110 ENDDO
111
112 ELSEIF(iflag == 1) THEN
113 DO i=1,nel
114 eint(i) = eint(i) - half*dvol(i)*(pnew(i)+psh(i))
115 unpmu = one+mu(i)
116 rho = unpmu*rho0
117 v0 = vnew(i)*rho/rho0
118 denom = (vnew(i)/v0-rho0*b)
119 aa = (gamma-one)*(-rho0*q/denom)-gamma*pstar
120 bb = (gamma-one)/ denom
121 dpde(i) = bb !partial derivative
122 pnew(i) = (aa+bb*eint(i)/v0)/(one+bb*dvol(i)/two/v0) ! P(mu[n+1],E[n+1])
123 pnew(i) = max(pnew(i),-gamma*pstar)*off(i)
124 ENDDO
125
126 ELSEIF(iflag == 2) THEN
127 DO i=1, nel
128 IF (vnew(i) > zero) THEN
129 unpmu = one+mu(i)
130 denom = (one-rho0*b*unpmu)
131 num = (espe(i)-rho0*q)
132 pnew(i) = -psh(i) + (gamma-one)*unpmu*num/denom - gamma*pstar
133 pnew(i) = max(pnew(i),max(pmin, -gamma*pstar))*off(i)
134 dpde(i) = (gamma-one)*unpmu / denom !partial derivative
135 dpdm(i) = (gamma-one)*num/denom/denom + dpde(i)*(pnew(i)+psh(i))/unpmu/unpmu !total derivative
136 ENDIF
137 ENDDO
138
139 ENDIF
140C-----------------------------------------------
141 RETURN
142 END SUBROUTINE nasg
143 END MODULE nasg_mod
#define max(a, b)
Definition macros.h:21
subroutine nasg(iflag, nel, pmin, off, eint, mu, espe, dvol, vnew, psh, pnew, dpdm, dpde, eos_struct)
Definition nasg.F:45