42 1 IFLAG ,NEL ,PMIN ,OFF ,EINT ,MU ,MU2 ,
43 2 ESPE ,DVOL ,DF ,VNEW ,PSH ,RHO0, RHO,
44 3 PNEW ,DPDM ,DPDE ,THETA,POLD ,EOS_STRUCT)
48 USE constant_mod ,
ONLY : zero, em05, half, one, two, third, fourth, one_fifth
49 USE eos_param_mod ,
ONLY : eos_param_
77 INTEGER,
INTENT(IN) :: IFLAG, NEL
78 my_real,
INTENT(IN) :: PMIN,OFF(NEL),MU(NEL)
79 my_real,
INTENT(IN) :: MU2(NEL) ,ESPE(NEL) ,DVOL(NEL) ,DF(NEL), VNEW(NEL)
80 my_real,
INTENT(INOUT) :: psh(nel),pnew(nel),dpdm(nel),dpde(nel),eint(nel),theta(nel)
81 my_real,
INTENT(IN) :: pold(nel), rho0(nel), rho(nel)
82 TYPE(eos_param_),
INTENT(IN) :: EOS_STRUCT
88 my_real :: r_GAS,A0,A1,A2,A3,A4,CP(NEL),CV
89 my_real :: temp, fun, dfun, tol, error, incr
90 INTEGER :: ITER, MAX_ITER
100 a0 = eos_struct%UPARAM(1)
101 a1 = eos_struct%UPARAM(2)
102 a2 = eos_struct%UPARAM(3)
103 a3 = eos_struct%UPARAM(4)
104 a4 = eos_struct%UPARAM(5)
105 r_gas = eos_struct%UPARAM(6)
106 p0 = eos_struct%UPARAM(7)
115 DO WHILE(error > tol .AND. iter < max_iter)
118 fun = a0 * temp + half * a1 * temp**2 + third * a2 * temp**3 +
119 . fourth * a3 * temp**4 + one_fifth * a4 * temp**5 - r_gas * temp - espe(i) / rho0(i)
120 IF (abs(fun) < tol)
EXIT
121 dfun = a0 + a1 * temp + a2 * temp**2 + a3 * temp**3 + a4 * temp**4 - r_gas
124 error = abs(incr / temp)
129 cp(i) = a0 + a1 * temp + a2 * temp**2 + a3 * temp**3 + a4 * temp**4
134 dpdm(i) = rho0(i)*gamma*r_gas*theta(i)
135 dpde(i) = gamma*(one+mu(i))
136 pnew(i) = rho0(i)*(one+mu(i))*r_gas*theta(i)
137 pnew(i) = pnew(i)-psh(i)
141 ELSEIF(iflag == 1)
THEN
145 temp = pold(i)/rho(i)/r_gas
148 DO WHILE(error > tol .AND. iter < max_iter)
151 fun = a0 * temp + half * a1 * temp**2 + third * a2 * temp**3 +
152 . fourth * a3 * temp**4 + one_fifth * a4 * temp**5 - r_gas * temp - espe(i) / rho0(i)
153 IF (abs(fun) < tol)
EXIT
154 dfun = a0 + a1 * temp + a2 * temp**2 + a3 * temp**3 + a4 * temp**4 - r_gas
157 error = abs(incr / temp)
162 cp(i) = a0 + a1 * temp + a2 * temp**2 + a3 * temp**3 + a4 * temp**4
165 pnew(i) = rho0(i)*(one+mu(i))*r_gas*theta(i)
166 eint(i) = eint(i) - half*dvol(i)*pnew(i)
167 pnew(i) = pnew(i)-psh(i)
170 dpde(i) = gamma*(one+mu(i))
173 ELSEIF (iflag == 2)
THEN
177 temp = pold(i)/rho(i)/r_gas
180 DO WHILE(error > tol .AND. iter < max_iter)
183 fun = a0 * temp + half * a1 * temp**2 + third * a2 * temp**3 +
184 . fourth * a3 * temp**4 + one_fifth * a4 * temp**5 - r_gas * temp - espe(i) / rho0(i)
185 IF (abs(fun) < tol)
EXIT
186 dfun = a0 + a1 * temp + a2 * temp**2 + a3 * temp**3 + a4 * temp**4 - r_gas
189 error = abs(incr / temp)
194 cp(i) = a0 + a1 * temp + a2 * temp**2 + a3 * temp**3 + a4 * temp**4
197 IF (vnew(i) > zero)
THEN
200 dpdm(i) = rho0(i)*gamma*r_gas*theta(i)
201 dpde(i) = gamma*(one+mu(i))
202 pnew(i) = rho0(i)*(one+mu(i))*r_gas*theta(i)
subroutine idealgas_vt(iflag, nel, pmin, off, eint, mu, mu2, espe, dvol, df, vnew, psh, rho0, rho, pnew, dpdm, dpde, theta, pold, eos_struct)