Error running UWG caused by weather file




I am running a model based on the Urban_Weather_Generator_Workflow template. I noticed when I changed the weather to Singapore (from I could not do the analysis period for the whole year. When Run UWG was set to true I would get “1. Solution exception:math domain error”.

After a few tests with the range of the analysis period I was able to observe the problem is particularly on the day correspondent to August 22. If my ranges are before that or after that, the simulation runs normally. However, I don’t believe only the weather data is the problem, as I have used this file before and it even runs for the full year on the other dragonfly templates.

Can someone assist me on why this happens and how I would be able to fix it?

Thank you for the support!


Please provide your GH file if you can


Hi devang,

Here is the file. I could not upload the file directly here before as I was a new user. (1.0 MB)

Thank you!

Update: tested another weather file ( and a different day was causing the error. This time, I could not run simulations that included February 1st.


Looking into the weather files I tested, it seems that the error is caused when there is a high wind speed (above 20km/h).
I observed this in the two days that were causing errors in my weather files and after editing them to lower values, the simulation is now running perfectly for the whole year.

I still am not sure why does the error happen when wind speeds are high, probably something internally on the UWG calculations. Also, I am not sure why the other templates are able to run with high wind speeds without causing any error.

Anyways, I was able to edit the weather file and continue with my simulations.
Thank you for the ones involved in releasing this new version of dragonfly!



I took a quick look at your file, and the bug is occurring because the numerical method used to calculate the heat balance in UWG, is becoming unstable and throwing out a huge negative number for the heat flux from the roof surface. I believe this is can be traced back to a known error that was encountered frequently with an older version of UWG.

Likely the way the higher wind speeds is contributing to this problem is by generating higher surface convection coefficients. Which may be pushing the conduction through the roof too high – in conjunction with high diffuse/direct radiation in August, and the construction assembly of roof layer in building energy model.

I’ll have to take a deeper look to see isolate the issue, but for now your solution of hacking the wind speed is a good one.



Many thanks for clarifying this issue!