# Classes and Defs
def clean_input(_input, _unit):
    val_list = [ convert_value_to_metric(val, _unit) for val in _input]
    
    return val_list

# ------------------------------------------------------------------------------
# Build the Default Re-Circulation Pipe Object
circulation_piping_ = PHPP_DHW_RecircPipe()

if pipe_geom_:
    # Get Rhino scene inputs
    circulation_piping_.set_values_from_Rhino( pipe_geom_, ghenv, _input_num=0 )

# ------------------------------------------------------------------------------
# Get GH Component inputs
if pipe_diam_:
    circulation_piping_.diams = clean_input( pipe_diam_, 'MM')
if insul_thickness_:
    circulation_piping_.insul_thicknesses = clean_input( insul_thickness_, 'MM')
if insul_conductivity_:
    circulation_piping_.insul_conductivities = clean_input( insul_conductivity_, 'W/MK') 
if insul_reflective_:
    circulation_piping_.insul_reflectives = insul_reflective_
if insul_quality_:
    circulation_piping_.quality = insul_quality_
if daily_period_:
    circulation_piping_.period = daily_period_

preview_obj(circulation_piping_)
 #-------------------------------------------------------------------
 # Build the Ground Element
 if '1' in str(_type):
     inputs = get_input_values()
     ground_element = build_slab_on_grade( floor_element, inputs )
     ground_elements_.append( ground_element )
 #-------------------------------------------------------------------
 if '2' in str(_type):
     inputs = get_input_values()
     ground_element = build_heated_basement( floor_element, inputs )
     ground_elements_.append( ground_element )
 #-------------------------------------------------------------------
 if '3' in str(_type):
     inputs = get_input_values()
     ground_element = build_unheated_basement( floor_element, inputs )
     ground_elements_.append( ground_element )
 #-------------------------------------------------------------------
 if '4' in str(_type):
     inputs = get_input_values()
     ground_element = build_crawl_space( floor_element, inputs )
     ground_elements_.append( ground_element )
 
 #-------------------------------------------------------------------
 # Add the ground element onto the HB-Room
 new_room = hb_room.duplicate()
 add_to_HB_model(new_room, 'ground', ground_element.to_dict(), ghenv)
 HB_rooms_.append( new_room )
 
 #-------------------------------------------------------------------
 preview_obj( ground_element )
Exemple #3
0
        dhw_system_obj.circulation_piping[recirc_obj.id] = recirc_obj

if branch_piping_:
    try:
        dhw_system_obj.branch_piping = {obj.id: obj for obj in branch_piping_}
    except AttributeError:
        branch_obj = LBT2PH.dhw.PHPP_DHW_branch_piping()
        branch_obj.set_pipe_lengths(branch_piping_, ghdoc, ghenv)
        dhw_system_obj.branch_piping[branch_obj.id] = branch_obj

if tank1_: dhw_system_obj.tank1 = tank1_
if tank2_: dhw_system_obj.tank2 = tank2_
if buffer_tank_: dhw_system_obj.tank_buffer = buffer_tank_
if _solar:
    dhw_system_obj.solar = _solar
    msg = dhw_system_obj.check_tanks_for_solar_connection()
    if msg:
        ghenv.Component.AddRuntimeMessage(ghK.GH_RuntimeMessageLevel.Warning,
                                          msg)

preview_obj(dhw_system_obj)

#-------------------------------------------------------------------------------
# Add the new System onto the HB-Rooms
HB_rooms_ = []
for hb_room in _HB_rooms:
    new_hb_room = hb_room.duplicate()
    new_hb_room = add_to_HB_model(
        new_hb_room, 'dhw_systems',
        {dhw_system_obj.id: dhw_system_obj.to_dict()}, ghenv)
    HB_rooms_.append(new_hb_room)
            an internal heat gain. On the contrary, dehumidification has no influence 
            on the thermal balance.
        SEER_: Default=1. 1 litre water per kWh electricity result in an energy 
            efficiency ratio of 0.7. Good devices, e.g. with internal heat recovery, 
            achieve values of up to 2.
    Returns:
        dehumidCooling_: 
"""

import LBT2PH
import LBT2PH.__versions__
import LBT2PH.heating_cooling
from LBT2PH.helpers import preview_obj
from LBT2PH.helpers import convert_value_to_metric

reload(LBT2PH)
reload(LBT2PH.__versions__)
reload(LBT2PH.heating_cooling)
reload(LBT2PH.helpers)

ghenv.Component.Name = "LBT2PH Cooling Dehumid"
LBT2PH.__versions__.set_component_params(ghenv, dev=False)

# ------------------------------------------------------------------------------
dehumid_cooling_ = LBT2PH.heating_cooling.PHPP_Cooling_Dehumid()

if waste_heat_to_room_: dehumid_cooling_.waste_to_room = waste_heat_to_room_
if SEER_: dehumid_cooling_.seer = convert_value_to_metric(SEER_, 'W/W')

preview_obj(dehumid_cooling_)
    Returns:
        variants_: Connect to the 'LBT-->PHPP' 'variants_' input.
"""

