OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
nasg.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 nasg (iflag, nel, pm, off, eint, mu, espe, dvol, vnew, mat, psh, pnew, dpdm, dpde)

Function/Subroutine Documentation

◆ nasg()

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

Definition at line 28 of file nasg.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 NOBLE ABEL STIFFENED GAS EOS
41C 2nd order integration in time
42!----------------------------------------------------------------------------
43!! \details STAGGERED SCHEME IS EXECUTED IN TWO PASSES IN EOSMAIN : IFLG=0 THEN IFLG=1
44!! \details COLLOCATED SCHEME IS DOING A SINGLE PASS : IFLG=2
45!! \details
46!! \details STAGGERED SCHEME
47!! \details EOSMAIN / IFLG = 0 : DERIVATIVE CALCULATION FOR SOUND SPEED ESTIMATION c[n+1] REQUIRED FOR PSEUDO-VISCOSITY (DPDE:partial derivative, DPDM:total derivative)
48!! \details MQVISCB : PSEUDO-VISCOSITY Q[n+1]
49!! \details MEINT : INTERNAL ENERGY INTEGRATION FOR E[n+1] : FIRST PART USING P[n], Q[n], and Q[n+1] CONTRIBUTIONS
50!! \details EOSMAIN / IFLG = 1 : UPDATE P[n+1], T[N+1]
51!! \details INTERNAL ENERGY INTEGRATION FOR E[n+1] : LAST PART USING P[n+1] CONTRIBUTION
52!! \details (second order integration dE = -P.dV where P = 0.5(P[n+1] + P[n]) )
53!! \details COLLOCATED SCHEME
54!! \details EOSMAIN / IFLG = 2 : SINGLE PASS FOR P[n+1] AND DERIVATIVES
55!----------------------------------------------------------------------------
56C-----------------------------------------------
57C I m p l i c i t T y p e s
58C-----------------------------------------------
59#include "implicit_f.inc"
60#include "comlock.inc"
61C-----------------------------------------------
62C C o m m o n B l o c k s
63C-----------------------------------------------
64#include "param_c.inc"
65#include "com04_c.inc"
66#include "com06_c.inc"
67#include "com08_c.inc"
68#include "vect01_c.inc"
69#include "scr06_c.inc"
70C-----------------------------------------------
71C D u m m y A r g u m e n t s
72C-----------------------------------------------
73 INTEGER MAT(NEL), IFLAG, NEL
74 my_real pm(npropm,nummat),
75 . off(nel) ,eint(nel) ,mu(nel) ,
76 . espe(nel) ,dvol(nel) ,
77 . vnew(nel) ,pnew(nel) ,dpdm(nel),
78 . dpde(nel)
79 my_real, INTENT(INOUT) :: psh(nel)
80C-----------------------------------------------
81C L o c a l V a r i a b l e s
82C-----------------------------------------------
83 INTEGER I, MX
84 my_real :: p0,gamma,e0,aa,bb,pp,pstar, pc,v0
85 my_real :: q,q_,cv,rho0,num,denom,unpmu,b,rho
86C-----------------------------------------------
87C S o u r c e L i n e s
88C-----------------------------------------------
89
90 IF(iflag == 0) THEN
91 mx = mat(1)
92 e0 = pm(23 ,mx)
93 gamma = pm(34 ,mx)
94 p0 = pm(32 ,mx)
95 psh(1:nel) = pm(88 ,mx)
96 pstar = pm(160,mx)
97 q = pm(35 ,mx)
98 q_ = pm(36 ,mx)
99 b = pm(161,mx)
100 cv = pm(162,mx)
101 rho0 = pm(1 , mx)
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 mx = mat(1)
114 e0 = pm(23 ,mx)
115 gamma = pm(34 ,mx)
116 p0 = pm(32 ,mx)
117 psh(1:nel) = pm(88 ,mx)
118 pstar = pm(160,mx)
119 q = pm(35 ,mx)
120 q_ = pm(36 ,mx)
121 b = pm(161,mx)
122 cv = pm(162,mx)
123 rho0 = pm(1 , mx)
124 DO i=1,nel
125 eint(i) = eint(i) - half*dvol(i)*(pnew(i)+psh(i))
126 unpmu = one+mu(i)
127 rho = unpmu*rho0
128 v0 = vnew(i)*rho/rho0
129 denom = (vnew(i)/v0-rho0*b)
130 aa = (gamma-one)*(-rho0*q/denom)-gamma*pstar
131 bb = (gamma-one)/ denom
132 dpde(i) = bb !partial derivative
133 pnew(i) = (aa+bb*eint(i)/v0)/(one+bb*dvol(i)/two/v0) ! P(mu[n+1],E[n+1])
134 pnew(i) = max(pnew(i),-gamma*pstar)*off(i)
135 ENDDO
136
137 ELSEIF(iflag == 2) THEN
138 mx = mat(1)
139 e0 = pm(23 ,mx)
140 gamma = pm(34 ,mx)
141 p0 = pm(32 ,mx)
142 psh(1:nel) = pm(88 ,mx)
143 pstar = pm(160,mx)
144 q = pm(35 ,mx)
145 q_ = pm(36 ,mx)
146 b = pm(161,mx)
147 cv = pm(162,mx)
148 rho0 = pm(1 , mx)
149 pc = pm(37, mx)
150 DO i=1, nel
151 IF (vnew(i) > zero) THEN
152 unpmu = one+mu(i)
153 denom = (one-rho0*b*unpmu)
154 num = (espe(i)-rho0*q)
155 pnew(i) = -psh(i) + (gamma-one)*unpmu*num/denom - gamma*pstar
156 pnew(i) = max(pnew(i),max(pc, -gamma*pstar))*off(i)
157 dpde(i) = (gamma-one)*unpmu / denom !partial derivative
158 dpdm(i) = (gamma-one)*num/denom/denom + dpde(i)*(pnew(i)+psh(i))/unpmu/unpmu !total derivative
159 ENDIF
160 ENDDO
161
162 ENDIF
163C-----------------------------------------------
164 RETURN
#define my_real
Definition cppsort.cpp:32
#define max(a, b)
Definition macros.h:21