butterfly.windtunnel module

Butterfly wind tunnel.

class butterfly.windtunnel.TunnelParameters(windward=3, top=5, side=5, leeward=15)[source]

Bases: object

Wind tunnel parameters.

Each parameter will be multiplied by multiple height.

Parameters:
  • windward – Multiplier value for windward extension (default: 3).
  • top – Multiplier value for top extension (default: 5).
  • side – Multiplier value for side extension (default: 5).
  • leeward – Multiplier value for leeward extension (default: 15).
ToString()[source]

Overwrite .NET ToString method.

duplicate()[source]

Return a copy of this object.

class butterfly.windtunnel.WindTunnel(name, inlet, outlet, sides, top, ground, test_geomtries, roughness, meshing_parameters=None, Zref=None, convertToMeters=1)[source]

Bases: object

Butterfly WindTunnel.

Parameters:
  • inlet – Inlet as a butterfly geometry. inlet boundary condition should be ABL (atmBoundaryLayer).
  • outlet – Outlet as a butterfly geometry.
  • sides – Left and right side geometries as butterfly geometries.
  • top – Top face as buttefly geometry.
  • ground – Ground face as butterfly geometry.
  • test_geomtries – A list of geometries as butterfly geometries that are located within bounding box boundary.
  • roughness – z0 (roughness) value. ‘0.0002’ # sea ‘0.005’ # smooth ‘0.03’ # open ‘0.10’ # roughlyOpen ‘0.25’ # rough ‘0.5’ # veryRough ‘1.0’ # closed ‘2.0’ # chaotic
  • Zref – Reference height for wind velocity in meters (default: 10).
ABLConditionsDict

Get ABLCondition for this wind tunnel as a dictionary.

ToString()[source]

Overwrite ToString .NET method.

add_refinementRegion(refinementRegion)[source]

Add refinement regions to this case.

blockMeshDict

Wind tunnel blockMeshDict.

bounding_geometries

Return bounding geometries of wind tunnel.

calculate_grading(cell_size=1, expansion_ratio=1.2, wake_offset=2, height_offset=5, z_mode=0)[source]

Calculate simpleGrading for this wind tunnel based on best practice.

This method calcutes grading for blockMeshDict based on the size of the wind tunnel and the bounding box of the geometries.

Parameters:
  • cell_size – Cell size in the area of interest (default: 1).
  • expansion_ratio – expansion ratio for the segments outside the area of interest (default: 1.2).
  • wake_offset – The length to be added to the end of geometries bounding box to be considerd as part of area of interest (default: 2).
  • height_offset – The length to be added to the topic of geometries bounding box to be considerd as part of area of interest (default: 5).
  • z_mode – If 0 special treatment will be considerd for the first 2 and 10 meters. The first 2 meters will be graded for each half meter and from 2-10 it will be graded 0.5-1, from 10 to maximum height it will be 1-5 if expansion ration is less than expansion ratio then expansion ratio will be used. After 10 meters normal expansion_ratio will be used. If 1, z direction will be treated similar to x and y (default: 0).
Returns:

SimpleGrading, cell_count as (x_count, y_count, z_count)

flowDir

Get flow direction for this wind tunnel as a tuple (x, y, z).

flow_speed

Get flow speed for this wind tunnel.

classmethod from_geometries_wind_vector_and_parameters(name, geometries, wind_vector, tunnel_parameters, roughness, meshing_parameters=None, Zref=None, convertToMeters=1)[source]

Create a wind_tunnel based on size, wind speed and wind direction.

get_internal_dimensions()[source]

Get internal dimensions of wind tunnel.

This method returns three tuples for x, y and z which are (distance_to_geometry_bounding_box, geometry_bounding_box,

distance_after_geometry_bounding_box). This method is useful to get initial values to calculate grading.
height

Get width in x direction.

length

Get width in x direction.

meshing_parameters

Meshing parameters.

refinementRegions

Get refinement regions.

save(overwrite=False, minimum=True, make2d_parameters=None)[source]

Save wind_tunnel to folder as an OpenFOAM case.

Parameters:overwrite – If True all the current content will be overwritten (default: False).
Returns:A butterfly.Case.
to_openfoam_case(make2d_parameters=None)[source]

Return a BF case for this wind tunnel.

width

Get width in x direction.

zGround

Minimum z value of the bounding box.