windse.DomainManager
The DomainManager submodule contains the various classes used for creating different types of domains
Classes
- class windse.DomainManager.BoxDomain
A box domain is simply a 3D rectangular prism. This box is defined by 6 parameters in the param.yaml file.
Example
In the yaml file define:
domain: # # Description | Units x_range: [-2500, 2500] # x-range of the domain | m y_range: [-2500, 2500] # y-range of the domain | m z_range: [0.04, 630] # z-range of the domain | m nx: 10 # Number of x-nodes | - ny: 10 # Number of y-nodes | - nz: 2 # Number of z-nodes | -
This will produce a box with corner points (-2500,-2500,0.04) to (2500,2500,630). The mesh will have nx nodes in the x-direction, ny in the y-direction, and nz in the z-direction.
- class windse.DomainManager.CircleDomain
ADD DOCUMENTATION
- class windse.DomainManager.CylinderDomain
A cylinder domain is a cylinder that is centered a c0 and has radius r. This domain is defined by 6 parameters in the param.yaml file. The center of the cylinder is assumed to be the z-axis.
Example
In the yaml file define:
domain: # # Description | Units z_range: [0.04, 630] # z-range of the domain | m radius: 2500 # radius of base circle | m nt: 100 # Number of radial nodes| - nz: 10 # Number of z nodes | -
This will produce a upright cylinder centered at (0.0,0.0) with a radius of 2500 m and extends from z=0.04 to 630 m. The mesh will have nx nodes in the x-direction, ny in the y-direction, and nz in the z-direction.
- class windse.DomainManager.DoublePeriodicBoundary(x_range, y_range)
- class windse.DomainManager.GenericDomain
A GenericDomain contains on the basic functions required by all domain objects
- ComputeGlobalHmin()
This function computes the global hmin() value, since the hmin method isn’t parallel/global by default. Note that this assumes uniform spacing in the x-, y-, and z- directions
- Ground(x, y, dx=0, dy=0)
Ground returns the ground height given an (x, y) coordinate.
- Parameters:
x (float/list) – x location within the domain
y (float/list) – y location within the domain
- Returns:
corresponding z coordinates of the ground.
- Return type:
float/list
- Plot()
This function plots the domain using matplotlib and saves the output to output/…/plots/mesh.pdf
- Save(val=0)
This function saves the mesh and boundary markers to output/…/mesh/
- WarpSmooth(s)
This function warps the mesh to shift more cells towards the ground. The cells are shifted based on the function:
\[z_new = z_0 + (z_1-z_0) \left( \frac{z_old-z_0}{z_1-z_0} \right)^{s},\]where \(z_0\) is the ground and \(z_1\) is the top of the domain.
- Parameters:
s (float) – compression strength
- WarpSplit(h, s)
This function warps the mesh to shift more cells towards the ground. is achieved by spliting the domain in two and moving the cells so that a percentage of them are below the split.
- Parameters:
h (float) – the height that split occurs
s (float) – the percent below split in the range [0,1)
- class windse.DomainManager.ImportedDomain
This class generates a domain from imported files. This mesh is defined by 2 parameters in the param.yaml file.
Example
In the yaml file define:
domain: path: "Mesh_data/" filetype: "xml.gz"
The supported filetypes are “xml.gz” and “h5”. For “xml.gz” 3 files are required:
mesh.xml.gz - this contains the mesh in a format dolfin can handle
boundaries.xml.gz - this contains the facet markers that define where the boundaries are
- topology.txt - this contains the data for the ground topology.
It assumes that the coordinates are from a uniform mesh. It contains three column: x, y, z. The x and y columns contain just the unique values. The z column contains the ground values for every combination of x and y. The first row must be the number of points in the x and y direction. Here is an example for z=x+y/10:
3 3 9 0 0 0.0 1 1 0.1 2 2 0.2 1.0 1.1 1.2 2.0 2.1 2.2
- class windse.DomainManager.InterpolatedBoxDomain
- class windse.DomainManager.InterpolatedCylinderDomain
- class windse.DomainManager.PeriodicDomain
- class windse.DomainManager.RectangleDomain
A rectangle domain is simply a 2D rectangle. This mesh is defined by 4 parameters in the param.yaml file.
Example
In the yaml file define:
domain: # # Description | Units x_range: [-2500, 2500] # x-range of the domain | m y_range: [-2500, 2500] # y-range of the domain | m nx: 10 # Number of x-nodes | - ny: 10 # Number of y-nodes | -
This will produce a rectangle with corner points (-2500,-2500) to (2500,2500). The mesh will have nx nodes in the x-direction, and ny in the y-direction.
Todo
Properly implement a RectangleDomain and 2D in general.
- class windse.DomainManager.SinglePeriodicBoundary(a, b, axis=0)
- class windse.DomainManager.SubDomain
Functions
- windse.DomainManager.DefaultFinalize(dom)
- windse.DomainManager.Elliptical_Grid(x, y, z, radius)
- windse.DomainManager.FG_Squircular(x, y, z, radius)
- windse.DomainManager.Simple_Stretching(x, y, z, radius)