Visual Programming Language for hydropower plants Facility Management

Francesco Loddo1[0009-0007-1185-2849] and Anna Osello1[0000-0002-0343-1223]

1 Politecnico di Torino, Department of Building, Structural and Geotechnical Engineering (DISEG), Turin, Italy
lncs@springer.com

Abstract. In recent decades, climate change and aging infrastructure have posed new challenges for Civil Engineering. In the domain of hydraulic infrastructures, there is a growing need to plan life-cycle management from the earliest design stages to optimize maintenance and prevent failures. The digitization of infrastructures, enabled by the development of Building Information Modelling (BIM), enhances resource control and collaboration among the various stakeholders involved in the project. It also establishes a framework for accessing valuable geometric and physical data for Facility Management (FM).

This article investigates the integration of Visual Programming Language (VPL) with BIM models of hydropower plants, performing unsteady-state simulations within a unified platform that connects model parameters with hydraulic calculations. The proposed application is tested in a real-world case study, highlighting its potential for both design and FM operations.

Keywords: BIM, VPL, FM, Hydropower Plants.

Introduction

Awareness of climate change is driving a rapid increase in demand for renewable energy sources, as evidenced by data from the International Renewable Energy Agency (IRENA) [1]. In recent years, renewable energy capacity has soared, doubling since 2010, as a clear testament to its growing viability and acceptance.

In this context, hydropower remains the most widely utilized renewable energy source worldwide [2], playing a pivotal role in the energy transition process aimed at reducing reliance on fossil fuels. Its distinct advantages make it highly complementary to other renewable energy sources. Notably, hydropower is by far the most effective technology for energy storage, particularly through pumped storage power plants [3], and it stands out as the only fully programmable renewable source, especially when compared to solar and wind power. The substantial gravitational potential energy stored in reservoirs allows to mitigate the effects of drought periods, meet multiple water use, and ensure a stable electricity supply [4].

Although hydropower plants require high initial installation costs, they are distinguished by their long lifespan (up to 200 years) and relatively short payback period (5-10 years) [5]. Nowadays, in many countries hydropower is the most well-established renewable energy source in many countries: for instance, in Italy plants began emerging in the late 1800s, supporting industrial development and now ac-counting for 40 percent of the nation’s total energy production [6].

Considering all the above, effective operation and maintenance planning is crucial to ensuring the efficiency and longevity of hydropower plants [7]. Scheduling maintenance activities is essential to maintaining business continuity and preventing unplanned generation interruptions. During operational phases, hydroelectric power plants may encounter many experience various faults, such as bearing failures, unbalance, stator winding short circuits, excessive cavitation. These issues can cause severe damage to turbine-generator units. To mitigate this risk, sensors are usually installed to detect faults and send signals to the speed regulator, triggering an immediate shutdown by closing the adjustment blades. However, in such cases, the pressure of the water hammer impacts appears directly in front of the adjustment blades which are closed in the snail [8]. This leads to pressure waves propagating through the pressurized waterway system, which can pose serious threats to the structural integrity of the plant.

The scientific literature offers several numerical tools for analyze these phenomena [9-10-11-12], with the most widely used being the method of characteristics (MoC), a one-dimensional model with a high computational efficiency, and a programming simplicity [13].

Starting from the principles of building information modelling (BIM), this study aims to integrate a MoC-based computational code with BIM models of a hydro-power plant through the using a visual programming language (VPL) interface. Unlike the graphics in a Computer-Aided Design (CAD) model, BIM is based on a 3D virtual model that provides a geometric, object-oriented representation of the project. BIM models incorporate embedded data, including design criteria, detailed specifications, and performance parameters. Additionally, a BIM model can store information related to commissioning, maintenance schedules, spare parts lists, and other data essential for managing the project throughout its entire life-cycle [14].

By integrating VPL interfaces into BIM models, new geometries can be generated and all the information stored in BIM models can be extracted. This is achieved through the development of programs that allow users to interactively manipulate visual elements rather than relying on textual scripting [15]. This work uses Dynamo, a VPL interface linkable within Autodesk BIM-base software, such as Revit and Civil 3D, as a platform where to perform hydraulic simulations related to a real hydropower system located in the Southern Italy. The ability to use not only preset blocks but also custom textual code written in Python within Dynamo enables the development of a custom MoC-based program.

