m |
m (→Short description: formatting and link update) |
||
(9 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{VersionInfo}}{{Version2.1}} | {{VersionInfo}}{{Version2.1}} | ||
+ | Also needed: pyFoam | ||
− | |||
− | |||
== Short description == | == Short description == | ||
− | A utility for reading a z0 | + | A utility for reading a {{tt|z0}} distribution in a [http://www.wasp.dk/?sc_lang=en WAsP] map file writing {{tt|z0}} dictionary file, and copying it into {{tt|nut}} {{tt|nutkAtmRoughWallFunction}} or other wall boundary conditions requiring {{tt|z0}} . |
− | The code is a copy of [http:// | + | The code is a copy of [http://hig.diva-portal.org/smash/get/diva2:228936/FULLTEXT01 Xabier Pedruelo Tapia's MsC. thesis] {{tt|roughnessToFoam}} utility, changed to produce {{tt|z0}} rather then {{tt|Ks}} and {{tt|Cs}} dictionary's. |
== Usage == | == Usage == | ||
Line 15: | Line 14: | ||
* writing the general z0 value outside of the polygons - | * writing the general z0 value outside of the polygons - | ||
** For every polygon, two values are expected - z0 inside the polygon , and z0 outside of the polygon. | ** For every polygon, two values are expected - z0 inside the polygon , and z0 outside of the polygon. | ||
− | ** The value outside of the first polygon is used as the value for the entire field, and only then is each polygon probed and | + | ** The value outside of the first polygon is used as the value for the entire field, and only then is each polygon probed and it's value written. |
− | + | Additionally, the code is configured to run through a python script called roughnessToFoam.py | |
+ | * It first creates a dummy z0 dictionary by copying and changing the p dictionary in the case | ||
+ | * It reads the offset parameters that quantify the difference between the roughness map coordinates and the mesh coordinates (they are assumed to be the same coordinates if no parameter is given) | ||
+ | * It calls roughnessToFoam.C | ||
+ | * It copies the result to the nut dictionary - expecting a boundary wall patch named "terrain_*" as in the turbinesiting case | ||
+ | |||
+ | The reason the z0 dictionary is kept, instead of directly writing to the nut file, is that it is very useful as it is loaded into paraview with all the other dictionary files. | ||
+ | |||
+ | A test case is included in the github repository: [https://github.com/hananel/roughnessToFoam/blob/master/testCase.tgz testCases.tgz] | ||
== Download == | == Download == | ||
− | + | The code is hosted on github: https://github.com/hananel/roughnessToFoam | |
+ | To fork the repository follow these instructions: https://help.github.com/articles/fork-a-repo - or simply clone directly, and then run {{tt|wmake}}: | ||
<pre> | <pre> | ||
− | git clone | + | git clone https://github.com/hananel/roughnessToFoam |
− | cd | + | cd roughnessToFoam |
+ | wclean | ||
wmake | wmake | ||
+ | </pre> | ||
+ | And to run the test case included: | ||
+ | <pre> | ||
+ | tar -xzf testCase.tgz | ||
+ | cd testCase | ||
+ | ./Allrun | ||
</pre> | </pre> | ||
Latest revision as of 11:50, 26 July 2015
Also needed: pyFoam
Contents
1 Short description
A utility for reading a z0 distribution in a WAsP map file writing z0 dictionary file, and copying it into nut nutkAtmRoughWallFunction or other wall boundary conditions requiring z0 . The code is a copy of Xabier Pedruelo Tapia's MsC. thesis roughnessToFoam utility, changed to produce z0 rather then Ks and Cs dictionary's.
2 Usage
The original utility is described in the appendix of Xabier Pedruelo Tapia's MsC. thesis. The changes I made to the C code are:
- Writing z0 dictionary rather then Cs and Ks
- writing the general z0 value outside of the polygons -
- For every polygon, two values are expected - z0 inside the polygon , and z0 outside of the polygon.
- The value outside of the first polygon is used as the value for the entire field, and only then is each polygon probed and it's value written.
Additionally, the code is configured to run through a python script called roughnessToFoam.py
- It first creates a dummy z0 dictionary by copying and changing the p dictionary in the case
- It reads the offset parameters that quantify the difference between the roughness map coordinates and the mesh coordinates (they are assumed to be the same coordinates if no parameter is given)
- It calls roughnessToFoam.C
- It copies the result to the nut dictionary - expecting a boundary wall patch named "terrain_*" as in the turbinesiting case
The reason the z0 dictionary is kept, instead of directly writing to the nut file, is that it is very useful as it is loaded into paraview with all the other dictionary files.
A test case is included in the github repository: testCases.tgz
3 Download
The code is hosted on github: https://github.com/hananel/roughnessToFoam
To fork the repository follow these instructions: https://help.github.com/articles/fork-a-repo - or simply clone directly, and then run wmake:
git clone https://github.com/hananel/roughnessToFoam cd roughnessToFoam wclean wmake
And to run the test case included:
tar -xzf testCase.tgz cd testCase ./Allrun