import LBT2PH
import LBT2PH.__versions__
import LBT2PH.variants
from LBT2PH.helpers import preview_obj

reload(LBT2PH)
reload(LBT2PH.__versions__)
reload(LBT2PH.variants)

ghenv.Component.Name = "LBT2PH 2PHPP Variants"
LBT2PH.__versions__.set_component_params(ghenv, dev=False)

#-------------------------------------------------------------------------------
variants_ = LBT2PH.variants.Variants(ghenv)

if windows_:        variants_.windows = windows_
if u_values_:       variants_.u_values = u_values_
if airtightness_:   variants_.airtightness = airtightness_
if thermal_bridges_:variants_.thermal_bridges = thermal_bridges_
if certification_:  variants_.certification = certification_
if primary_energy_: variants_.primary_energy = primary_energy_
if ventilation_:    variants_.ventilation = ventilation_
if custom_:         variants_.custom = custom_

#-------------------------------------------------------------------------------
preview_obj(variants_)
Exemple #6
0
reload(LBT2PH.heating_cooling)
reload(LBT2PH.helpers)

ghenv.Component.Name = "LBT2PH Heating HP Options"
LBT2PH.__versions__.set_component_params(ghenv, dev=False)

#-------------------------------------------------------------------------------
hp_options_ = LBT2PH.heating_cooling.PHPP_HP_Options()

if _design_forward_water_temp:
    hp_options_.frwd_temp = convert_value_to_metric(_design_forward_water_temp,
                                                    'C')
if hp_distribution_: hp_options_.hp_distribution = hp_distribution_
if nom_power_:
    hp_options_.nom_power = convert_value_to_metric(nom_power_, 'KW')
if rad_exponent_: hp_options_.rad_exponent = rad_exponent_
if backup_type_: hp_options_.backup_type = backup_type_
if dT_elec_flow_water_:
    hp_options_.dT_elec_flow = convert_value_to_metric(dT_elec_flow_water_,
                                                       'C')
if hp_priority_: hp_options_.hp_priority = hp_priority_
if hp_control_: hp_options_.hp_control = hp_control_
if depth_groundwater_:
    hp_options_.depth_groundwater = convert_value_to_metric(
        depth_groundwater_, 'M')
if power_groundpump_:
    hp_options_.power_groundwater = convert_value_to_metric(
        power_groundpump_, 'KW')

preview_obj(hp_options_)
#
"""
Set the parameters for a Panel Cooling Element. Sets the values on the 'Cooling Unit' worksheet.
-
EM March 1, 2021
    Args:
        SEER_: (W/W) Default=3
    Returns:
        panelCooling_: 
"""

import LBT2PH
import LBT2PH.__versions__
import LBT2PH.heating_cooling
from LBT2PH.helpers import preview_obj
from LBT2PH.helpers import convert_value_to_metric

reload( LBT2PH )
reload(LBT2PH.__versions__)
reload( LBT2PH.heating_cooling )
reload(LBT2PH.helpers)

ghenv.Component.Name = "LBT2PH Cooling Panel"
LBT2PH.__versions__.set_component_params(ghenv, dev=False)

#-------------------------------------------------------------------------------
panel_cooling_ = LBT2PH.heating_cooling.PHPP_Cooling_Panel()
if SEER_: panel_cooling_.seer = convert_value_to_metric(SEER_, 'W/W')

preview_obj(panel_cooling_)
Exemple #8
0
import LBT2PH
import LBT2PH.__versions__
from LBT2PH.helpers import preview_obj
import LBT2PH.dhw

reload(LBT2PH)
reload(LBT2PH.dhw)
reload(LBT2PH.__versions__)

ghenv.Component.Name = "LBT2PH DHW Solar Thermal"
LBT2PH.__versions__.set_component_params(ghenv, dev=False)

#-------------------------------------------------------------------------------

solar_ = LBT2PH.dhw.PHPP_DHW_Solar()

if _angle_off_north: solar_.angle_off_north = _angle_off_north
if _angle_off_horizontal: solar_.angle_off_horizontal = _angle_off_horizontal
if _host_surface: solar_.host_surface = _host_surface
if _collector_type: solar_.collector_type = _collector_type
if _collector_area: solar_.collector_area = _collector_area
if _collector_height: solar_.collector_height = _collector_height
if _horizon_height: solar_.horizon_height = _horizon_height
if _horizon_distance: solar_.horion_distance = _horizon_distance
if _additional_reduction_fac:
    solar_.additional_reduction_fac = _additional_reduction_fac
