NatLabRockies / NatLabRockies/OpenStudio

Returned filmResistance() values for non-vertical, interzone surfaces

Open
#5,604 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement Request Triage
Dominant language
C++
Stars
646
Forks
237
Avg merge
3d 11h
Merged PRs (30d)
10

Description

General Summary

Surface filmResistance should ideally return the combined PlanarSurface still air film resistances (under standard conditions) of either side of an interzone surface, rather than simply doubling the returned PlanarSurface stillAirFilmResistance. This would harmonize with EnergyPlus-reported U-factors (with vs without surface air film resistances).

Detailed Description

OpenStudio vs EnergyPlus do not report the same U-factors (under standard conditions) when evaluating non-vertical interzone surfaces (e.g. insulated attic floors). There are no differences with vertical (symmetrical) interzone walls, though.

An EnergyPlus-reported horizontal (interzone) surface air film resistance is ~0.267 m2.K/W, regardless if reporting on a floor, or its matching ceiling below. In OpenStudio, this would correspond approximately to the sum of both:

OpenStudio::Model::PlanarSurface.stillAirFilmResistance(0)    # 0.106 if tilt == 0°   (facing UP)
OpenStudio::Model::PlanarSurface.stillAirFilmResistance(3.14) # 0.160 if tilt == 180° (facing DOWN)

OpenStudio Surface filmResistance returns:

  • 0.321 m2.K/W (i.e. 2x 0.160) if evaluating an attic floor (facing DOWN)
  • 0.212 m2.K/W (i.e. 2x 0.106) if evaluating its adjacent ceiling below (facing UP)

Neither returned values are suitable. Workarounds are needed when interacting with the OpenStudio API. This is further discussed here.

Possible Implementation

The fix could look something like this (towards the end):

double Surface_Impl::filmResistance() const {
    double interiorResistance = PlanarSurface::stillAirFilmResistance(tilt());
    std::string obc = this->outsideBoundaryCondition();
    boost::to_lower(obc);
    if (obc == "outdoors") {
      return PlanarSurface::filmResistance(FilmResistanceType::MovingAir_15mph) + interiorResistance;
    } else if (isPartOfEnvelope()) {
      // ground, underground, or other side coefficients/conditions
      // assume one interiorResistance
      if ((obc == "othersidecoefficients") || (obc == "othersideconditionsmodel")) {
        LOG(Warn, "Returning film ... ");
      }
      return interiorResistance;
    }
    // return 2.0 * interiorResistance; // ... current solution
    
    // Reciprocal tilt, e.g. if tilt() == 0°, tiltx = 180°
    tiltx = tilt() + boost::math::constants::pi<double>();
  
    // Assuming tilt() is contrained to [0°, 180°], constrain tiltx [0° 180°]:
    //   e.g. tiltx == 210° if tilt() ==  30°, so convert tiltx to 150°
    //   e.g. tiltx == 330° if tilt() == 150°, so convert tiltx to  30°
    //   e.g. tiltx == 275° if tilt() ==  95°, so convert tiltx to  85°
    if tiltx > boost::math::constants::pi<double>() {
      tiltx = boost::math::constants::pi<double>() - tilt();
    }
  
    double exteriorResistance = PlanarSurface::stillAirFilmResistance(tiltx);
    return interiorResistance + exteriorResistance;
  }

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/model/Surface.cpp at Surface_Impl::filmResistance() and compare its current behavior with PlanarSurface::stillAirFilmResistance() in src/model/PlanarSurface.cpp. Trace the interzone and boundary-condition paths, then verify that non-vertical interzone surfaces return the combined reciprocal-side resistance while existing outdoor and vertical behavior remains appropriate; the reported value should align with EnergyPlus at about 0.267 m2.K/W.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.