Beispiel #1
0
def convert_spec(common, envelope):

    # 入力辞書データから外皮の部位のクラスに変換する。
    gps = GeneralPart.make_general_parts(ds=envelope['general_parts'])
    ws = Window.make_windows(ds=envelope['windows'])
    ds = Door.make_doors(ds=envelope['doors'])
    eps = EarthfloorPerimeter.make_earthfloor_perimeters(
        ds=envelope['earthfloor_perimeters'])
    ecs = EarthfloorCenter.make_earthfloor_centers(
        ds=envelope['earthfloor_centers'])
    hbs = Heatbridge.make_heatbridges(ds=envelope['heat_bridges'])

    # 内壁床の作成
    ifs = make_inner_floors(common=common, gps=gps, ws=ws, ds=ds, ecs=ecs)

    # 内壁壁の作成
    iws = make_inner_walls(common=common, gps=gps, ws=ws, ds=ds)

    envelope_out = {
        'general_parts': [s.get_as_dict() for s in gps],
        'windows': [s.get_as_dict() for s in ws],
        'doors': [s.get_as_dict() for s in ds],
        'earthfloor_perimeters': [s.get_as_dict() for s in eps],
        'earthfloor_centers': [s.get_as_dict() for s in ecs],
        'heat_bridges': [s.get_as_dict() for s in hbs],
        'inner_floors': [s.get_as_dict() for s in ifs],
        'inner_walls': [s.get_as_dict() for s in iws]
    }

    return envelope_out
Beispiel #2
0
def check_u_a_and_eta_a(region, model_house_envelope):

    gps: List[GeneralPart] = GeneralPart.make_general_parts(
        ds=model_house_envelope['general_parts'])
    ws: List[Window] = Window.make_windows(ds=model_house_envelope['windows'])
    ds: List[Door] = Door.make_doors(ds=model_house_envelope['doors'])
    eps: List[
        EarthfloorPerimeter] = EarthfloorPerimeter.make_earthfloor_perimeters(
            ds=model_house_envelope['earthfloor_perimeters'])
    ecs: List[EarthfloorCenter] = EarthfloorCenter.make_earthfloor_centers(
        ds=model_house_envelope['earthfloor_centers'])

    # 外皮の面積の合計, m2
    a_evp_total = get_envelope_total_area(gps=gps, ws=ws, ds=ds, ecs=ecs)

    # q値, W/K
    q_total = get_q(gps=gps, ws=ws, ds=ds, eps=eps, region=region)

    # UA値, W/m2K
    u_a = q_total / a_evp_total

    if region != 8:

        m_h = get_m(gps=gps, ws=ws, ds=ds, region=region, season='heating')
        eta_a_h = m_h / a_evp_total * 100.0

    else:

        eta_a_h = None

    m_c = get_m(gps=gps, ws=ws, ds=ds, region=region, season='cooling')

    eta_a_c = m_c / a_evp_total * 100

    return u_a, eta_a_h, eta_a_c
def get_earthfloor_centers_lv3(
        ecs: List[EarthfloorCenter]) -> List[EarthfloorCenter]:

    ecs_lv3 = [
        EarthfloorCenter(name=s.name,
                         area=s.area,
                         space_type='underfloor',
                         earthfloor_center_spec=s.earthfloor_center_spec)
        for s in ecs
    ]

    return ecs_lv3
def convert_spec(common, envelope):

    a_f_mr = common['main_occupant_room_floor_area']
    a_f_or = common['other_occupant_room_floor_area']
    a_f_total = common['total_floor_area']

    gps_lv3 = get_general_parts_lv3(
        a_f_mr=a_f_mr,
        a_f_or=a_f_or,
        a_f_total=a_f_total,
        gps=GeneralPart.make_general_parts(ds=envelope['general_parts']))

    ws_lv3 = get_windows_lv3(a_f_mr=a_f_mr,
                             a_f_or=a_f_or,
                             a_f_total=a_f_total,
                             ws=Window.make_windows(ds=envelope['windows']))

    ds_lv3 = get_doors_lv3(a_f_mr=a_f_mr,
                           a_f_or=a_f_or,
                           a_f_total=a_f_total,
                           ds=Door.make_doors(ds=envelope['doors']))

    hbs_lv3 = get_heatbridges_lv3(
        a_f_mr=a_f_mr,
        a_f_or=a_f_or,
        a_f_total=a_f_total,
        hbs=Heatbridge.make_heatbridges(ds=envelope['heat_bridges']))

    eps_lv3 = get_earthfloor_perimeters_lv3(
        eps=EarthfloorPerimeter.make_earthfloor_perimeters(
            ds=envelope['earthfloor_perimeters']))

    ecs_lv3 = get_earthfloor_centers_lv3(
        ecs=EarthfloorCenter.make_earthfloor_centers(
            ds=envelope['earthfloor_centers']))

    result = {
        'input_method': 'detail_with_room_usage',
        'general_parts': [r.get_as_dict() for r in gps_lv3],
        'windows': [w_lv3.get_as_dict() for w_lv3 in ws_lv3],
        'doors': [d_lv3.get_as_dict() for d_lv3 in ds_lv3],
        'heat_bridges': [hb_lv3.get_as_dict() for hb_lv3 in hbs_lv3],
        'earthfloor_perimeters': [ep_lv3.get_as_dict() for ep_lv3 in eps_lv3],
        'earthfloor_centers': [ec_lv3.get_as_dict() for ec_lv3 in ecs_lv3]
    }

    return result