The second section of this research will review the state of the art in the scientific literature regarding VPL applications in the Architecture, Engineering, Construction, and Operation (AECO) industry. The third section will present the case study, while the fourth section will detail the methodology, focusing on the adopted MoC and its implementation within Dynamo.

Relevant literature

Computer programming has always played a complementary role in BIM processes, aiding in the development of applications that support the digitalization of projects in the AECO industry. However, areas such as parametric design, generation of analysis graphs, and emissions estimation have not yet been fully integrated. This gap can be addressed through specific programming codes, which often demand advanced programming skills. To overcome these challenges, BIM software developers have introduced VPL-based tools [16].

Typical VPL tools offer a range of predefined nodes capable of performing mathematical calculation tasks, generating geometry, and extracting data from BIM model elements. These nodes can function independently or interact with others by receiving inputs and returning outputs. In addition, VPL interfaces such as Dynamo or Grasshopper, the most commonly used tools, allow for the integration of textual programming language, enabling the user to create custom nodes. For instance, both platforms support the use of Python scripts, allowing for more advanced customization in computational design.

The literature highlights several benefits of this approach. Through an intuitive interface, VPL enhance design flexibility, facilitating increased automation and efficiency in BIM workflows. Fig. 1 illustrates the keywords identified within the research context, emphasizing the various fields in which BIM and VPL integration can be applied.

Fig. 1. Research framework keywords

In the AECO industry, VPL tools are primarily applied during the design phase, but some researchers have explored their potential for facility management (FM). While most studies focus on building-related applications, the use of VPL for large hydraulic infrastructures appears still underdeveloped.

When designing, VPL is particularly useful for modeling complex geometries. Kossakowski [17] explores the application of Dynamo in Revit for structural design, demonstrating how truss beams can be modeled by defining a grid of characteristic points between which structural elements are spanned. Similar grids can also be used to generate free geometries structures, dividing them into arches spanned between characteristic points. Beyond geometry generation, VPL also accelerates repetitive tasks, such as defining distribution rules for masonry wall components [18]. In the field of hydraulic infrastructure, VPL tools assist in managing parameters that define the geometry of complex structures like arch dams. Chen et al. [19] propose using VPL to automate the interpolation of arch ring shape parameters, enabling the extraction of control values for equations that define the upper and lower arch ring curves as shape parameters.

The ability to extract parameters from an already assembled BIM model enables additional applications that enhance the life-cycle management of buildings. VPL facilitates regulatory compliance checks by validating that specific parameters remain within predefined limits. For instance, by accessing the wall components of a building model, elements that meet or fail a given criterion can be highlighted [20]. Similarly, excavation slopes can be easily monitored to prevent collapses and proactively managing risks [21]. VPL tools also allow for the quick calculation and verification of minimum room sizes and circulation areas, comparing them against guide-lines established by relevant regulations [22]. Additionally, studies demonstrate how VPL tools can enhance safety performance and support energy performance analysis. Khan et al. [23] use Grasshopper to determine the optimal placement of fire extinguishers in a building by generating Voronoi polygons. Similarly, Kensek [24] employs Dynamo to assess a building’s energy performance based on its insulation layers. By reading data from a light sensor and extracting information about the sun’s position in Revit, the VPL tool dynamically adjusts the angle of shading panels within the BIM model.

The lack of established applications in the literature regarding the uses of VPL tools to simulate hydraulic phenomena that are established in large infrastructures motivated this study to develop an application that connects an unsteady-state simulation code with BIM models. The goal is to enable more integrated and efficient analysis within the BIM environment.

Case study

The application developed in this study is part of the project for the construction of a new adduction network that will draw water from the existing Campolattaro reservoir, located in southern Italy, in the province of Benevento. This system is designed to supply approximately 2 million inhabitants for both potable and irrigation purposes.

This study specifically focuses on the initial part of this large infrastructure, which follows a typical hydropower plant layout [25], as shown in Fig. 2.

Fig. 2. Hydropower plant layout