if _heating_support: solar_.heating_support = _heating_support
if _dhw_priority: solar_.dhw_priority = _dhw_priority

preview_obj(solar_)
Exemple #9
0
if _COPs: cops = _COPs

#-------------------------------------------------------------------------------
# Create the Heat Pump Object

heat_pump_ = LBT2PH.heating_cooling.PHPP_HP_AirSource()

if _unit_name: heat_pump_.name = _unit_name
if _source: heat_pump_.source = _source
if tsrcs:
    heat_pump_.temps_sources = [
        convert_value_to_metric(val, 'C') for val in tsrcs
    ]
if tsnks:
    heat_pump_.temps_sinks = [
        convert_value_to_metric(val, 'C') for val in tsnks
    ]
if hcs:
    heat_pump_.heating_capacities = [
        convert_value_to_metric(val, 'KW') for val in hcs
    ]
if cops:
    heat_pump_.cops = [convert_value_to_metric(val, 'W/W') for val in cops]
if dt_sink_: heat_pump_.sink_dt = convert_value_to_metric(dt_sink_, 'C')

for warning in heat_pump_.warnings:
    ghenv.Component.AddRuntimeMessage(ghK.GH_RuntimeMessageLevel.Warning,
                                      warning)

preview_obj(heat_pump_)
Exemple #10
0
        _uValue: (List) Input value for the glazing U-Value (W/m2-k). Glass U-Value to be calculate as per EN-673 / ISO 10292
        _gValue: (List) Input value for the glazing g-Value (SHGC) . Glass g-Value (~SHGC) to be calculate as per EN-410
    Return:
        PHPPGlazing_: A new PHPP-Style Glazing Object for use in a PHPP Window. Connect to the 'PHPP Apertures' Component.
"""

import LBT2PH
import LBT2PH.__versions__
import LBT2PH.windows
from LBT2PH.helpers import convert_value_to_metric
from LBT2PH.helpers import preview_obj

reload(LBT2PH)
reload(LBT2PH.__versions__)
reload(LBT2PH.windows)
reload(LBT2PH.helpers)

ghenv.Component.Name = "LBT2PH PHPP Aperture Glazing"
LBT2PH.__versions__.set_component_params(ghenv, dev=False)
#-------------------------------------------------------------------------------

if _name:
    _name = _name.replace(" ", "_")
    
    PHPPGlazing_ = LBT2PH.windows.PHPP_Glazing()
    if _name:   PHPPGlazing_.name = _name
    if _gValue: PHPPGlazing_.gValue = convert_value_to_metric(_gValue, '-')
    if _uValue: PHPPGlazing_.uValue = convert_value_to_metric(_uValue, 'W/M2K')
    
    preview_obj(PHPPGlazing_)
reload(LBT2PH.__versions__)
reload(LBT2PH.dhw)
reload(LBT2PH.helpers)

ghenv.Component.Name = "LBT2PH DHW Tank"
LBT2PH.__versions__.set_component_params(ghenv, dev=False)

#-------------------------------------------------------------------------------
# Creat Storage Tank
storage_tank_ = LBT2PH.dhw.PHPP_DHW_tank()
if _tank_type: storage_tank_.type = _tank_type
if tank_solar_: storage_tank_.solar = tank_solar_
if tank_HLrate_:
    storage_tank_.hl_rate = LBT2PH.dhw.clean_input(tank_HLrate_,
                                                   'tank_HLrate_', 'W/K',
                                                   ghenv)
if tank_volume_:
    storage_tank_.vol = LBT2PH.dhw.clean_input(tank_volume_, 'tank_volume_',
                                               'L', ghenv)
if tank_standby_frac_:
    storage_tank_.stndbyFrac = LBT2PH.dhw.clean_input(tank_standby_frac_,
                                                      'tank_standby_frac_',
                                                      '-', ghenv)
if tank_location_: storage_tank_.location = tank_location_
if tank_location_T_:
    storage_tank_.location_t = LBT2PH.dhw.clean_input(tank_location_T_,
                                                      'tank_location_T_', 'C',
                                                      ghenv)

preview_obj(storage_tank_)
Exemple #12
0
            > split units, energy efficiency class A: > 3.2
            > compact units, energy efficiency class A: > 3.0
            > turbo compressor > 500 kW with water cooling: up to more than 6
    Returns:
        supplyAirCooling_: 
"""

import LBT2PH
import LBT2PH.__versions__
import LBT2PH.heating_cooling
from LBT2PH.helpers import preview_obj
from LBT2PH.helpers import convert_value_to_metric

reload(LBT2PH)
reload(LBT2PH.__versions__)
reload(LBT2PH.heating_cooling)
reload(LBT2PH.helpers)

