uwg.element module

Element class.

class uwg.element.Element(albedo, emissivity, layer_thickness_lst, material_lst, vegcoverage, t_init, horizontal, name)[source]

Bases: object

Element object defines wall, and roof constructions.

Parameters:
  • albedo – Number for outer surface albedo.

  • emissivity – Number for outer surface emissivity.

  • layer_thickness_lst – List of layer thickness in meters.

  • material_lst – List of Material objects in Element.

  • vegcoverage – Number for fraction of surface vegetation coverage.

  • t_init – Element initial temperature [K].

  • horizontal – Boolean indicating if Element is horizontal or not (vertical).

  • name – Text string for name of Element.

Properties:
  • albedo – outer surface albedo

  • emissivity – outer surface emissivity.

  • layer_thickness_lst – list of layer thickness [m]

  • material_lst – material objects in Element.

  • layerThermalCond – vector of layer thermal conductivities [W m-1 K-1]

  • layerVolHeat – vector of layer volumetric heat [J m-3 K-1]

  • vegcoverage – surface grass coverage

  • t_init – element initial temperature [K].

  • layerTemp – vector of layer temperatures [K]

  • waterStorage – thickness of water film [m] for horizontal surfaces only

  • horizontal – 1-horizontal, 0-vertical

  • solRec – solar radiation received [W m-2]

  • infra – net longwave radiation [W m-2]

  • lat – surface latent heat flux [W m-2]

  • sens – surface sensible heat flux [W m-2]

  • solAbs – solar radiation absorbed [W m-2]

  • aeroCond – convective heat transfer coefficient [-]

  • T_ext – external surface temperature [K]

  • T_int – internal surface temperature [K]

  • flux – external surface heat flux [W m-2]

Conduction(dt, flx1, bc, temp2, flx2)[source]

Solve the conductance of heat based on of the element layers.

Parameters:
  • dt – Simulation time step in seconds.

  • flx1 – Net heat flux on surface [W m-2]

  • bc – Boundary condition parameter (1 or 2)

  • temp2 – Deep soil temperature (ave of air temperature) [K]

  • flx2 – Surface flux (sum of absorbed, emitted, etc.) [W m-2]

Returns:

A 1d vector of element layer temperatures.

SurfFlux(forc, parameter, simTime, humRef, tempRef, windRef, boundCond, intFlux)[source]

Calculate net heat flux, and update element layer temperatures.

classmethod from_dict(data)[source]

Create a Element object from a dictionary.

Parameters:

data – A Element dictionary following the format below.

{
"albedo": 0.08,
"emissivity": 0.92,
"layer_thickness_lst": [0.0254, 0.0508, 0.0254],
"material_lst": material_dict_lst,  # List of material dictionaries
"vegcoverage": 0.5,
"t_init": 293,
"horizontal": False,
"name": MassWall
}
static invert(nz, A, C)[source]

Invert and solve tridiagonal matrix.

Given A * X = C, solves for X, where

a(, 1) lower diagonal (Ai, i-1) a(, 2) principal diagonal (Ai, i) a(*, 3) upper diagonal (Ai, i+1)

Parameters:
  • nz – number of layers.

  • A – A matrix to invert.

  • C – Result from A * X

Returns:

Solved matrix X from matrix inversion.

qsat(temp, pres, parameter)[source]

Calculate vector of saturation humidity from air pressure and layer temperatures.

Parameters:
  • temp – List of layer temperatures [K].

  • pres – Pressure (at current timestep) [Pa].

  • parameter – Parameter object with geographic parameters.

Returns:

List of saturation humidity values.

to_dict()[source]

Element dictionary representation.

property albedo

Get or set a value between 0 and 1 for outer surface albedo.

property emissivity

Get or set a value between 0 and 1 for outer surface emissivity.

property horizontal

Get or set boolean value indicating if Element is horizontal or not.

property layer_thickness_lst

Get or set list of thickness in meters of each Material in Element.

The order of thickness should correspond to the order of the Material objects in material_lst.

property material_lst

Get or set list of Material objects in the element.

The order of Material objects should correspond to the order of the thickness in layer_thickness_lst.

property name

Get or set text string for name of Element.

property t_init

Get or set initial temperature of Element [K].

property vegcoverage

Get or set fraction of vegetation coverage on Element.