Conservative Equations: Practice: Sauro Succi
Conservative Equations: Practice: Sauro Succi
Sauro Succi
Shasta.f (SHASTA)
Conti.1
stop
end
SHASTA.1
fnew(j) = a*f(j-1)+c*f(j)+b*f(j+1)
SHASTA.6
fluxl = 0.0
fluxr = 0.0
if (lop.eq.1) then
fluxr = abs(adif)*(f(j+1)-f(j))
fluxl = adif*(f(j-1)-f(j))
fnew(j) = fnew(j) + fluxl - fluxr
write(6,*) 'lop',lop, fluxl,fluxr
endif
SHASTA.7
c ***************************** WARNING !!!!
c This option is based on eq. 23 of Boris-Book paper
c I did not re-derive myself. Boris-Book only gives the
c rightward flux (fluxr) expression, so there might be an
c ambiguity/error in the way i constructed the left flux (fluxl)
c Their notation leaves several ambiguities on the signs of the fluxes
c so, although it seems to give reasonable results,
c I have no guarantee that the implementation is correct
c ****************************************
SHASTA.8
c flux limiter: compact form
dl1 = f(j-1)-f(j)
dl2 = f(j-2)-f(j-1)
dr1 = f(j+1)-f(j)
dr2 = f(j+2)-f(j+1)
sr1 = 0.0
if(abs(dr1).gt.0.) sr1 = dr1/abs(dr1)
sl1 = 0.0
if(abs(dl1).gt.0.) sl1 = dl1/abs(dl1)
fminr = min(min(dr1*sr1,abs(adif)*abs(dr1)),dr2*sr1)
fluxr = sr1*max(0.0,fminr)
fminl = min(min(dl1*sl1,adif*abs(dl1)),dl2*sl1)
fluxl = sl1*max(0.0,fminl)