Class: BTAP::Resources::Envelope::ConstructionSets::ConstructionsSetTests

Inherits:
Test::Unit::TestCase
  • Object
show all
Defined in:
lib/openstudio-standards/btap/envelope.rb

Instance Method Summary collapse

Instance Method Details

#test_create_default_construction_setObject

This method creates default constructions



916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
# File 'lib/openstudio-standards/btap/envelope.rb', line 916

def test_create_default_construction_set()
  model = OpenStudio::Model::Model.new()
  #Create layers from defaults
  insulation = BTAP::Resources::Envelope::Materials::Opaque::create_opaque_material(model)
  opaque = BTAP::Resources::Envelope::Materials::Opaque::create_opaque_material(model)
  air_gap = BTAP::Resources::Envelope::Materials::Opaque::create_air_gap(model)
  massless = BTAP::Resources::Envelope::Materials::Opaque::create_massless_opaque_material(model)
  construction = BTAP::Resources::Envelope::Constructions::create_construction(model, "test construction",[opaque,air_gap,insulation,massless,opaque],insulation )
  walls_cons = floor_cons = roof_cons = construction
  exterior_construction_set = BTAP::Resources::Envelope::ConstructionSets::create_default_surface_constructions(model,"test construction set",walls_cons,floor_cons,roof_cons)
  interior_construction_set = ground_construction_set = exterior_construction_set

  #Create layers from defaults
  simple = BTAP::Resources::Envelope::Materials::Fenestration::create_simple_glazing(model)
  standard = BTAP::Resources::Envelope::Materials::Fenestration::create_standard_glazing(model)
  gas = BTAP::Resources::Envelope::Materials::Fenestration::create_gas(model)
  blind = BTAP::Resources::Envelope::Materials::Fenestration::create_blind(model)
  screen = BTAP::Resources::Envelope::Materials::Fenestration::create_screen(model)
  shade = BTAP::Resources::Envelope::Materials::Fenestration::create_shade(model)
  fixedWindowConstruction = BTAP::Resources::Envelope::Constructions::create_construction(model, "test construction",[ simple,standard,gas,blind,screen,shade],gas )
  operableWindowConstruction = setDoorConstruction = setGlassDoorConstruction = overheadDoorConstruction = skylightConstruction = tubularDaylightDomeConstruction = tubularDaylightDiffuserConstruction = fixedWindowConstruction
  ext_subsurface_constructions = BTAP::Resources::Envelope::ConstructionSets::create_subsurface_construction_set(
    model,
    fixedWindowConstruction,
    operableWindowConstruction,
    setDoorConstruction,
    setGlassDoorConstruction,
    overheadDoorConstruction,
    skylightConstruction,
    tubularDaylightDomeConstruction,
    tubularDaylightDiffuserConstruction)

  int_subsurface_constructions = ext_subsurface_constructions

  construction_set = BTAP::Resources::Envelope::ConstructionSets::create_default_construction_set(
    model,
    "default construction set test",
    exterior_construction_set,
    interior_construction_set,
    ground_construction_set,
    ext_subsurface_constructions,
    int_subsurface_constructions)

  #Check that the construction was created
  assert( !(construction_set.to_DefaultConstructionSet.empty?))
end

#test_create_default_subsurface_constructionsObject

This method creates default subsurface constructions



889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
# File 'lib/openstudio-standards/btap/envelope.rb', line 889

