Difference between revisions of "Contrib/roughnessToFoam"

From OpenFOAMWiki
m
(first version of page complete)
Line 15: Line 15:
 
* 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  
+
** 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.
  
Source of example and original code: [http:// example case hill with variable roughness]
+
Additionally, the code is configured to run through a python script called rpughnessToFoam.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
  
== Download ==
+
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.
Get the most recent version here: http://
+
 +
A test case is included in the github repository: [https://github.com/hananel/roughnessToFoam/blob/master/testCase.tgz testCases.tgz]
  
 +
== Download ==
 +
The code is hosted on github - https://github.com/hananel/roughnessToFoam
 +
To fork the repository follw these instructions https://help.github.com/articles/fork-a-repo
 +
or simply
 
<pre>
 
<pre>
git clone http://
+
git clone https://github.com/hananel/roughnessToFoam
cd
+
wmake
+
 
</pre>
 
</pre>
  

Revision as of 13:14, 14 October 2012

Valid versions: OF Version 21.png


1 = under construction

2 Short description

A utility for reading a z0 destribution 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.

3 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 rpughnessToFoam.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

4 Download

The code is hosted on github - https://github.com/hananel/roughnessToFoam To fork the repository follw these instructions https://help.github.com/articles/fork-a-repo or simply

git clone https://github.com/hananel/roughnessToFoam

5 History

--Hananlevy (talk) 12:55, 14 October 2012 (CEST)