Blockstructured Adaptive Mesh Refinement in object-oriented C++
c
c
c =========================================================
subroutine rp1eu(maxmx,meqn,mwaves,mbc,mx,ql,qr,maux,
& auxl,auxr,wave,s,fl,fr)
c =========================================================
c
c # FORCE scheme for the 1D Euler equations. The flux of the FORCE
c # scheme is the arithmetic mean of the fluxes of the finite difference
c # schemes of Richtmyer and Lax-Friedrichs. Use parameters
c # richtmyer, laxfriedrich to switch to the original schemes.
c
c # Eleuterio F. Toro, "Riemann solvers and numerical methods
c # for fluid dynamics", Springer-Verlag, Berlin 1997.
c
c # On input, ql contains the state vector at the left edge of each cell
c # qr contains the state vector at the right edge of each cell
c # On output, wave contains the waves, s the speeds,
c # fl and fr the positive and negative flux.
c
c # Note that the i'th Riemann problem has left state qr(i-1,:)
c # and right state ql(i,:)
c # From the basic clawpack routine step1, rp is called with ql = qr = q.
c
c Author: Ralf Deiterding
c
implicit double precision (a-h,o-z)
dimension ql(1-mbc:maxmx+mbc, meqn)
dimension qr(1-mbc:maxmx+mbc, meqn)
dimension s(1-mbc:maxmx+mbc, mwaves)
dimension wave(1-mbc:maxmx+mbc, meqn, mwaves)
dimension fl(1-mbc:maxmx+mbc, meqn)
dimension fr(1-mbc:maxmx+mbc, meqn)
dimension auxl(1-mbc:maxmx+mbc, maux)
dimension auxr(1-mbc:maxmx+mbc, maux)
common /param/ gamma,gamma1
include "call.i"
c
c # local storage
c ---------------
parameter (max2 = 100000) !# assumes at most 100000 grid points with mbc=2
dimension qint(-1:max2+2,3), fint(-1:max2+2,3),
& auxint(-1:max2+2,0)
logical richtmyer, laxfriedrich
c
data richtmyer /.true./
data laxfriedrich /.true./
c
c # Method returns fluxes
c ------------
common /rpnflx/ mrpnflx
mrpnflx = 1
c
dxdt = 0.5d0*dxcom/dtcom
dtdx = 0.5d0*dtcom/dxcom
c
call flx1(maxmx,meqn,mbc,mx,ql,maux,auxl,fl)
call flx1(maxmx,meqn,mbc,mx,qr,maux,auxr,fr)
c
do 50 i = 2-mbc, mx+mbc
do 50 m=1,meqn
qint(i,m) = 0.5d0*(qr(i-1,m) + ql(i,m)) +
& dtdx*(fr(i-1,m) - fl(i,m))
50 continue
do 60 i = 2-mbc, mx+mbc
do 60 m=1,maux
auxint(i,m) = 0.5d0*(auxl(i,m) + auxr(i,m))
60 continue
call flx1(max2,meqn,mbc,mx,qint,maux,auxint,fint)
c
do 100 i = 2-mbc, mx+mbc
ul = 0.5d0*qr(i-1,2)/qr(i-1,1)
ur = 0.5d0*ql(i ,2)/ql(i ,1)
pl = gamma1*(qr(i-1,3) - 0.5d0*ul**2*qr(i-1,1))
pr = gamma1*(ql(i ,3) - 0.5d0*ur**2*ql(i ,1))
al = dsqrt(gamma*pl/qr(i-1,1))
ar = dsqrt(gamma*pr/ql(i ,1))
s(i,1) = dmax1(dabs(ul-al),dabs(ur-ar))
s(i,2) = dmax1(dabs(ul ),dabs(ur ))
s(i,3) = dmax1(dabs(ul+al),dabs(ur+ar))
do 110 mw=1,mwaves
do 110 m=1,meqn
wave(i,m,mw) = 0.d0
110 continue
do 100 m=1,meqn
if (richtmyer)
& fl(i,m) = fint(i,m)
if (laxfriedrich)
& fl(i,m) = dxdt*(qr(i-1,m) - ql(i,m)) +
& 0.5d0*(fr(i-1,m) + fl(i,m))
if (richtmyer.and.laxfriedrich)
& fl(i,m) = 0.5d0*(fl(i,m) + fint(i,m))
100 continue
c
do 120 i = 2-mbc, mx+mbc
do 120 m=1,meqn
fr(i,m) = -fl(i,m)
120 continue
c
return
end
c
Quickstart Users Guide Programmers Reference Installation Examples Download
AMROC Main Home Contactlast update: 06/01/04