function y = F(uL,uR,dt,dx)

% define the flux
fuL = (uL^2)/2;
fuR = (uR^2)/2;

% this is for explicit upwind
if uL==uR
    y = fuL;
elseif (fuR-fuL)/(uR-uL) >= 0
    y = fuL;
else
    y = fuR;
end

