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



507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
# File 'lib/openstudio-standards/btap/envelope.rb', line 507

def test_create_default_construction_set()
  model = OpenStudio::Model::Model.new()
  #Create layers from defaults
  insulation = OpenStudio::Model::StandardOpaqueMaterial.new(model, 'Smooth', 0.1, 0.001, 0.1, 0.1)
  opaque = OpenStudio::Model::StandardOpaqueMaterial.new(model, 'Smooth', 0.1, 0.1, 0.1, 100)
  massless = OpenStudio::Model::MasslessOpaqueMaterial.new(model, 'Smooth', 0.1)
  construction = BTAP::Resources::Envelope::Constructions::create_construction(model, "test construction", [opaque, 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 = OpenStudio::Model::SimpleGlazing.new(model, 0.1, 0.1)
  simple.setThickness(0.005)
  simple.setVisibleTransmittance(0.8)
  standard = OpenStudio::Model::StandardGlazing.new(model, 'SpectralAverage', 0.003)
  fixedWindowConstruction = BTAP::Resources::Envelope::Constructions::create_construction(model, "test construction", [simple, standard])
  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



483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
# File 'lib/openstudio-standards/btap/envelope.rb', line 483

def test_create_default_subsurface_constructions()
  model = OpenStudio::Model::Model.new()
  #Create layers from defaults
  simple = OpenStudio::Model::SimpleGlazing.new(model, 0.1, 0.1)
  simple.setThickness(0.005)
  simple.setVisibleTransmittance(0.8)
  standard = OpenStudio::Model::StandardGlazing.new(model, 'SpectralAverage', 0.003)
  fixedWindowConstruction = BTAP::Resources::Envelope::Constructions::create_construction(model, "test construction", [simple, standard])
  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



468
469
470
471
472
473
474
475
476
477
478
479
# File 'lib/openstudio-standards/btap/envelope.rb', line 468

def test_create_default_surface_constructions()
  model = OpenStudio::Model::Model.new()
  #Create layers from defaults
  insulation = OpenStudio::Model::StandardOpaqueMaterial.new(model, 'Smooth', 0.1, 0.001, 0.1, 0.1)
  opaque = OpenStudio::Model::StandardOpaqueMaterial.new(model, 'Smooth', 0.1, 0.1, 0.1, 100)
  massless = OpenStudio::Model::MasslessOpaqueMaterial.new(model, 'Smooth', 0.1)
  construction = BTAP::Resources::Envelope::Constructions::create_construction(model, "test construction", [opaque, 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