def test_create_default_subsurface_constructions()
  model = OpenStudio::Model::Model.new()
  #Create layers from defaults
  simple = BTAP::Resources::Envelope::Materials::Fenestration::create_simple_glazing(model)
  standard = BTAP::Resources::Envelope::Materials::Fenestration::create_standard_glazing(model)
  gas = BTAP::Resources::Envelope::Materials::Fenestration::create_gas(model)
  blind = BTAP::Resources::Envelope::Materials::Fenestration::create_blind(model)
  screen = BTAP::Resources::Envelope::Materials::Fenestration::create_screen(model)
  shade = BTAP::Resources::Envelope::Materials::Fenestration::create_shade(model)
  fixedWindowConstruction = BTAP::Resources::Envelope::Constructions::create_construction(model, "test construction",[ simple,standard,gas,blind,screen,shade],gas )
  operableWindowConstruction = setDoorConstruction = setGlassDoorConstruction = overheadDoorConstruction = skylightConstruction = tubularDaylightDomeConstruction = tubularDaylightDiffuserConstruction = fixedWindowConstruction
  default_subsurface_constructions = BTAP::Resources::Envelope::ConstructionSets::create_subsurface_construction_set(
    model,
    fixedWindowConstruction,
    operableWindowConstruction,
    setDoorConstruction,
    setGlassDoorConstruction,
    overheadDoorConstruction,
    skylightConstruction,
    tubularDaylightDomeConstruction,
    tubularDaylightDiffuserConstruction)
  assert( !(default_subsurface_constructions.to_DefaultSubSurfaceConstructions.empty?))
end

#test_create_default_surface_constructionsObject

This method creates default surface constructions



852
853
854
855
856
857
858
859
860
861
862
863
864
# File 'lib/openstudio-standards/btap/envelope.rb', line 852

def test_create_default_surface_constructions()
  model = OpenStudio::Model::Model.new()
  #Create layers from defaults
  insulation = BTAP::Resources::Envelope::Materials::Opaque::create_opaque_material(model)
  opaque = BTAP::Resources::Envelope::Materials::Opaque::create_opaque_material(model)
  air_gap = BTAP::Resources::Envelope::Materials::Opaque::create_air_gap(model)
  massless = BTAP::Resources::Envelope::Materials::Opaque::create_massless_opaque_material(model)
  construction = BTAP::Resources::Envelope::Constructions::create_construction(model, "test construction",[opaque,air_gap,insulation,massless,opaque],insulation )
  walls_cons = floor_cons = roof_cons = construction
  construction_set = BTAP::Resources::Envelope::ConstructionSets::create_default_surface_constructions(model,"test construction set",walls_cons,floor_cons,roof_cons)
  #Check that the construction was created
  assert( !(construction_set.to_DefaultSurfaceConstructions.empty?))
end

#test_customize_default_surface_constructions_rsiObject

This method customizes default surface constructions



868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
# File 'lib/openstudio-standards/btap/envelope.rb', line 868

def test_customize_default_surface_constructions_rsi()
  model = OpenStudio::Model::Model.new()
  #Create layers from defaults
  insulation = BTAP::Resources::Envelope::Materials::Opaque::create_opaque_material(model)
  opaque = BTAP::Resources::Envelope::Materials::Opaque::create_opaque_material(model)
  air_gap = BTAP::Resources::Envelope::Materials::Opaque::create_air_gap(model)
  massless = BTAP::Resources::Envelope::Materials::Opaque::create_massless_opaque_material(model)
  construction = BTAP::Resources::Envelope::Constructions::create_construction(model, "test construction",[opaque,air_gap,insulation,massless,opaque],insulation )
  walls_cons = floor_cons = roof_cons = construction
  construction_set = BTAP::Resources::Envelope::ConstructionSets::create_default_surface_constructions(model,"test construction set",walls_cons,floor_cons,roof_cons)
  #Check that the construction was created
  assert( !(construction_set.to_DefaultSurfaceConstructions.empty?))
  new_set = BTAP::Resources::Envelope::ConstructionSets::customize_default_surface_constructions_rsi(model,"changed_rsi",construction_set,1.0/2.45,1.0/2.55 , 1.0/2.65)
  assert_in_delta(1.0/2.45,BTAP::Resources::Envelope::Constructions::get_conductance(new_set.wallConstruction.get).to_f,0.00001 )
  assert_in_delta(1.0/2.55,BTAP::Resources::Envelope::Constructions::get_conductance(new_set.floorConstruction.get).to_f,0.00001 )
  assert_in_delta(1.0/2.65,BTAP::Resources::Envelope::Constructions::get_conductance(new_set.roofCeilingConstruction.get).to_f,0.00001 )
end