It consists of a long, low-slope underground adduction pipeline connected with the water intake structure and transports a maximum flow of 7.6 m³/s to a steeply sloped penstock located upstream of the hydropower plant. To mitigate the effects of water hammer phenomena, a surge tank (ST) is positioned between these two pipe-lines. Finally, at the downstream end of the system, the water is treated for potable use before being distributed to utilities. All pipelines analyzed in this study have a circular cross-section and are made of steel, with the long adduction pipeline divided into two sections of different diameters.

The following Table 1 gives a summary of the geometric parameters of the main system components

Table 1. Dimensions of the main elements of the system.

Element	Length [m]	Diameter [mm]	Thickness [mm]
Adduction pipeline (initial section)	14,0	1800	16
Adduction pipeline (second section)	7304,1	2200	16
Surge tank	72,1	2200	16
Penstock	546,8	1800	16

The hydropower plant features two hydraulic turbines, a Pelton and a Francis, that operate with varying flow rates depending on the time of year. Flow rate adjustments are regulated by a valve located upstream of the hydraulic turbines. This causes the generation of pressure waves propagating through the pipelines, which are analyzed in this study using a MoC-based approach.

Methodology

This section describes the system architecture of the proposed BIM-integrated platform for simulating the water hammer effect in hydropower plants, exploring software and the theoretical framework behind the unsteady-state phenomena modeling. The platform is built around a BIM model of the infrastructure developed in Autodesk Civil 3D. This software is designed especially for civil engineers, empowering them to meet complex infrastructure challenges in a 3D model-based environment [26].

To extract the necessary data for hydraulic simulations, a VPL interface is implemented with Dynamo [27]. This process is further enhanced using the Civil3DToolkit add-on, which expands Dynamo’s node library, increasing the level of interoperability with Civil 3D elements.

The Fig. 3 shows the type of data extracted from the model related to the geometric dimensions of the pipelines, such as length, inner diameter, and wall thickness.

Fig. 3. Data extraction from the BIM model through Dynamo

These data, along with additional manually entered information, regarding valve operation details and the time interval to be simulated (Fig. 4), serve as inputs for custom nodes. These nodes contain Python-based textual programming codes to simulate the behavior of the system when hydraulic transients occur.

Fig. 4. Valve operation details and simulation parameters

Governing equations of hydraulic transients and MoC

The mathematical approach adopted for this purpose is based on the governing equations for transient flows in closed conduits. These equations are derived by the continuity and momentum equations [28], which, in their simplified forms, are expressed as follows:

Continuity equation

(1)

Momentum equation

(2)

The nomenclature used in equations (1) and (2) are reported in the following Table 2:

Table 2. Nomenclature adopted in equations

A	= pipeline cross-sectional area (m2)
H	= pressure head (m)
t	= time (s)
a	= wave speed in circular pipe (m/s)
g	= acceleration of gravity (m/s2)
Q	= flow rate (m3/s)
x	= distance along the pipeline (m)
R	= resistance coefficient for MoC formulation
Ca	= MoC recurrent parameter (Ca=gA/a)

Equations (1) and (2) are partial differential equations (PDE) for which a direct analytical solution is not feasible. However, using a MoC approach, they can be transformed into ordinary differential equations (ODE) along characteristic lines, allowing for numerical resolution [29]. This transformation is achieved by imposing a unique value for the dx/dt ratio:

(3)

Considering this ratio, equation (2) is transformed into the following form:

if	(4)

if	(5)

Equations (4) and (5) defines two characteristics lines, that can be schematically represented as in Fig. 5, where abscissa parameter denotes the space step while the time step is represented by the vertical ordinate parameters.

Fig. 5. MoC model calculation mesh

The integration of equations (4) and (5) along the positive and negative characteristics lead to two equations that allow to calculate the discharge Q and the piezometric head H in central nodes of the MoC calculation mesh:

(6)

(7)

To begin the calculation, initial conditions are needed, while at initial and final nodes of the system, and at points of discontinuity such as the ST inlet, boundary conditions are needed to analyze hydraulic transient phenomena.

Initial conditions

Steady-state behavior conditions can be assumed as initial conditions. To establish hydraulic head and flow rate values in these conditions, a set of equations must be solved, considering major head losses along the pipelines and the hydraulic constraints at key discontinuity points, such as the inlet of the adduction tunnel, the downstream valve, and branching sections. The equations used for this purpose are presented in the following sections, and their solution provides flow rate and hydraulic head values at the initial time of the simulation.

