New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenFoam resulting .csv file details #14

Closed
stgeorges opened this Issue Jun 9, 2016 · 11 comments

Comments

Projects
None yet
4 participants
@stgeorges

stgeorges commented Jun 9, 2016

Hi @TheodoreGalanos , @chriswmackey

I took a look a the .csv OpenFoam result file which Chris attached on the grasshopper forum:

What does the WindFactor(10) column in the .csv file represent?
And for what direction was the cfd simulation in openfoam been conducted?

Thank you for the reply.

@chriswmackey

This comment has been minimized.

Show comment
Hide comment
@chriswmackey

chriswmackey Jun 10, 2016

Member

@stgeorges
I apologize for such a late reply as I know that you asked the same thing here:
#12 (comment)

The explanation is fairly complex and I had wanted to update all of the GH files that we are using so that you could get a clear sense of the workflow that @TheodoreGalanos and I are using (the files before were a bit hacky and incomplete such that they would have created more confusion than clarity).

To answer your first question, Wind Factors (as Theodore has defined it to me) are the relationship between the wind speeds at the points in the CFD simulation and the recorded meteorological wind speed at 10 meters above the ground. In other words, multiplying the wind factor for a given point by the meteorological wind speed at a given hour gives you the CFD wind speed for the point. Working with wind factors is particularly useful for helping extrapolate the results of CFD simulations to an entire year since, any hour when you have the wind blowing in the direction of the CFD simulation you can multiply the wind factors by the EPW wind speed for the hour and get an estimate of wind speeds on the ground. Of course, this method relies on the assumption that winds blowing in a similar direction at different speeds will still exhibit a similar pattern of wind speed distribution (and only the intensity of the wind speed in this pattern changes). Since this assumption can potentially introduce a lot of error, Theodore tried to mitigate this by running CFD simulations using the average wind speeds for each cardinal direction in the EPW file. The hope is that, even if there is some error for a given hour of the year that does not have a similar wind speed to the CFD simulation, over the whole year, the results should be in the correct range.

The quick answer to the second question is that the direction of the wind in the file that I posted is 10 degrees from North (hence WindFactor(10)) but the more meaningful answer is more complex. Theodore spent a solid 3 months running 36 CFD simulations for all wind directions (at 10-degree increments), which took a huge amount of time and computer power. In order to use these results to evaluate outdoor thermal comfort, we are using the wind factor method I described above and we are using one of the 36 CFD simulations to approximate wind speeds across an urban space for each hour of the EPW. 36 wind directions would be too large of an example for me to share here so I am including an example that uses just 6 of Theodore's CFD simulations below (at the following degrees from North: 0, 60, 120, 180, 240, 300)

The whole workflow has been split up into 3 separate GH files for ease of use/explanation:

  1. MapCFD2MicroclimateMapPts - Take CFD results and produce a single CSV with windFactors for each point in the viewFactorMesh that is used in the comfort maps. This is what this GH file does:
    https://www.dropbox.com/s/yfsb60uc3nd0s21/1_MapCFD2ClimatePts.gh?dl=0
    Essentially, we go through each one of the CFD result files in this .zip folder:
    https://www.dropbox.com/s/12u7jz82j1rtvg8/6DirectWindSpeeds.zip?dl=0
    And we write the relevant wind factors from each result file into each column of a CSV file like so:
    https://www.dropbox.com/s/fivaxgx5f9vnqtd/WindFacFile.csv?dl=0

  2. WindFactors2WindSpeeds - Using the wind factor csv above and the EPW file for the climate, we produce a single CSV that contains wind speeds for each point at each hour of the year. This is what this GH file does:
    https://www.dropbox.com/s/f2esb5a6wq5feu3/2_WindFactors2WindSpeeds.gh?dl=0
    And this is an example of the (very large) CSV file that is produced:
    https://www.dropbox.com/s/h7wkhmdkwpbgsaq/PtWindSpeeds.csv?dl=0

  3. MicroclimateMap - The file path to the CSV file produced in the previous step can be plugged into the windSpeed_ input of the climate map recipes in order to use these wind speeds in the microclimate map analysis. This is what you see happening in this file:
    https://www.dropbox.com/s/54psxisngxo6m34/3_MicroclimateMap.gh?dl=0
    ... and in this image:
    pet_example

You will also see in that last step that we are using your PET functions for the mircrolimate maps. They are really the only comfort model that can describe this situation so, again, I thank you greatly for adding them!

Let me know if you have any other questions/suggestions on the workflow.

-Chris

