The best way to control transients in penstock is using the surge tank which is an open
chamber connected to the pipeline which reflects the pressure waves by supplying or
storing excess liquid. You can calculate the transients of penstock using differential calculus methods by considering the parameters like flow rate in the standpipe, length of the standpipe, weight of the liquid in the standpipe, friction force, the height of the water surface in the tank, elevation of the liquid surface in the
tank. For more details related to this study, please refer to literature.
Hope this would help you for carrying out the numerical modeling of the penstock.