Major losses. Major losses are defined as distributed head losses (∆H) along a pipe. Their value can be determined with the following equation:

(8)

In which L is the pipe length, λ is a friction coefficient, and D is the pipe diameter.

Upstream reservoir. At the entry of the adduction tunnel, the hydraulic head (H0) can be considered equal to the water level in the reservoir (Hres):

(9)

Downstream valve. At the downstream valve an orifice flow equation is imposed:

(10)

In which cv is the orifice coefficient, Av is the valve opening and the term Hv - zv is the hydraulic head above the valve.

Additional hydraulic conditions. In branching sections, hydraulic head balance and flow rate conservation are imposed between upstream and downstream pipe as follows:

(11)

(12)

Boundary conditions

In the analyzed case study, the boundary conditions are defined by the presence of the reservoir, from which water is drawn, and the valve located just upstream of the hydropower plant. Additionally, the boundary conditions imposed by the ST and the branching junction in the adduction tunnel must also be considered. The position of the boundary conditions within the hydraulic system is shown in Fig. 6.

Fig. 6. Location of boundary conditions within the hydropower plant layout

Upstream reservoir. Considering the water level in the reservoir remain constant during the transient state due to its large volume, the minor head loss at the entrance of the adduction tunnel can be estimated as:

(13)

As shown in equation (13), the entrance loss (∆H) is affected by an entrance loss coefficient (k) and flow velocity (u). The condition imposed by the reservoir boundary can be expressed as:

(14)

In which Hres is the height of the reservoir water surface above the datum.

Branching section. Neglecting the head losses at the junction and the difference in the velocity heads at the branching section, the following equations express the conservation of flow rate and hydraulic head between the last section (n+1) of the upstream pipe (i) and the first section (n+1) of the downstream pipe (i+1):

(15)

(16)

By introducing charateristic equations, the values of flow rate and hydraulic head at future time instants (point P of the calculation mesh shown in Fig. 6) can be calculated by considering the following formulation:

(17)

Downstream valve. The condition imposed by a valve boundary is a relationship between the head and discharge through the valve. Steady-state flow through a valve discharging into air may be written as:

(18)

In which Cv is a coefficient of discharge, H is the head upstream of the valve and Av is the area of the valve opening. By coupling equation (18) with a characteristic line equation, it is possible to obtain a formulation that allows calculation of the flow rate passing through the valve at future instants of the hydraulic transient.

Surge tank water level. A MoC-based model can also be used to evaluate rapid transient conditions in a piping system that includes a ST. The following equation can be written to describe the conservation of flow rate at the ST entry node:

(19)

Neglecting head losses at the entry, the evolution of the level (zst) in the ST over time can be expressed as:

(20)

By coupling equation (20) with a characteristic line equation, it is possible to calculate the level in the tank at future time instants, consequently evaluating the flow rate values.

Results

Simulation results are stored into two matrices, one for flow rate values and the other for hydraulic head values. The rows of these matrices correspond to a specific simulated time instant, while the columns refer to the spatial nodes of the system. However, one of the main limitations of Dynamo is its inability to handle tabular data, as it can only manage lists. As a result, the simulation outputs were written as lists containing the temporal evolution of flow rates and hydraulic head at key points of the infrastructure, such as pipes inlets and outlets, or at specific time instants. The latter approach is useful for storing the results of the steady-state analysis, which are used as initial conditions to start the MoC-based numerical computation. Hydraulic head evolution is reported in Fig. 7:

Fig. 7. Hydraulic head spatial evolution in steady-state conditions

The results of hydraulic transient simulations are stored in lists containing the temporal evolution of flow rate and hydraulic head at key points of the system. Fig. 8 and Fig. 9 illustrate the flow rate at the entry of the adduction tunnel and the level oscillation in the ST, respectively, when a total closure of the downstream valve is performed in 12 seconds.

Fig. 8. Time evolution of the flow rate at the entry of the adduction tunnel

Fig. 9. Time evolution of the water level in the surge tank

Conclusions and future work

