In general, you cannot always degenerate any given PDE to an ODE (or lower degree of freedom PDE). In special cases, with introduction of new variables you may rework the equations into lower degree PDEs or ODEs. Very simple example of that is "Boltzmann transform" for 1D heat-diffusion equation:
Consider that, the transform has a physical meaning. So an scale is made based on "physics of the phenomenon" that let you to convert the independent variables x and t to eta and degenerate the PDE to an ODE. Boltzman developed that with scaling of phenomenon and find the "characteristic lines" of the solution.
2- Back to your question:
Governing PDE of water hammer in pipe is hyperbolic system of equations, one mass and one momentum, it is basically a shock wave. I think "travelling wave solution" or in other words "transformation of time and space along the characteristics of shock propagation" can degenerate the PDE system for you.
3- Also consider this point:
The nature of the PDE you are dealing (Water Hammer, or Surge in Pipe) with is very similar to Saint-Venant Equations (Shallow Water Wave) and Euler Equations (Aerospace), therefore any method which works for reduction of those two may be useful for your case. You may dig in the literature of Euler and Saint-Venant Equations to find your answer.
I focus only on the framework of the numerical solution. You can use the semi-discrete approach, that is the spatial derivatives are discretized so that you have a system of ODE in time,
The method Filippo Maria Denaro referring to is also known as "Method of Line" (MOL), it simply means you freeze the time and solve the system only in space at that time, then you march on time to the next time step with a method of numerical solving of ODE (Euler, Huen, R-K, Adam-Bashforth ...)