Numerical Advection Schemes in Two Dimensions
Numerical Advection Schemes in Two Dimensions
Numerical Advection Schemes in Two Dimensions
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
REFERENCES<br />
REFERENCES<br />
(1/2)*cv*(f(k,pp)-f(k,p));<br />
fim<strong>in</strong>usm(k,p) = (1/2)*(f(km,p)+f(k,p)) -<br />
(1/2)*cu*(f(k,p)-f(km,p));<br />
fjm<strong>in</strong>usm(k,p) = (1/2)*(f(k,pm)+f(k,p)) -<br />
(1/2)*cv*(f(k,p)-f(k,pm));<br />
end<br />
f(k,p) = f(k,p) - cu*(fiplusm(k,p)-fim<strong>in</strong>usm(k,p)) -<br />
cv*(fjplusm(k,p)-fjm<strong>in</strong>usm(k,p)) +<br />
cu*cv*(f(k,p)-f(k,pm)-f(km,p)+f(km,pm));<br />
% Plot f at this timestep<br />
contourf(x,y,f)<br />
pause(0.1)<br />
end<br />
err = abs(f - h);<br />
rss = sum(sum(err.^2));<br />
rss3 = sum(sum(err.^3));<br />
error2 = (rss/(n^2))^(1/2);<br />
error3 = (rss3/(n^2))^(1/3);<br />
error<strong>in</strong>f = max(max(err));<br />
errorstuff = [error2;error3;error<strong>in</strong>f]<br />
contourf(x,y,f);<br />
xlabel(’x’)<br />
ylabel(’y’)<br />
19