The developed application, tested on the real case study of the water distribution network in the province of Benevento, in southern Italy, allows for the calculation of hydraulic quantities when unsteady-state phenomena occur within closed pipelines. The result highlight the potential of using a VPL tool like Dynamo as a hydraulic simulation platform directly connected to a BIM model. This integration ensures that any changes in the model geometry are automatically reflected in the inputs of the programming code used for hydraulic simulations. This tool proves valuable not only in the design phase, when optimizing the infrastructure geometry and sizing its components is crucial, but also during the FM phase. In this context, it is essential to evaluate valve maneuvers to ensure correct flow rates are distributed to utilities and to effectively manage extraordinary situations.

Future steps aim to enhance the programming code used in the simulations by incorporating more accurate estimations of head losses at discontinuity points, particularly at the ST inlet. One potential strategy is to treat the inlet as a junction section. In this case, head losses can be calculated directly in correspondence of the junction or by modelling a fictitious valve near the junction that causes head losses.

Other possible improvements focus on the visualization of results. The most effective solution identified so far is to export the simulated results to tabular formats and then create graphs using Microsoft Excel. To streamline the process, it could be beneficial to develop custom nodes in Dynamo that facilitate the direct diagramming of data, eliminating the need for external software and making the process more efficient.

In addition, the dependency of simulation results on BIM models enables the visualization of both system geometry and hydraulic quantities within a virtual reality (VR) environment. This integration not only enhances the spatial understanding of complex hydraulic systems but also supports intuitive exploration and interaction with data [30]. As a result, VR holds significant potential as a tool for optimizing infrastructure management, and supporting training and operational planning,

References

International Renewable Energy Agency (IRENA) Report, https://www.irena.org/, last accessed 2025/03/25.

Hassan, Q., Algburi, S., Sameen, A. Z., Al-Musawi, T. J, Al-Jiboory, A. K., Salman, H. M., Ali, B. M., Jaszczur, M.: A comprehensive review of international renewable energy growth. Energy Built Environment (2024). https://doi.org/10.1016/j.enbenv.2023.12.002

Ramião, J. P., Carvalho-Santos, C., Pinto, R., Pascoal, C.: Hydropower Contribution to the Renewable Energy Transition Under Climate Change. Water Resources Management 37(1), 175–191 (2023). https://doi.org/10.1007/s11269-022-03361-4

Ugliotti, F. M.: Sostenibilità e digitalizzazione nella produzione idroelettrica. 1st edition, Cangemi editore, Rome (2024).

Bulut, M., Özcan, E.: A new approach to determine maintenance periods of the most critical hydroelectric power plant equipment. Reliability Engineering & System Safety 205, 107238 (2021). https://doi.org/10.1016/j.ress.2020.107238

Rete Elettrica Nazionale S.p.A. (TERNA) Pubblicazioni statistiche, https://www.terna.it/, last accessed 2025/02/25.

Kumar, K., and Saini, R. P.: A review on operation and maintenance of hydropower plants. Sustainable Energy Technologies and Assessments 49, 101704 (2022). https://doi.org/10.1016/j.seta.2021.101704

Kahraman, G.: Investigation of the effect of operating conditions change on water hammer in hydroelectric power plants. Journal of Failure Analysis and Prevention 20, 1987-1991 (2020). https://doi.org/10.1007/s11668-020-01017-2

Ghidaoui, M. S., Zhao, M., McInnis, D. A, Axworthy, D. H.: A review of water hammer theory and practice. Applied Mechanics Review 58(1), 49-76 (2005) https://doi.org/10.1115/1.1828050

Pal, S., Hanmaiahgari, P. R., Karney, B. W.: An overview of the numerical approaches to water hammer modelling: The ongoing quest for practical and accurate numerical approaches. Water 13(11), 1597 (2021). https://doi.org/10.3390/w13111597

Wang, C., Nilsson, H., Yang, J., Petit, O.: 1D–3D coupling for hydraulic system transient simulations. Computer Physics Communications 210, 1-9 (2017). http://dx.doi.org/10.1016/j.cpc.2016.09.007

Afshar, M. H., Rohani, M.: Water hammer simulation by implicit method of characteristic. International Journal of Pressure vessels and piping 85(12), 851-859 (2008). https://doi.org/10.1016/j.ijpvp.2008.08.006

