Tangki NAHRIM, a desktop application developed in 2008, is widely used for the calculation of optimal tank size for rainwater harvesting in Malaysia. Here we present an overview of the updated version, Tangki NAHRIM 2.0 (TN2) which was developed in the R computing environment. In TN2, a rainwater harvesting system is simulated using a daily water balance model with rainfall input from a built-in database by adopting the yield-after-spillage (YAS) convention. Proposed tank sizes are evaluated based on water saving and storage efficiencies. These results are then visualised in charts showing the relationships between tank sizes and both efficiency measures to help users select the optimal tank size based on their criteria of choice. A simulation was conducted based on a typical Malaysian household for domestic non-potable use as a case study. A web-based GUI for TN2 was developed in R Shiny framework for the public. The GUI has the advantage of being accessible online from any device, and will be able to facilitate the adoption of rainwater harvesting systems by the public at large.
Tangki NAHRIM is used for calculating optimal rainwater harvesting tank size in Malaysia.
Tangki NAHRIM 2.0 (TN2) is the upgraded version.
TN2 was developed in the R computing environment and is available as a Shiny web application.
TN2 uses a daily water balance model which adopts the yield-after-spill (YAS) convention.
The proposed tank sizes are evaluated according to water-saving and storage efficiencies.
Rainwater harvesting is a traditional method of water conservation that has seen a revived interest in recent years due to water shortages caused by various factors such as population growth, water pollution, drought, and climate change. Rainwater harvesting systems can reduce demand for treated water by collecting water for non-potable use such as toilet flushing, gardening and general cleaning. As a tropical country with abundant rainfall throughout the year, Malaysia is well-positioned to harness this resource. However, the prohibitive cost of setting up a domestic rainwater harvesting system and the relatively low water tariff have contributed towards its unpopularity with the general public in Malaysia. Despite all these factors, rainwater harvesting has seen an increase in uptake, partly due to intermittent water shortages especially in cities, increase of drought and water pollution incidents, heightened public awareness about conservation of water resources, and enforcement by local governments.
The National Hydraulic Research Institute of Malaysia (NAHRIM), a government research institute for water, has been tasked with research and development in rainwater harvesting in Malaysia to support the government's initiative towards green technology (Shaaban & Huang 2007). The first Tangki NAHRIM desktop application, which was developed by NAHRIM in 2008 using Visual Basic, is still used by many in Malaysia to calculate and analyse optimal rainwater tank size (Hafizi Md Lani et al. 2018). The older application can calculate the reliability (known henceforth as water-saving efficiency) of the proposed tank size, coefficient of rainwater utilization, storage efficiency and other performance measures. Twenty-one years of daily rainfall data from 24 stations in Peninsular Malaysia are provided with the application, with an option for users to upload their own data for analysis. However, the interface is outdated and the application is limited to the Windows desktop environment. Custom rainfall data upload has to adhere to a very specific and uncommon format. Tank size calculation and selection process is tedious and not user-friendly. Moreover, the methodology of the model is opaque with minimal description. Tangki NAHRIM 2.0 (TN2) is based on established rainwater storage tank modelling methods. The simulation model was developed in the R computing environment (R Core Team 2013) alongside a simplified web-based graphical user interface using the R Shiny framework (Chang et al. 2019) for the public. The web application also includes built-in rainfall data from both Peninsular and East Malaysia. Thirty-two million population all over Malaysia stand to benefit from this application, as well as people from all over the world, since custom rainfall data can be used in this application. The objective of this paper is to provide an overview of the methodology used to develop the TN2 rainwater harvesting model and present a case study for the optimization of tank size based on an average household in Malaysia.
Mass balance model is the most commonly used method for simulating tank inflow, storage and outflow for tank storage optimization. A mass balance model typically includes a precipitation inflow model, a behavioural model for water demand, a calculation module, and an evaluation module to analyse the results of calculation (Campisano et al. 2017).
Jenkins et al. (1978) introduced the yield-before-spill (YBS) and yield-after-spill (YAS) models, which assumed, respectively, that rainwater was used before (YBS) and after (YAS) excess rainwater was released. The study evaluated system performance by temporal or volumetric reliability and concluded that a monthly time interval would yield a lower performance for the YAS system than a daily time interval.
Fewkes (1999) tested the validity of the YAS model by conducting field testing of a rainwater collection system and comparing the measurements with results from the model. The comparison leads to the conclusion that the YAS model, using a daily time-step, is able to reliably predict the performance of the rainwater collection system. Fewkes & Butler (2000), building upon the earlier study, conclude that the accuracy of the model can be improved by simulating for different time intervals depending on the storage fraction (storage/inflow). Mitchell (2007) applied similar methodology and came to a similar conclusion; that is, the YAS operating rule is preferable due to its conservative estimate, while the ratio of average demand volume divided by storage capacity can be used to assess the long-term yield estimate of a simulation. Following up on the previous study, Mitchell et al. (2008) conducted a sensitivity analysis for the storage behaviour model for urban stormwater and determined that length of rainfall record, inter-annual variability of seasonal demand, and storage surface type are the most sensitive parameters.
The TN2 simulation model was written in R version 3.6.1 (R Core Team 2013). R is an open source language for statistical computing that is popular among the scientific community. For public use, a graphical user interface was developed in R Shiny (Chang et al. 2019) platform. The R script is available as Supplementary Material in this paper.
The legacy Tangki NAHRIM software was based on a simple daily water balance model. For TN2, a similar methodology is adopted but is elaborated in detail in this paper. The model inputs are as follows: rainfall data, harvestable roof area, roof runoff coefficient, first flush depth, water demand, and proposed tank capacity. These inputs are described in detail in the following sections.
For rainfall input, daily time resolution was selected for simulation as it is sufficient for the calculation of tank size and easy to obtain without sacrificing the accuracy of the analysis (Fewkes 1999; Liaw & Tsai 2004; Mitchell 2007; Campisano & Modica 2015). For the Shiny web application, a daily rainfall database for rainfall stations all over Malaysia was built. To select rainfall stations and data for the database, an arbitrary criterion was set whereby the selected stations must have complete records (365 or 366 records for leap years per year) for a minimum of 10 years, regardless of the continuity. Years with incomplete data were excluded so that bias due to seasonal effects would not influence the dataset. Thus, rainfall data from different stations used in tank size calculation may differ in terms of data length. Rainfall data was acquired from the Drainage and Irrigation Department Malaysia (DID) for the whole of Malaysia. The daily data from DID's autologger starts from 1970 up to 2017, except for 8 stations in Sarawak which started before 1970, with the earliest data starting from 1952. A total of 694 stations were selected, which encompassed Peninsular Malaysia, Sabah and Sarawak. Figure 1 shows the distribution of the selected stations in Malaysia.
Water balance model
The major performance measure of rainwater harvesting system is water-saving efficiency (Jenkins et al. 1978; Dixon et al. 1999; Mitchell et al. 2008). Water-saving efficiency is defined as the amount of water demand fulfilled by the system compared to the total demand. This is categorized as volumetric efficiency measure, which is determined by the amount or volume of water. Water-saving efficiency can also be compared temporally (McMahon et al. 2006). Time-based water-saving efficiency compares the amount of time steps over which the demand is fulfilled compared to the total amount of time steps for the duration the system is (simulated to be) in use. In this study, we also calculated the amount of days yield fulfilled demand.
To assess tank sizes, Imteaz et al. (2011) assumed an optimization criterion whereby the cumulative water savings approaches a constant value. This means that there is no significant water savings for further increase of tank size due to other constraining factors such as rain volume, roof area and water demand. However, water demand can be increased for other usages if the water-saving efficiency is reasonably high.
The proposed tank size was assumed to be efficient as the storage efficiency approaches unity or overflow loss approaches zero (Imteaz et al. 2011). The storage efficiency can also be described as the percentage of roof runoff which can be utilised and will not be lost to spillage. A low storage efficiency indicates high spillage volume. In this case, the tank size or the water demand can be increased.
In order to test and demonstrate the performance of the model, a selected number of simulations were run in R using the ‘tidyverse’ package (Wickham 2017). As the original Tangki NAHRIM software was developed for the public, we decided to use a typical household in Malaysia as our case study to determine the optimum tank size for a domestic residence. Running the tank storage simulation model requires rainfall data, harvestable roof area, roof runoff coefficient, first flush depth, water demand, and proposed tank capacity as input. Generally, rainfall data is site-specific, while roof area and roof material (runoff coefficient) would be fixed for a residence. Only the water demand and tank size can be adjusted to a certain extent. Therefore, in this case study, the simulation model is run for a range of tank sizes to investigate the relationship with the performance measures.
This case study also assumes a single set of rainfall data, which is representative of the Klang Valley region, which is the most densely populated region in Malaysia. The DID's UiTM Shah Alam station (station ID: 3014091) was selected for its complete and continuous 15 years rainfall data. The station is located within the Klang Valley region in the midwest of Peninsula Malaysia, which, as with the rest of Malaysia, experiences tropical climate. Figure 3 shows the annual rainfall variability, with a long-term annual average of 2,378 mm. The monthly variation is shown in Figure 4 with peak rainfall in the month of November due to North-East Monsoon, and a minor peak in April during the inter-monsoon period. Figure 5 and Figure 6 show the total number of rain and no-rain days for the station. Rain days constitute slightly less than half of the total days for each respective month (except November) and year. This trend shows the potential for rainwater harvesting in Malaysia.
To be representative of an average household in Malaysia, we used the roof size of a typical terrace house, which is 100 m2 (Shaaban & Huang 2007; Hashim et al. 2013). A first flush value of 1 mm was used based on the suggestion by Doyle & Shanahan (2010). For runoff coefficient, comparison made for different roof types by Liaw & Tsai (2004) suggested that all types of roofs have similar coefficients, from which they suggested an average value of 0.82. For this case study, we adopted the rounded value of 0.8 as the runoff coefficient.
The water demand considered in this case study is assumed to be for non-potable use, as it requires minimal treatment to be reused. Assuming about 5 toilet flushes/day/capita (rounded value from Campisano & Modica 2014) and 7 litres per flush, with an average household size of 4 (rounded value from Department of Statistics Malaysia 2014), the total rainwater demand would be 140 litres/day. In addition to toilet flushing, general cleaning and garden irrigation could increase the water demand up to 200 litres per day. The simulation was performed for tank sizes ranging from 1 to 10 m3 and water demand of 200 litres per day, which is the estimated average demand for a typical household. The water demand was assumed to be constant every day including weekends. The tank size range was assumed as such despite the fact that in practice, tank sizes of more than 1 m3 in an average household would be challenging to place and aesthetically undesirable. However, as a theoretical demonstration, we assumed no limitation of space in the hypothetical average household.
RESULTS AND DISCUSSION
The simulation for 200 litres per day of water demand produced the graph in Figure 7, which shows the relationship between water-saving and storage efficiencies versus a range of tank storage capacities. Increasing tank capacity increases both efficiency measures up to a point, beyond which the increase offers diminishing returns whereby the volume of water saved (water-saving efficiency) and runoff utilised (storage efficiency) increase marginally.
The water-saving efficiency curve shows that for a tank sized 3 m3 and above, more than 90% of total water demand can be fulfilled by harvested rainwater. However, increment of tank size by 1 m3 beyond 3 m3 will save less than 10% of water from the total water demand for each increment. Therefore, we assume that 3 m3 rainwater harvesting tank storage is the most optimal size for a typical household in Malaysia, specifically in the Klang Valley region. However, a 3 m3 tank is huge for a densely populated area like Klang Valley with its limited space. If the user chooses a more practical size, say, 1 m3, the rainwater harvesting system could still provide the household with 71.8% of the water demand (equivalent to an average of 143.6 litres per day).
On the other hand, storage efficiency is quite low in general, with values ranging between 29.8% to 41.4%. For the most part, storage efficiency follows the curve of diminishing returns as the tank size increases, which is similar to water-saving efficiency. As rainfall volume is fairly high, the low water demand increases spillage and thus contributes towards the low storage efficiency for the range of tank sizes. Even with the maximum proposed tank size of 10 m3, not more than half of roof runoff was utilized by the user. To increase the storage efficiency, water demand has to be increased to fully utilize the abundant rainfall volume. Figure 8 shows that for every tank size, the volume of spillage far exceeds the yield. Nevertheless, spillage volume decreases as tank size increases. Storage efficiency is a function of spillage and roof runoff volume, where decreasing spillage volume increases storage efficiency. Meanwhile, yield volume increases with tank size up to a point, beyond which yield volume shows no significant increase, which is consistent with the trend of water-saving efficiency. A higher water demand would reduce the spillage and increase the yield volume.
In terms of temporal reliability, the number of days spillage occurred and the number of days rainwater yield fulfilled demand were calculated and averaged by year. The results are shown in Figure 9. The bar chart shows that the number of days yield fulfilled demand increases with tank size, ranging from 252 days to 361 days per year, which is about 70% to 99% of days in a year. The curve of the increase is similar to that of water-saving efficiency. Meanwhile, the average number of days spillage occurred per year shows minimal decrease as tank size increases, ranging from 83 days to 68 days, which is about 23% to 19% of days in a year. This stands in stark contrast with the volume of spillage shown in Figure 8, where the volume of spillage is considerably higher than yield. This implies that huge volume of spillage occurred in a short amount of time. This is in line with rainfall pattern in the western part of Peninsular Malaysia, which is influenced by the intermonsoon seasons and characterized by high intensity convective storms (Bakar et al. 2020).
To visualise the percentage time the tank is at a certain volume for each proposed tank size, we divided the tank volume into 5 classes. The classes start from ‘Empty’ and increase by a quarter of tank volume to full (100%). We then calculate the number of days and percentage of time the tank volume is at each class for each tank capacity. The results are shown in Figure 10. On the whole, as tank size increases, the percentage time tank volume is at less than half full or empty decreases, while percentage time tank volume is almost full (75% to 100%) increases. A larger tank size would be able to capture more rainwater and store it for a longer time period than a smaller tank size, which would overflow should a large volume of rainwater enter the system, and for which storage would be depleted quickly owing to the water demand.
TN2 simulation model enables users to calculate the efficiency of a range of tank sizes based on several site-specific parameters and user inputs, and subsequently determine the optimal tank size. Both the web application for the public and R script for R users are able to streamline the calculation workflow and improve on user experience and the accuracy of the analysis compared to the old version. The simulation model had been run successfully for a typical household in Malaysia for a range of tank capacities. The results show that as tank size increases, the water-saving efficiency also increases up to a point after which the increase of tank size will not increase water-saving efficiency significantly. The storage efficiency also follows a similar trend, but is much lower in magnitude due to high rainfall volume and limited water demand. Users can thus compare the benefits of each tank size and select the most optimal tank size based on the water-saving and storage efficiencies. On the whole, users can decide to prioritise whichever measure they are concerned with depending on their requirements for the rainwater harvesting system.
Water savings and, consequently, cost savings are probably the most important criteria for most users from the general public, as storage efficiency has no impact on financial savings. However, as the water tariff is low and the capital cost for setting up a rainwater harvesting system is on the high side in Malaysia, users should not expect a quick return on investment for the system. Instead, a rainwater harvesting system can be used as protection against water shortages, be it from drought or pollution, which is prone to happen in the Klang Valley in recent years.
The low storage efficiency in the case study, indicating high spillage volume for an average non-potable water demand rainwater harvesting system, even for a relatively small roof area, suggests an enormous potential for rainwater harvesting in Malaysia. Although the case study is for domestic residence, TN2 can also be applied for large-scale institutional, commercial or industrial settings.
Future research should also study the relationship between water demand, rainfall volume, tank size and the water-saving and storage efficiencies. In particular, storage efficiency is useful for determining the amount of rainfall that will be converted into surface and stormwater runoff. Analysis of the storage efficiency curve can help achieve one of the objectives of a rainwater harvesting system, which is stormwater attenuation. However, this objective is often overlooked as the general public is more concerned with cost savings. As climate change looms and extreme weather events increase in frequency, we have to look into solutions not just in terms of finance but also disaster risk reduction.
The water balance model could be verified with field measurements from a rainwater harvesting system. The accuracy of the water balance model can be improved by using rainfall data and water demand data with higher temporal resolution. Water demand data is likely to vary by days of the week. In higher resolution, water demand data will reveal the temporal usage pattern. The built-in rainfall database will be updated from time to time for the web application. With the countrywide rainfall data, we could optimize rainwater harvesting by investigating the rainfall pattern. To assess the impact of climate change on rainwater harvesting system performance, we could utilise rainfall data from Global Climate Models. In order to meet the needs of the layperson or general public, the simulation model could include a cost-benefit analysis component that can determine the maximum return of investment, which is the main reason for the general public's adoption of the rainwater harvesting system. Overall, the rainwater harvesting system is beneficial towards both economic and environmental betterment and the TN2 simulation model is able to support and contribute towards both objectives.
We acknowledge Datuk Haji Ir Ahmad Jamaluddin Shaaban for conceptualizing and developing the original Tangki NAHRIM application. Thanks are due to Ir Mohd Zaki Mat Amin for securing the funding for this programme. We are grateful to the Drainage and Irrigation Department Malaysia (DID), particularly Ir. Hajah Bibi Zarina Che Omar, Director of the Water Resources & Hydrology Division, for supplying the rainfall data for the whole of Malaysia.
This work was supported by Programme 2: Extension Study on the Impact of Climate Change on Malaysia's Water Resources (Phase 2) (Kajian Lanjutan Impak Perubahan Iklim ke Atas Sumber Air Negara (Fasa 2)) of Government Development Expenditure for the Eleventh Malaysia Plan by the Malaysian government.
We confirm that the funder had no role in study design; in the collection, analysis and interpretation of data; in the writing of the manuscript; and in the decision to submit the manuscript for publication.
CONFLICT OF INTEREST
The authors declare no conflict of interest.
DATA AVAILABILITY STATEMENT
All relevant data are available from an online repository or repositories. The rainfall dataset used in this study is available from Water Resources & Hydrology Division, Drainage and Irrigation Department Malaysia (DID). The source code for Tangki NAHRIM 2.0 application is available at Github repository: https://github.com/ycgoh-nahrim/TangkiNAHRIM2.0 (licensed under GPL-3) The online application can be accessed at Shinyapps.io web server: https://waterresources-nahrim.shinyapps.io/Tangki_NAHRIM/.