## 2 A Fluid Dynamics Model for Traffic Simulation
### Numerical schemes  
The solution of the Riemann problem on arcs is performed using numerical approximation schemes. In particular, in the first implementation of the software, three different numerical schemes were taken into account, the Godunov scheme, the \(1\)-order Kinetic scheme, and the \(2\)-order Kinetic scheme. The introduction of numerical approximation schemes requires the definition of a _space step_, say \(\Delta s\), in such a way that the linear interval \([a_{i},b_{i}]\) of length \(l_{i}\), associated with an arc \(i\in E\), is divided into a finite number of segments given by \(|\frac{l_{i}}{\Delta s}|\). In Section 4, we present some tests concerning the computational time required by the use of these three different schemes, in order to find the appropriate trade-off between numerical accuracy and computational effort. The choice of \(\Delta s\) turns out to be a fundamental parameter in this sense. Let us now describe in more details the Godunov scheme, while we refer the reader to [25] for the other schemes. Godunov scheme on a road network. Now, in order to describe Godunov scheme we need to introduce a _numerical grid_ with the following notation:  
* \(\Delta s\) is the space grid size on each road \(I_{i}=[a_{i},b_{i}]\);
* \(\Delta t\) is the time grid size on the time interval \([0,T]\);
* \((t_{l},x_{m})=(l\Delta t,m\Delta s)\), for \(l=0,1,\ldots,L\) and \(m=0,1,\ldots,M\), are the grid points, with \(L\) and \(M\), respectively, the number of time and space nodes of the grid. For a function \(v\) defined on the grid we write \(v_{m}^{l}=v(t_{l},x_{m})\). Notice that, in general, \(\Delta s\) may vary depending on the length of each road. Godunov scheme is based on the local resolution to Riemann problems and it proceeds as follows. Piecewise constant approximations of the initial data are used as the initial data of Riemann problems. Waves in two neighbour cells do not interact before time \(\Delta t\) under the CFL condition \(\Delta t\leq\frac{1}{2\lambda_{max}}\Delta s\), where \(\lambda_{max}\) is the maximal speed of a wave, i.e. \(\max|f^{\prime}(\rho)|\). It is then possible to define a unique solution in the strip \((t_{l},t_{l+1})\times\mathbb{R}\) by piecing the solutions obtained in each cell together. The exact solution is projected on a piecewise constant function \(v_{m}^{l+1}=\frac{1}{\Delta s}\int_{x_{m}}^{x_{m+1}}v^{\Delta}(x,t_{l+1})dx,\) then the mean is obtained by the Gauss-Green formula, and this procedure is repeated recursively. Godunov scheme can be expressed in the conservative form as:  
\[v_{m}^{l+1}=v_{m}^{l}-\frac{\Delta t}{\Delta s}\big{(}g^{G}(v_{m}^{l},v_{m+1} ^{l})-g^{G}(v_{m-1}^{l},v_{m}^{l})\big{)},\;l=0,1,\ldots,L-1,\;\;m=0,1,\ldots,M, \tag{9}\]with \(g^{G}(u,v)\) the numerical flux. We assume that the flux function \(f\) is concave and has a unique maximum point \(\sigma\), so that \(f(\sigma)=f^{max}\). Then \(g^{G}(u,v)\) is given by:  
\[g^{G}(u,v)=\left\{ \begin{array}{ll}\min(f(u),f(v))&\mbox{if }u\leq v,\\ \\ f(u)&\mbox{if }v<u<\sigma,\\ \\ f^{max}&\mbox{if }v<\sigma<u,\\ \\ f(v)&\mbox{if }\sigma<v<u.\\ \end{array} \right.\]  
Boundary conditions of the scheme are imposed for incoming road not linked on the left and for outgoing road not linked on the right. Conditions at a junction. For roads connected at the right endpoint, the interaction at a junction is taken into account as follows:  
\[v_{M}^{l+1}=v_{M}^{l}-\frac{\Delta t}{\Delta s}\big{(}\hat{\gamma}_{i}-g^{G}(v _{M-1}^{l},v_{M}^{l})\big{)},\]  
while for roads connected at the left endpoint we have:  
\[v_{0}^{l+1}=v_{0}^{l}-\frac{\Delta t}{\Delta s}\big{(}g^{G}(v_{0}^{l},v_{1}^{l })-\hat{\gamma}_{j}\big{)},\]  
where \(\hat{\gamma}_{i},\hat{\gamma}_{j}\) are the maximized fluxes, respectively on incoming and outgoing roads, computed solving the linear programming problem of Section 2.2. Other numerical schemes. A particularly fast scheme was presented in [26].