Abstract. We consider the Lighthill-Witham-Richards traffic flow model on a junction composed by one mainline, an onramp and an offramp, which are connected by a node. The onramp dynamics is modeled using an ordinary differential equation describing the evolution of the queue length. The definition of the solution of the Riemann problem at the junction is based on an optimization problem and the use of a right-of-way parameter. The numerical approximation is carried out using Godunov scheme, modified to take into account the effects of the onramp buffer. We present the result of some simulations and check numerically the convergence of the method.Key words. Scalar conservation laws, PDE-ODE systems, Riemann problem, Macroscopic traffic flow models AMS subject classifications. 90B20, 35L651. Introduction. Hydrodynamic models have commonly been used in the literature to describe the macroscopic evolution of vehicular traffic on roads and have been successfully generalized to networks in recent years. In the 1950s, Lighthill and Whitham [18] and Richards [21], independently, proposed a fluid dynamic model for traffic flow on an infinite single road, using a non-linear hyperbolic partial differential equation (PDE). The Cauchy problem has successfully been extended to initialboundary value problem in [1] and then developed specifically for scalar conservation laws with concave flux in [15], and for traffic applications in [22]. More recently, several authors proposed models on networks that take into account different type of solutions at the intersections, see [4,5,7,8,11,12] and the references therein.In this article, we focus on a junction model designed for a ramp metering problem. Ramp metering models have been introduced in the engineering community in a discrete setting, see [19,20] for details. In this article, we apply a continuous approach. We consider the scalar Lighthill-Whitham-Richards model on a network composed of a single junction connecting a mainline, an onramp and an offramp. The mainline evolution is described by a scalar conservation law, while the onramp dynamics is modeled by a buffer of infinite capacity, which is defined by an ordinary differential equation (ODE) depending on the difference between the incoming and outgoing fluxes at the ramp.In the following sections, we prove the existence and uniqueness of solutions of the Riemann problem at the junction. The results are obtained by solving a Linear Programming (LP ) optimization problem. Unlike [9], where the flux through the junction is maximized, our LP -optimization consists in maximizing the flux on the outgoing mainline, see Remark 3 below. The offramp is treated as a sink, and a priority parameter is introduced to ensure uniqueness of the solution. As a modeling choice, the priority is satisfied in an approximate way, i.e., the priority will not always be respected, in benefit of flux maximization.