ghenv.Component.Name = "LBT2PH Cooling Supply Air"
LBT2PH.__versions__.set_component_params(ghenv, dev=False)

#-------------------------------------------------------------------------------
supply_air_cooling_ = LBT2PH.heating_cooling.PHPP_Cooling_SupplyAir()
if on_off_mode_: supply_air_cooling_.on_off = on_off_mode_
if max_cooling_cap_:
    supply_air_cooling_.max_capacity = convert_value_to_metric(
        max_cooling_cap_, 'KW')
if SEER_: supply_air_cooling_.seer = convert_value_to_metric(SEER_, 'W/W')

preview_obj(supply_air_cooling_)
reload(LBT2PH)
reload(LBT2PH.__versions__)
reload(LBT2PH.windows)
reload(LBT2PH.helpers)

ghenv.Component.Name = "LBT2PH PHPP Aperture Frame"
LBT2PH.__versions__.set_component_params(ghenv, dev=False)
#-------------------------------------------------------------------------------

def cleanInputs(_inputList, defaultValue, _unit):
    
    if len(_inputList)==4:
        return [LBT2PH.helpers.convert_value_to_metric(val, _unit) for val in _inputList]
    elif len(_inputList)==1:
        val = LBT2PH.helpers.convert_value_to_metric(_inputList[0], _unit)
        return [val]*4
    else:
        return [defaultValue]*4

if _name:
    PHPPFrame_ = LBT2PH.windows.PHPP_Frame()
    
    if _name: PHPPFrame_.name = _name.replace(" ", "_")
    if _frameUvalues: PHPPFrame_.uValues = cleanInputs(_frameUvalues, 1.0, 'W/M2K')
    if _frameWidths: PHPPFrame_.frameWidths = cleanInputs(_frameWidths, 0.12, 'M')
    if _psiGlazings: PHPPFrame_.PsiGVals = cleanInputs(_psiGlazings, 0.04 , 'W/MK')
    if _psiInstalls: PHPPFrame_.PsiInstalls = cleanInputs(_psiInstalls, 0.04, 'W/MK')
    if _chi_glass_carriers: PHPPFrame_.chiGlassCarrier = LBT2PH.helpers.convert_value_to_metric(_chi_glass_carriers, 'W/K')
    
    preview_obj(PHPPFrame_)
        recircAirCooling_: 
"""

import scriptcontext as sc
import Grasshopper.Kernel as ghK

import LBT2PH
import LBT2PH.__versions__
import LBT2PH.heating_cooling
from LBT2PH.helpers import preview_obj
from LBT2PH.helpers import convert_value_to_metric

reload( LBT2PH )
reload(LBT2PH.__versions__)
reload( LBT2PH.heating_cooling )
reload(LBT2PH.helpers)

ghenv.Component.Name = "LBT2PH Cooling Recirc"
LBT2PH.__versions__.set_component_params(ghenv, dev=False)

#-------------------------------------------------------------------------------
recirc_air_cooling_ = LBT2PH.heating_cooling.PHPP_Cooling_RecircAir()

if on_off_mode_:            recirc_air_cooling_.on_off = on_off_mode_
if max_cooling_cap_:        recirc_air_cooling_.max_capacity = convert_value_to_metric(max_cooling_cap_, 'KW')
if vol_flow_at_nom_power_:  recirc_air_cooling_.nominal_vol = convert_value_to_metric(vol_flow_at_nom_power_, 'M3/H')
if variable_vol_:           recirc_air_cooling_.variable_vol = variable_vol_
if SEER_:                   recirc_air_cooling_.seer = convert_value_to_metric(SEER_, 'W/W')

preview_obj(recirc_air_cooling_)
        boiler_: A Boiler object for use in the PHPP. Connect this output to the 'boiler_' 
        input on the 'Heating/Cooling Systems' LBT2PH Component.
"""

import Grasshopper.Kernel as ghK

import LBT2PH
import LBT2PH.__versions__
import LBT2PH.heating_cooling
from LBT2PH.helpers import preview_obj

reload(LBT2PH)
reload(LBT2PH.__versions__)
reload(LBT2PH.heating_cooling)

ghenv.Component.Name = "LBT2PH Heating Boiler"
LBT2PH.__versions__.set_component_params(ghenv, dev=False)

#-------------------------------------------------------------------------------
boiler_ = LBT2PH.heating_cooling.PHPP_Boiler()

if _type: boiler_.type = _type
if _fuel: boiler_.fuel = _fuel
if _detailed_params: boiler_.params = _detailed_params

warning_message = boiler_.check_valid_fuel()
ghenv.Component.AddRuntimeMessage(ghK.GH_RuntimeMessageLevel.Warning,
                                  warning_message)

preview_obj(boiler_)