Member

chriswmackey commented Jun 10, 2016

@stgeorges
I apologize for such a late reply as I know that you asked the same thing here:
#12 (comment)

The explanation is fairly complex and I had wanted to update all of the GH files that we are using so that you could get a clear sense of the workflow that @TheodoreGalanos and I are using (the files before were a bit hacky and incomplete such that they would have created more confusion than clarity).

To answer your first question, Wind Factors (as Theodore has defined it to me) are the relationship between the wind speeds at the points in the CFD simulation and the recorded meteorological wind speed at 10 meters above the ground. In other words, multiplying the wind factor for a given point by the meteorological wind speed at a given hour gives you the CFD wind speed for the point. Working with wind factors is particularly useful for helping extrapolate the results of CFD simulations to an entire year since, any hour when you have the wind blowing in the direction of the CFD simulation you can multiply the wind factors by the EPW wind speed for the hour and get an estimate of wind speeds on the ground. Of course, this method relies on the assumption that winds blowing in a similar direction at different speeds will still exhibit a similar pattern of wind speed distribution (and only the intensity of the wind speed in this pattern changes). Since this assumption can potentially introduce a lot of error, Theodore tried to mitigate this by running CFD simulations using the average wind speeds for each cardinal direction in the EPW file. The hope is that, even if there is some error for a given hour of the year that does not have a similar wind speed to the CFD simulation, over the whole year, the results should be in the correct range.

The quick answer to the second question is that the direction of the wind in the file that I posted is 10 degrees from North (hence WindFactor(10)) but the more meaningful answer is more complex. Theodore spent a solid 3 months running 36 CFD simulations for all wind directions (at 10-degree increments), which took a huge amount of time and computer power. In order to use these results to evaluate outdoor thermal comfort, we are using the wind factor method I described above and we are using one of the 36 CFD simulations to approximate wind speeds across an urban space for each hour of the EPW. 36 wind directions would be too large of an example for me to share here so I am including an example that uses just 6 of Theodore's CFD simulations below (at the following degrees from North: 0, 60, 120, 180, 240, 300)

The whole workflow has been split up into 3 separate GH files for ease of use/explanation:

  1. MapCFD2MicroclimateMapPts - Take CFD results and produce a single CSV with windFactors for each point in the viewFactorMesh that is used in the comfort maps. This is what this GH file does:
    https://www.dropbox.com/s/yfsb60uc3nd0s21/1_MapCFD2ClimatePts.gh?dl=0
    Essentially, we go through each one of the CFD result files in this .zip folder:
    https://www.dropbox.com/s/12u7jz82j1rtvg8/6DirectWindSpeeds.zip?dl=0
    And we write the relevant wind factors from each result file into each column of a CSV file like so:
    https://www.dropbox.com/s/fivaxgx5f9vnqtd/WindFacFile.csv?dl=0

  2. WindFactors2WindSpeeds - Using the wind factor csv above and the EPW file for the climate, we produce a single CSV that contains wind speeds for each point at each hour of the year. This is what this GH file does:
    https://www.dropbox.com/s/f2esb5a6wq5feu3/2_WindFactors2WindSpeeds.gh?dl=0
    And this is an example of the (very large) CSV file that is produced:
    https://www.dropbox.com/s/h7wkhmdkwpbgsaq/PtWindSpeeds.csv?dl=0

  3. MicroclimateMap - The file path to the CSV file produced in the previous step can be plugged into the windSpeed_ input of the climate map recipes in order to use these wind speeds in the microclimate map analysis. This is what you see happening in this file:
    https://www.dropbox.com/s/54psxisngxo6m34/3_MicroclimateMap.gh?dl=0
    ... and in this image:
    pet_example

You will also see in that last step that we are using your PET functions for the mircrolimate maps. They are really the only comfort model that can describe this situation so, again, I thank you greatly for adding them!

Let me know if you have any other questions/suggestions on the workflow.

-Chris

@TheodoreGalanos

This comment has been minimized.

Show comment
Hide comment
@TheodoreGalanos

TheodoreGalanos Jun 10, 2016

Collaborator

Hi @stgeorges

I am terribly sorry for coming back this late. Need to find a better way to stay up to date with github since checking in often doesn't seem to work.

Chris pretty much covered everything perfectly in his answer so I'm not so sure what I can add, apart from the apology.

The case study we have been using is a quite complicated one, as Chris mentioned, with the wind comfort study being done every 10 dg intervals. So, as Chris said, the wind factor(10) would be the wind factor for the 10 dg direction, which in reality ranges from 5 to 15 degrees on the compass.