Geng, J., Yuan, X., Li, D., Guang-sheng D.: Simulation of cavitation induced by water hammer. Journal of Hydrodynamics 29(6), 972–978 (2017). https://doi.org/10.1016/S1001-6058(16)60811-9

Barnes, P., Davies, N.: BIM in Principle and in Practice. ICE publishing, London (2014).

Ma, W., Wang, X. and Wang, J., Xiang, X., Sun, J.: Generative design in building information modelling (BIM): approaches and requirements. Sensors 21(6), 5439 (2021). https://doi.org/10.3390/s21165439

Collao, J., Lozano-Galant, F., Lozano-Galant, J. A., Turmo, J.: BIM visual programming tools applications in infrastructure projects: A state-of-the-art review. Applied Sciences 11(18), 8343 (2021). https://doi.org/10.3390/app11188343

Kossakowski, P. G.: Visual programming as modern and effective structural design technology—Analysis of opportunities, challenges, and future developments based on the use of dynamo. Applied Sciences 13(16), 9298 (2023). https://doi.org/10.3390/app13169298

Monteiro, A.: Visual Programming Language for Creating BIM Models with Level of Development 400. In: 4th BIM international conference. São Paulo, Brazil (2016).

Chen, J., Huang, M., Xiang, X., Shao, G., Hu, W.: Research on Parametric Modeling Method for Arch Dam Based on Revit Secondary Development. In: proceedings of the 2024 International Conference on Smart City and Information System, pp. 311-318. Kuala Lumpur, Malaysia (2024). https://doi.org/10.1145/3685088.3685143

Preidel, C., Borrmann, A.: Automated code compliance checking based on a visual language and building information modelling. In: ISARC Proceedings of the international symposium on automation and robotics in construction. Oulu, Finland (2015).

Khan, N., Ali, A. K., Skibniewski, M. J., Lee, D. Y., Park, C.: Excavation safety modeling approach using BIM and VPL. Advances in Civil Engineering 2019(1), 1515808 (2019). https://doi.org/10.1155/2019/1515808

Ghannad, P., Lee, Y., Dimyadi, J., Solihin, W.: Automated BIM data validation integrating open-standard schema with visual pro-gramming language. Advanced Engineering Informatics 40, 14-28 (2019). https://doi.org/10.1016/j.aei.2019.01.006

Khan, N., Ali, A. K., Van-Tien Tran, S., Lee, D., Park, C.: Visual language-aided construction fire safety planning approach in building information modeling. Applied Sciences 10(5), 1704 (2020). https://doi.org/10.3390/app10051704

Kensek, K.: Visual programming for building information modeling: energy and shading analysis case studies. Journal of Green Building 10(4), 28-43 (2015). https://doi.org/10.3992/jgb.10.4.28

Kishor, N., Saini, R. P., Singh, S. P.: A review on hydropower plant models and control. Renewable and Sustainable Energy Reviews 11(5), 776-796 (2007). https://doi.org/10.1016/j.rser.2005.06.003

Autodesk Civil 3D, https://www.autodesk.com/eu/products/civil-3d/, last accessed 2025/02/25.

About Dynamo, https://primer2.dynamobim.org/, last accessed 2025/02/25.

Garg, R., Kumar, A.: Analysis of Hydraulic Transients in a Reservoir-Valve-Pipeline Arrangement by Using Method of Characteristics (MOC). Almora, Uttarakhand, India, Apr. https://www.researchgate.net/publication/324311451_Analysis_of_Hydraulic_Transients_in_a_Reservoir-Valve-Pipeline_Arrangement_by_Using_Method_of_Characteristics_MOC (2018)

Chaudhry, M. H.: Applied hydraulic transients. 3rd edition, Springer, London (2014).

Jurado, J. M., Graciano, A., Ortega, L., Feito, F. R.: Web-based GIS application for real-time interaction of underground infrastructure through virtual reality. In Proceedings of the 25th ACM SIGSPATIAL International Conference on Advances in Geographic Information Systems, pp. 1-4. Redondo Beach, California, USA (2017). https://doi.org/10.1145/3139958.3140004