Beispiel #5
0
    def test_2_get_earthfloor_total_area(self):
        envelope = {'earthfloor_centers': []}

        ecs = [
            EarthfloorCenter(
                name=s['name'],
                area=s['area'],
                space_type=s['space_type'],
                earthfloor_center_spec=EarthfloorCenterSpec(layers=[]))
            for s in envelope['earthfloor_centers']
        ]

        a_ef_mr, a_ef_or, a_ef_nr, a_ef_uf = nb.get_earthfloor_total_area(
            ecs=ecs)

        self.assertEqual(0.0, a_ef_mr)
        self.assertEqual(0.0, a_ef_or)
        self.assertEqual(0.0, a_ef_nr)
        self.assertEqual(0.0, a_ef_uf)
Beispiel #6
0
def add_spec_ecs(ecs: List[EarthfloorCenterNoSpec]) -> List[EarthfloorCenter]:
    """

    Args:
        ecs:

    Returns:

    """
    ecs_spec = [
        EarthfloorCenter(
            name=s.name,
            area=s.area,
            space_type=s.space_type,
            earthfloor_center_spec=EarthfloorCenterSpec(
                layers=[]
            )
        )
        for s in ecs
    ]
    return ecs_spec
Beispiel #7
0
    def test_1_get_earthfloor_total_area(self):
        envelope = {
            'earthfloor_centers': [
                {
                    'name': 'ec1',
                    'area': 55.5,
                    'space_type': 'main_occupant_room',
                },
                {
                    'name': 'ec2',
                    'area': 44.4,
                    'space_type': 'other_occupant_room',
                },
                {
                    'name': 'ec3',
                    'area': 33.3,
                    'space_type': 'non_occupant_room',
                },
                {
                    'name': 'ec4',
                    'area': 22.2,
                    'space_type': 'underfloor',
                },
                {
                    'name': 'ec5',
                    'area': 5.5,
                    'space_type': 'main_occupant_room',
                },
                {
                    'name': 'ec6',
                    'area': 4.4,
                    'space_type': 'other_occupant_room',
                },
                {
                    'name': 'ec7',
                    'area': 3.3,
                    'space_type': 'non_occupant_room',
                },
                {
                    'name': 'ec8',
                    'area': 2.2,
                    'space_type': 'underfloor',
                },
            ]
        }

        ecs = [
            EarthfloorCenter(
                name=s['name'],
                area=s['area'],
                space_type=s['space_type'],
                earthfloor_center_spec=EarthfloorCenterSpec(layers=[]))
            for s in envelope['earthfloor_centers']
        ]

        a_ef_mr, a_ef_or, a_ef_nr, a_ef_uf = nb.get_earthfloor_total_area(
            ecs=ecs)

        self.assertEqual(55.5 + 5.5, a_ef_mr)
        self.assertEqual(44.4 + 4.4, a_ef_or)
        self.assertEqual(33.3 + 3.3, a_ef_nr)
        self.assertEqual(22.2 + 2.2, a_ef_uf)
Beispiel #8
0
def convert_lv4_to_initializer(common, envelope, d, equipment_main,
                               equipment_other, natural_vent):

    region = common['region']

    # 床面積の合計, m2
    a_a = common['total_floor_area']

    # 主たる居室の床面積, m2
    a_mr = common['main_occupant_room_floor_area']

    # その他の居室の床面積, m2
    a_or = common['other_occupant_room_floor_area']

    # 非居室の床面積, m2
    a_nr = a_a - a_mr - a_or

    # 一般部位
    gps = GeneralPart.make_general_parts(ds=envelope['general_parts'])

    # 大部分がガラスで構成される窓等の開口部
    ws = Window.make_windows(ds=envelope['windows'])

    # 大部分がガラスで構成されないドア等の開口部
    ds = Door.make_doors(ds=envelope['doors'])

    # 土間床周辺部
    efps = EarthfloorPerimeter.make_earthfloor_perimeters(
        ds=envelope['earthfloor_perimeters'])

    # 土間床中央部
    efcs = EarthfloorCenter.make_earthfloor_centers(
        ds=envelope['earthfloor_centers'])

    # 熱橋
    hbs = Heatbridge.make_heatbridges(ds=envelope['heat_bridges'])

    # 室内床
    ifs = InnerFloor.make_inner_floors(ds=envelope['inner_floors'])

    # 室内壁
    iws = InnerWall.make_inner_walls(ds=envelope['inner_walls'])

    ventilation = d['ventilation']

    d_calc_input = {'common': {'region': region}}

    make_rooms(d,
               d_calc_input,
               envelope,
               equipment_main,
               equipment_other,
               region,
               ventilation,
               natural_vent,
               a_a=a_a,
               a_mr=a_mr,
               a_or=a_or,
               a_nr=a_nr,
               gps=gps,
               ws=ws,
               ds=ds)

    return d_calc_input