Wind factors are a good way of going from instantaneous speeds (which is what an outdoor wind CFD assessment provides) to yearly values and that's why we use it. Chris built a few awesome components that do this work fast and efficient and actually make this practical.

Unfortunately, the CFD study is not as optimized as I'd like. For example, the geometry is rotated for every simulation, in order to keep the Inlet/Outlet on the y vertical direction. That means, and you can probably see that in the MapCFD2MicroclimateMapPts file, that we need to rotate the points each time to fit them to the stationary Geometry in Rhino. In future descriptions of this process, this will be optimized, probably by creating a circular mesh which allows to specify the inlet/outlet by radians on the vertical boundary of the mesh.

Also, hopefully, such issues can be rectified in the future if the whole pre and post-process is done through GH and Butterfly. Maybe the program is smart enough to rotate automatically and save instances of the geometry to which it maps the points later for example. I'm not really sure about this.

As for PET, I'd also like to thank you for your contribution. I haven't actually had the chance to test it, will give it a try as soon as I can. But it does allow us to implement a thermal comfort model that is sensitive to specific heights of wind velocities. For example in the same study, the areas of the roof of the left building and the garden area in the middle level of the right building were also assessed. PET will make, I would guess, this assessment much more accurate.

Wow, I said a lot considering I didn't have much to contribute. I'll call it a day then :)
Glad you are interested in this and hope more people join in fast!

Kind regards,
Theodore.

Collaborator

TheodoreGalanos commented Jun 10, 2016

Hi @stgeorges

I am terribly sorry for coming back this late. Need to find a better way to stay up to date with github since checking in often doesn't seem to work.

Chris pretty much covered everything perfectly in his answer so I'm not so sure what I can add, apart from the apology.

The case study we have been using is a quite complicated one, as Chris mentioned, with the wind comfort study being done every 10 dg intervals. So, as Chris said, the wind factor(10) would be the wind factor for the 10 dg direction, which in reality ranges from 5 to 15 degrees on the compass.

Wind factors are a good way of going from instantaneous speeds (which is what an outdoor wind CFD assessment provides) to yearly values and that's why we use it. Chris built a few awesome components that do this work fast and efficient and actually make this practical.

Unfortunately, the CFD study is not as optimized as I'd like. For example, the geometry is rotated for every simulation, in order to keep the Inlet/Outlet on the y vertical direction. That means, and you can probably see that in the MapCFD2MicroclimateMapPts file, that we need to rotate the points each time to fit them to the stationary Geometry in Rhino. In future descriptions of this process, this will be optimized, probably by creating a circular mesh which allows to specify the inlet/outlet by radians on the vertical boundary of the mesh.

Also, hopefully, such issues can be rectified in the future if the whole pre and post-process is done through GH and Butterfly. Maybe the program is smart enough to rotate automatically and save instances of the geometry to which it maps the points later for example. I'm not really sure about this.

As for PET, I'd also like to thank you for your contribution. I haven't actually had the chance to test it, will give it a try as soon as I can. But it does allow us to implement a thermal comfort model that is sensitive to specific heights of wind velocities. For example in the same study, the areas of the roof of the left building and the garden area in the middle level of the right building were also assessed. PET will make, I would guess, this assessment much more accurate.

Wow, I said a lot considering I didn't have much to contribute. I'll call it a day then :)
Glad you are interested in this and hope more people join in fast!

Kind regards,
Theodore.

@mostaphaRoudsari

This comment has been minimized.

Show comment
Hide comment
@mostaphaRoudsari

mostaphaRoudsari Jun 19, 2016

Member

@stgeorges should we close this issue?

Member

mostaphaRoudsari commented Jun 19, 2016

@stgeorges should we close this issue?

@stgeorges

This comment has been minimized.

Show comment
Hide comment
@stgeorges

stgeorges Jun 21, 2016

@chriswmackey , @TheodoreGalanos , @mostaphaRoudsari
I apologize for taking me some 11 days to reply.

Chris and Theodore thank you for the informative replies. They helped me understand better what the current Butterfly components do.
On windFactors, it seems to be a difference in terminology, that caused the confusion from my side.

