We are interested in the simulation and optimization of gas and water transport in networks. Those networks consist of pipes
and various other components like compressor/pumping stations and valves. The flow through the pipes can be described by different
models based on the Euler equations, including hyperbolic systems of partial differential equations. For the other components,
algebraic or ordinary differential equations are used. Depending on the data, different models can be used in different regions
of the network. We present a strategy that adaptively applies the models and discretizations, using adjoint-based error estimators
to maintain the accuracy of the solution. Finally, we give numerical examples for both types of networks.