Building Class

class solarhouse.building.Building(mesh_file: str, geo: dict, wall_material: str = 'adobe', wall_thickness: float = 0.3, start_temp_in: float = 20, power_heat_inside: float = 0, efficiency: float = 60, cover_material: str = None, heat_accumulator: dict = {'material': 'water', 'volume': 0.02}, **kwargs)

Class implements methods for work with buildings for which calculate sun energy. Example: create building and test some it`s parameters.

>>> text = 'o Cube\n'
>>> text += 'v 1.000000 1.000000 -1.000000\n'
>>> text += 'v 1.000000 0.000000 -1.000000\n'
>>> text += 'v 1.000000 1.000000 0.000000\n'
>>> text += 'v 1.000000 0.000000 0.000000\n'
>>> text += 'v 0.000000 1.000000 -1.000000\n'
>>> text += 'v 0.000000 0.000000 -1.000000\n'
>>> text += 'v 0.000000 1.000000 0.000000\n'
>>> text += 'v 0.000000 0.000000 0.000000\n'
>>> text += 's off\n'
>>> text += 'f 1/1/1 5/2/1 7/3/1 3/4/1\n'
>>> text += 'f 4/5/2 3/6/2 7/7/2 8/8/2\n'
>>> text += 'f 8/8/3 7/7/3 5/9/3 6/10/3\n'
>>> text += 'f 6/10/4 2/11/4 4/12/4 8/13/4\n'
>>> text += 'f 2/14/5 1/15/5 3/16/5 4/17/5\n'
>>> text += 'f 6/18/6 5/19/6 1/20/6 2/11/6\n'
>>> with open('test_file.obj','a') as file:            file.write(text)
418
>>> geo = {'latitude': 54.841426, 'longitude': 83.264479}
>>> vertices = [[0,0,0],[1,0,0],[1,1,0],[0,1,0],[0,1,1],[0,0,1],[1,0,1],    [1,1,1]]
>>> material = {'birch': {        'density': 700.0,        'transcalency': 0.15,        'heat_capacity': 1250.0}}
>>> b = Building(mesh_file='test_file.obj',        geo=geo,        wall_thickness=0.3,        wall_material='birch',        properties_materials=material)
>>> import os
>>> os.remove('test_file.obj')
>>> b.wall_thickness
0.3
>>> b.mesh.area
6.0
>>> round(b.mesh_inside.volume, 3)
0.064
>>> b.mesh.center_mass
array([0. , 0. , 0.5])
>>> b.floor_area_outside
1.0
>>> round(b.floor_area_inside, 3)
0.16
>>> b.windows['area']
0.0
>>> b.windows['area'] = 0.5
>>> b.walls_area_outside
4.5
>>> round(b.walls_area_inside, 3)
0.3
>>> b.heat_accumulator['mass'] = 1
>>> b.heat_accumulator['density'] = 1000
>>> b.get_perimeter_floor('inside')
1.6
>>> round(b.area_mass_walls_inside, 2)
0.2
>>> round(b.volume_air_inside, 3)
0.044
>>> b.get_perimeter_floor('outside')
4.0
>>> round(b.area_mass_walls_outside, 3)
1.7
>>> import datetime, pytz
>>> date = datetime.datetime(day=22, month=6, year=2020)
area_mass_walls_inside

Calculates area of the walls around the heat accumulator inside the house.

area_mass_walls_outside

Calculates area of the walls around the heat accumulator outside the house.

calc_reflect_power(power: float, sun_ang: float, cover_material: str = 'polycarbonat') → float

Calculates power of reflection based on : https://majetok.blogspot.ru/2014/05/vid-na-teplicu.html. Returns: float of power of the reflection of material.

calc_sun_power_on_faces() → None

Calculates the power of sun on all faces of the building.

Returns:self changed self.power_data, self.power_data_by_days
floor_area_inside

Calculates area floor inside the house

floor_area_outside

Calculates area floor outside the house

floor_thickness

Get floor thickness

get_efficient_angle(reflect_material: dict = None) → float

Get angle for material.

get_perimeter_floor(where: str) → float

Calculate perimeter of floor

Parameters:where – ‘inside’ or ‘outside’
Returns:float value of perimeter
get_prop(material: str, prop: str) → float

Retrieve a value of property for some materials.

Parameters:
  • material – string of name material
  • prop – string of name property
Returns:

float of value property

get_pv_power_face(face_tilt: float, face_azimuth: float, face_area: float) → float

Get Irradiation from PVLIB.

Parameters:
  • face_tilt – angle between normal of face and horizontal plane
  • face_azimuth – angle between normal of face and north direction
  • face_area – float value of area of face
Returns:

pandas DataFrame with sun power of current period.

heat_accumulator_volume

Get volume of heat accumulator

mesh_inside

Get mesh of inside walls and floor of the house

projection_on_flat(vector: tuple) → tuple

get vector what is projection vector on the flat plane.

volume_air_inside

Calculates volume of the air inside the house

walls_area_inside

Calculates area of walls inside the house

walls_area_outside

Calculates area of walls outside the house