I did a few cfd simulations for urban environments myself, with support from Liam Harrington, and I would like to share some of the thoughts based on upper replies:

  • The very minimum of wind directions for which the cfd simulation is performed is 8.
    A lot of companies will perform the simulation with at least 16 directions.
  • The height of the analysis plane in cfd application (OpenFoam in this case) should not be set to 1.75m, but rather to 1.1meters for the thermal comfort analysis.
    1.75m or 1.5m meters is the height used in case the cfd simulation results are used for the purpose of the pedestrian mechanical wind comfort analysis.
    I attached here a new Ladybug component with an example file which would analyse the pedestrian wind comfort. It is using the windFactors .csv file that Chris attached in his upper reply.

Again thank you for the detailed answers, and again please accept my apologies for such a late reply.

stgeorges commented Jun 21, 2016

@chriswmackey , @TheodoreGalanos , @mostaphaRoudsari
I apologize for taking me some 11 days to reply.

Chris and Theodore thank you for the informative replies. They helped me understand better what the current Butterfly components do.
On windFactors, it seems to be a difference in terminology, that caused the confusion from my side.

I did a few cfd simulations for urban environments myself, with support from Liam Harrington, and I would like to share some of the thoughts based on upper replies:

  • The very minimum of wind directions for which the cfd simulation is performed is 8.
    A lot of companies will perform the simulation with at least 16 directions.
  • The height of the analysis plane in cfd application (OpenFoam in this case) should not be set to 1.75m, but rather to 1.1meters for the thermal comfort analysis.
    1.75m or 1.5m meters is the height used in case the cfd simulation results are used for the purpose of the pedestrian mechanical wind comfort analysis.
    I attached here a new Ladybug component with an example file which would analyse the pedestrian wind comfort. It is using the windFactors .csv file that Chris attached in his upper reply.

Again thank you for the detailed answers, and again please accept my apologies for such a late reply.

@mostaphaRoudsari

This comment has been minimized.

Show comment
Hide comment
@mostaphaRoudsari

mostaphaRoudsari Jun 26, 2016

Member

Thank you @stgeorges! I'm closing this as it seems your initial question has been answered.

Member

mostaphaRoudsari commented Jun 26, 2016

Thank you @stgeorges! I'm closing this as it seems your initial question has been answered.

@chriswmackey

This comment has been minimized.

Show comment
Hide comment
@chriswmackey

chriswmackey Jun 26, 2016

Member

@stgeorges ,

I also apologize for a late reply.

Thanks, as always, for all of the insight and knowledge. The height above the ground values make a lot of sense to me. Particularly if we are using a log wind profile, 1.1m is just about the closest distance that we can get to the ground before the meteorological wind speed drops to 0 (since the roughness length of urban areas is 1 m).

I was wondering if there is a source for the 8-16 standard number of cardinal directions. This minimum number is something that @TheodoreGalanos and I have been trying to understand and any previous literature would be very helpful. My guess is that this minimum number of simulations might be different depending on whether we are trying to assess safety, mechanical comfort, or thermal comfort since some of these metrics seem to require a finer level of resolution than others.

@mostaphaRoudsari , once I get @stgeorges 's response, I promise that I'll close out the issue.

-Chris

Member

chriswmackey commented Jun 26, 2016

@stgeorges ,

I also apologize for a late reply.

Thanks, as always, for all of the insight and knowledge. The height above the ground values make a lot of sense to me. Particularly if we are using a log wind profile, 1.1m is just about the closest distance that we can get to the ground before the meteorological wind speed drops to 0 (since the roughness length of urban areas is 1 m).

I was wondering if there is a source for the 8-16 standard number of cardinal directions. This minimum number is something that @TheodoreGalanos and I have been trying to understand and any previous literature would be very helpful. My guess is that this minimum number of simulations might be different depending on whether we are trying to assess safety, mechanical comfort, or thermal comfort since some of these metrics seem to require a finer level of resolution than others.

@mostaphaRoudsari , once I get @stgeorges 's response, I promise that I'll close out the issue.

-Chris

@chriswmackey chriswmackey reopened this Jun 26, 2016

@stgeorges

This comment has been minimized.

Show comment
Hide comment
@stgeorges

stgeorges Jun 28, 2016

Hi @chriswmackey ,

I am not aware of the exact literature which mentions 8 being the bare minimum.
8 cfd wind directions would resemble the 8 wind directions : N, NE, E, SE, S, SW, W, NW, where at least diagonal wind directions (NE,SE,SW,NW) would be used to to alleviate the lack of all 36 directions.
Based on experience of upper mentioned Dr. Harrington, minimal 8 wind directions are not enough, and 16 should be performed instead.

There are a number of papers which mention the usage of 16 wind directions regardless of the purpose of the cfd simulation (air pollution, pedestrian wind speeds, wind turbines, air ventilation). These are just a couple of those I found with quick google:

