• VTF
  • FSI
  • AMROC
  • SFC
  • Motion
  • STLIB
  • Main Page
  • src/1d/equations/euler/rpznd/flgout1euznd.f

    c
    c     ==========================================================
          subroutine flgout1euznd(q,mx,lb,ub,qo,mxo,lbo,ubo,
         &     lbr,ubr,shaper,meqn,nc,t)
    c     ==========================================================
    c     # Computes primitives for ZND Euler equations for output 
    c     # 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 /param/  gamma,gamma1,q0
          common /PhysData/  Wk(2), RU, PA
    c
          integer meqn, mx, mxo
          dimension q(meqn,mx), qo(mxo)
    c
          integer  lb(1), ub(1), lbo(1), ubo(1), lbr(1), ubr(1), shaper(1), 
         &     mresult, stride, imin(1), imax(1), i, getindx
    c
          stride = (ub(1) - lb(1))/(mx-1)
          imin(1) = max(lb(1), lbo(1), lbr(1))
          imax(1) = min(ub(1), ubo(1), ubr(1))
    
          if (mod(imin(1)-lb(1),stride) .ne. 0) then
             imin(1) = imin(1) + stride - mod(imin(1)-lb(1),stride) 
          endif
          imin(1) = getindx(imin(1), lb(1), stride)  
    
          if (mod(imax(1)-lb(1),stride) .ne. 0) then
             imax(1) = imax(1) - mod(imax(1)-lb(1),stride) 
          endif
          imax(1) = getindx(imax(1), lb(1), stride)  
    c
          do 10 i = imin(1), imax(1)
    c        # Density
             if (nc.eq.1) qo(i) = q(1,i) + q(2,i) 
    c        # Velocity u
             if (nc.eq.2) qo(i) = q(3,i)/(q(1,i) + q(2,i))
    c        # Total energy density
             if (nc.eq.3) qo(i) = q(4,i)
    c        # Temperature 
             if (nc.eq.4) then
                 rho = q(1,i) + q(2,i)
                 p = gamma1*(q(4,i) - q(2,i)*q0 -
         &           0.5d0*q(3,i)**2/rho)
                 W = 1.d0/((q(1,i)/rho)/Wk(1) + (q(2,i)/rho)/Wk(2))
                 qo(i) = (p*W)/(rho*RU)
              endif
    c        # Pressure
             if (nc.eq.5) qo(i) = gamma1*(q(4,i) - q(2,i)*q0 -
         &        0.5d0*q(3,i)**2/(q(1,i) + q(2,i)))
    c        # Gamma 
             if (nc.eq.6) qo(i) = gamma
    c        # Y1 
             if (nc.eq.7) qo(i) = q(1,i) / (q(1,i) + q(2,i))
    c        # Y2 
             if (nc.eq.8) qo(i) = q(2,i) / (q(1,i) + q(2,i))
     10   continue         
    
          return
          end
    

<