c c ========================================================== subroutine flgout3meu(q,mx,my,mz,lb,ub,qo,mxo,myo,mzo,lbo,ubo, & lbr,ubr,shaper,meqn,nc,t) c ========================================================== c c # Computes primitives for two-component Euler equations c # for output and flagging. c c # Copyright (C) 2002 Ralf Deiterding c # Brandenburgische Universitaet Cottbus c c # Copyright (C) 2003-2007 California Institute of Technology c # Ralf Deiterding, ralf@cacr.caltech.edu c implicit double precision(a-h,o-z) common /PhysData/ Wk, g, pinf, RU, PA dimension Wk(2), g(2), pinf(2) c integer meqn, mx, my, mz, mxo, myo, mzo dimension q(meqn,mx,my,mz), qo(mxo,myo,mzo) dimension Xk(2), cap(2) c integer lb(3), ub(3), lbo(3), ubo(3), lbr(3), ubr(3), shaper(3), & mresult, stride, imin(3), imax(3), i, getindx, d c stride = (ub(1) - lb(1))/(mx-1) do 5 d = 1, 3 imin(d) = max(lb(d), lbr(d)) imax(d) = min(ub(d), ubr(d)) c if (mod(imin(d)-lb(d),stride) .ne. 0) then imin(d) = imin(d) + stride - mod(imin(d)-lb(d),stride) endif imin(d) = getindx(imin(d), lb(d), stride) c if (mod(imax(d)-lb(d),stride) .ne. 0) then imax(d) = imax(d) - mod(imax(d)-lb(d),stride) endif imax(d) = getindx(imax(d), lb(d), stride) 5 continue c cap(1) = 1.d0 / (g(1)-1.d0) cap(2) = 1.d0 / (g(2)-1.d0) do 10 i = imin(1), imax(1) do 10 j = imin(2), imax(2) do 10 k = imin(3), imax(3) c if (nc.gt.5) then gamma1 = 1.d0 / q(6,i,j,k) gamma = gamma1 + 1.d0 p = gamma1*(q(5,i,j,k) - 0.5d0*(q(2,i,j,k)**2+ & q(3,i,j,k)**2+q(4,i,j,k)**2)/q(1,i,j,k) - & q(7,i,j,k)) pin = q(7,i,j,k)*gamma1/gamma Xk(1) = (q(6,i,j,k)-cap(2)) / (cap(1)-cap(2)) Xk(2) = 1.d0-Xk(1) W = Xk(1)*Wk(1) + Xk(2)*Wk(2) endif c c # Density if (nc.eq.1) qo(i,j,k) = q(1,i,j,k) c # Velocity u if (nc.eq.2) qo(i,j,k) = q(2,i,j,k)/q(1,i,j,k) c # Velocity v if (nc.eq.3) qo(i,j,k) = q(3,i,j,k)/q(1,i,j,k) c # Velocity w if (nc.eq.4) qo(i,j,k) = q(4,i,j,k)/q(1,i,j,k) c # Total energy density if (nc.eq.5) qo(i,j,k) = q(5,i,j,k) c # Temperature if (nc.eq.6) qo(i,j,k) = p/(q(1,i,j,k)*RU/W) c # Pressure if (nc.eq.7) qo(i,j,k) = p c # Gamma if (nc.eq.8) qo(i,j,k) = gamma c # Y1 if (nc.eq.9) qo(i,j,k) = Xk(1)*Wk(1)/W c # Y2 if (nc.eq.10) qo(i,j,k) = Xk(2)*Wk(2)/W c # pinf if (nc.eq.11) qo(i,j,k) = pin c # Speed of sound if (nc.eq.12) qo(i,j,k) = dsqrt(gamma*(p+pin)/ & q(1,i,j,k)) c 10 continue c return end