"The Guidelines recommend the use of a numerical model for each of the 16 wind directions to evaluate the design wind speed for wind turbines."
New Evaluation Technique for WTG Design Wind Speed Using a CFD-Model-Based Unsteady Flow Simulation with Wind Direction Changes

"For pedestrian-level wind studies, simulations need to be performed for many (e.g. 12 or 16) wind directions"
Environmental Wind Engineering and Design of Wind Energy Structures

"The solution proposed (Santiago et al., 2013) is to run only a set of scenarios (corresponding to 16 wind directions) using steady CFD-RANS simulations."
Modelling NO2 concentration using cfd-rans model with high resolution traffic emissions

etc.

stgeorges commented Jun 28, 2016

Hi @chriswmackey ,

I am not aware of the exact literature which mentions 8 being the bare minimum.
8 cfd wind directions would resemble the 8 wind directions : N, NE, E, SE, S, SW, W, NW, where at least diagonal wind directions (NE,SE,SW,NW) would be used to to alleviate the lack of all 36 directions.
Based on experience of upper mentioned Dr. Harrington, minimal 8 wind directions are not enough, and 16 should be performed instead.

There are a number of papers which mention the usage of 16 wind directions regardless of the purpose of the cfd simulation (air pollution, pedestrian wind speeds, wind turbines, air ventilation). These are just a couple of those I found with quick google:

"The Guidelines recommend the use of a numerical model for each of the 16 wind directions to evaluate the design wind speed for wind turbines."
New Evaluation Technique for WTG Design Wind Speed Using a CFD-Model-Based Unsteady Flow Simulation with Wind Direction Changes

"For pedestrian-level wind studies, simulations need to be performed for many (e.g. 12 or 16) wind directions"
Environmental Wind Engineering and Design of Wind Energy Structures

"The solution proposed (Santiago et al., 2013) is to run only a set of scenarios (corresponding to 16 wind directions) using steady CFD-RANS simulations."
Modelling NO2 concentration using cfd-rans model with high resolution traffic emissions

etc.

@chriswmackey

This comment has been minimized.

Show comment
Hide comment
@chriswmackey

chriswmackey Jun 29, 2016

Member

Thanks for the info, @stgeorges !
It seems that 16 has been the current upper limit because of computational power and people's time rather than a consensus. So it sounds like there is merit in assessing whether there are significant differences between 36 and 16 directions. I'll let you know what I find from @TheodoreGalanos 's data.
-Chris

Member

chriswmackey commented Jun 29, 2016

Thanks for the info, @stgeorges !
It seems that 16 has been the current upper limit because of computational power and people's time rather than a consensus. So it sounds like there is merit in assessing whether there are significant differences between 36 and 16 directions. I'll let you know what I find from @TheodoreGalanos 's data.
-Chris

@stgeorges

This comment has been minimized.

Show comment
Hide comment
@stgeorges

stgeorges Jun 30, 2016

I can not comment on 16 to 36 difference.
It can be that different cfd applications also have different level of optimization, which may affect the waiting time. Mechanical design software as SolidWorks, NX may be one of the better optimized cfd solvers. I didn't try Ansys. Further info on this requires a person who actually performed simulations in mentioned commercial applications and OpenFoam.

My upper replies where related with the cfd simulation minimal number of wind directions.

stgeorges commented Jun 30, 2016

I can not comment on 16 to 36 difference.
It can be that different cfd applications also have different level of optimization, which may affect the waiting time. Mechanical design software as SolidWorks, NX may be one of the better optimized cfd solvers. I didn't try Ansys. Further info on this requires a person who actually performed simulations in mentioned commercial applications and OpenFoam.

My upper replies where related with the cfd simulation minimal number of wind directions.

@mostaphaRoudsari

This comment has been minimized.

Show comment
Hide comment
@mostaphaRoudsari

mostaphaRoudsari Aug 17, 2016

Member

Is this discussion still about OpenFoam resulting .csv file details? Should we rename/close this issue?

Member

mostaphaRoudsari commented Aug 17, 2016

Is this discussion still about OpenFoam resulting .csv file details? Should we rename/close this issue?

@stgeorges

This comment has been minimized.

Show comment
Hide comment
@stgeorges

stgeorges Aug 17, 2016

As far as I am concern I got the reply to my question on resulting .csv file content.

stgeorges commented Aug 17, 2016

As far as I am concern I got the reply to my question on resulting .csv file content.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment