29 2 ESPE ,DVOL ,DF ,VNEW ,MAT ,PSH ,
30 3 PNEW ,DPDM ,DPDE ,THETA,SIG)
53!----------------------------------------------------------------------------
57#include "implicit_f.inc"
66#include "vect01_c.inc"
71 INTEGER MAT(NEL), IFLAG, NEL
72 my_real PM(NPROPM,NUMMAT),
73 . off(nel) ,eint(nel) ,mu(nel) ,
74 . mu2(nel) ,espe(nel) ,dvol(nel) ,df(nel) ,
75 . vnew(nel) ,pnew(nel) ,dpdm(nel),
76 . dpde(nel) ,theta(nel)
77 my_real,
INTENT(INOUT) :: psh(nel)
78 my_real,
INTENT(IN) :: sig(nel,6)
83 my_real :: P0,GAMMA,RHO,RHO0
84 my_real :: r_gas,a0,a1,a2,a3,a4,cp(nel),cv
85 my_real :: temp, fun, dfun, tol, error, incr
87 INTEGER :: ITER, MAX_ITER
100 psh(1:nel) = pm(88,mx)
109 rho = rho0 * (one + mu(i))
110 pold=-third*(sig(i,1)+sig(i,2)+sig(i,3))
111 temp = pold/rho/r_gas
114 DO WHILE(error > tol .AND. iter < max_iter)
117 fun = a0 * temp + half * a1 * temp**2 + third * a2 * temp**3 +
118 . fourth * a3 * temp**4 + one_fifth * a4 * temp**5 - r_gas * temp - espe(i) / rho0
119 IF (abs(fun) < tol)
EXIT
120 dfun = a0 + a1 * temp + a2 * temp**2 + a3 * temp**3 + a4 * temp**4 - r_gas
123 error = abs(incr / temp)
128 cp(i) = a0 + a1 * temp + a2 * temp**2 + a3 * temp**3 + a4 * temp**4
133 dpdm(i) = rho0*gamma*r_gas*theta(i)
134 dpde(i) = gamma*(one+mu(i))
135 pnew(i) = rho0*(one+mu(i))*r_gas*theta(i)
136 pnew(i) = pnew(i)-psh(i)
140 ELSEIF(iflag == 1)
THEN
145 psh(1:nel) = pm(88,mx)
155 rho = rho0 * (one + mu(i))
156 pold=-third*(sig(i,1)+sig(i,2)+sig(i,3))
157 temp = pold/rho/r_gas
160 DO WHILE(error > tol .AND. iter < max_iter)
163 fun = a0 * temp + half * a1 * temp**2 + third * a2 * temp**3 +
164 . fourth * a3 * temp**4 + one_fifth * a4 * temp**5 - r_gas * temp - espe(i) / rho0
165 IF (abs(fun) < tol)
EXIT
166 dfun = a0 + a1 * temp + a2 * temp**2 + a3 * temp**3 + a4 * temp**4
169 error = abs(incr / temp)
174 cp(i) = a0 + a1 * temp + a2 * temp**2 + a3 * temp**3 + a4 * temp**4
177 pnew(i) = rho0*(one+mu(i))*r_gas*theta(i)
178 eint(i) = eint(i) - half*dvol(i)*pnew(i)
179 pnew(i) = pnew(i)-psh(i)
182 dpde(i) = gamma*(one+mu(i))
185 ELSEIF (iflag == 2)
THEN
190 psh(1:nel) = pm(88,mx)
199 rho = rho0 * (one + mu(i))
200 pold=-third*(sig(i,1)+sig(i,2)+sig(i,3))
201 temp = pold/rho/r_gas
204 DO WHILE(error > tol .AND. iter < max_iter)
207 fun = a0 * temp + half * a1 * temp**2 + third * a2 * temp**3 +
208 . fourth * a3 * temp**4 + one_fifth * a4 * temp**5 - r_gas * temp - espe(i) / rho0
209 IF (abs(fun) < tol)
EXIT
210 dfun = a0 + a1 * temp + a2 * temp**2 + a3 * temp**3 + a4 * temp**4 - r_gas
213 error = abs(incr / temp)
218 cp(i) = a0 + a1 * temp + a2 * temp**2 + a3 * temp**3 + a4 * temp**4
221 IF (vnew(i) > zero)
THEN
224 dpdm(i) = rho0*gamma*r_gas*theta(i)
225 dpde(i) = gamma*(one+mu(i))
226 pnew(i) = rho0*(one+mu(i))*r_gas*theta(i)
subroutine idealgas_vt(iflag, nel, pm, off, eint, mu, mu2, espe, dvol, df, vnew, mat, psh, pnew, dpdm, dpde, theta, sig)