Giter VIP home page Giter VIP logo

Comments (4)

hongyuanjia avatar hongyuanjia commented on July 2, 2024 1

This is because every surface from each zone is duplicated. Taking Surface 1, Surface 7 and Surface 13 as an example:

library(eplusr)

idf <- read_idf("3ZoneModel_modified.idf")
#> IDD v9.4.0 has not been parsed before.
#> Try to locate 'Energy+.idd' in EnergyPlus v9.4.0 installation folder 'C:\EnergyPlusV9-4-0'.
#> IDD file found: 'C:\Users\hongy\AppData\Local\EnergyPlusV9-4-0\Energy+.idd'.
#> Start parsing...
#> Parsing completed.
# there are many surfaces that have the same vertices
idf$to_table(c("Surface 1", "Surface 7", "Surface 13"), wide = TRUE)
#>    id       name                    class       Name Surface Type
#> 1:  2  Surface 1 BuildingSurface:Detailed  Surface 1        Floor
#> 2:  8  Surface 7 BuildingSurface:Detailed  Surface 7        Floor
#> 3: 14 Surface 13 BuildingSurface:Detailed Surface 13        Floor
#>    Construction Name      Zone Name Outside Boundary Condition
#> 1:              Z1_F Thermal_Zone_1                     Ground
#> 2:              Z2_F Thermal_Zone_2                     Ground
#> 3:              Z3_F Thermal_Zone_3                     Ground
#>    Outside Boundary Condition Object Sun Exposure Wind Exposure
#> 1:                              <NA>        NoSun        NoWind
#> 2:                              <NA>        NoSun        NoWind
#> 3:                              <NA>        NoSun        NoWind
#>    View Factor to Ground Number of Vertices Vertex 1 X-coordinate
#> 1:                  <NA>               <NA>                8.8392
#> 2:                  <NA>               <NA>                8.8392
#> 3:                  <NA>               <NA>                8.8392
#>    Vertex 1 Y-coordinate Vertex 1 Z-coordinate Vertex 2 X-coordinate
#> 1:                     0                     0                8.8392
#> 2:                     0                     0                8.8392
#> 3:                     0                     0                8.8392
#>    Vertex 2 Y-coordinate Vertex 2 Z-coordinate Vertex 3 X-coordinate
#> 1:               -5.7912                     0                     0
#> 2:               -5.7912                     0                     0
#> 3:               -5.7912                     0                     0
#>    Vertex 3 Y-coordinate Vertex 3 Z-coordinate Vertex 4 X-coordinate
#> 1:               -5.7912                     0                     0
#> 2:               -5.7912                     0                     0
#> 3:               -5.7912                     0                     0
#>    Vertex 4 Y-coordinate Vertex 4 Z-coordinate
#> 1:                     0                     0
#> 2:                     0                     0
#> 3:                     0                     0

You can use this code snippet plot all the surfaces for each zone

surf <- idf$geometry()$azimuth()
img <- c()
viewer <- idf$view()
for (i in seq.int(nrow(surf))) {
    viewer$show(surface = surf$name[i])
    img <- c(img, rgl::snapshot3d(file.path(tempdir(), sprintf("%s-%s.png", surf$zone[i], surf$name[i]), webshot = FALSE)))
}
surf$image <- img
surf[type == "Wall", type := data.table::fcase(
    azimuth == 0, "North Wall",
    azimuth == 90, "East Wall",
    azimuth == 180, "South Wall",
    azimuth == 270, "West Wall"
)]
surf[, type := forcats::fct_relevel(type, "Roof", "North Wall", "East Wall", "South Wall", "West Wall")]
surf[, type := forcats::fct_rev(type)]

library(ggimage)

ggplot(surf, aes(zone, type)) +
    geom_image(aes(image = image), size = 0.15) +
    labs(x = NULL, y = NULL) +
    theme_minimal()

surfaces

Created on 2022-02-18 by the reprex package (v2.0.1)

from eplusr.

corymosiman12 avatar corymosiman12 commented on July 2, 2024 1

As a follow up to this, I did know that the surfaces were specified exactly the same for each of the zones, however, I thought they would be correctly offset because of the x_origin, y_origin, and z_origin in the following:

    "Zone": {
        "Thermal_Zone_1": {
            "direction_of_relative_north": 0,
            "floor_area": 51.1896,
            "multiplier": 1,
            "volume": 156.0258,
            "x_origin": 0,
            "y_origin": 5.7912,
            "z_origin": 0,
            "zone_inside_convection_algorithm": "TARP"
        },
        "Thermal_Zone_2": {
            "direction_of_relative_north": 0,
            "floor_area": 51.1896,
            "multiplier": 1,
            "volume": 156.0258,
            "x_origin": 8.8392,
            "y_origin": 5.7912,
            "z_origin": 0,
            "zone_inside_convection_algorithm": "TARP"
        },
        "Thermal_Zone_3": {
            "direction_of_relative_north": 0,
            "floor_area": 51.1896,
            "multiplier": 1,
            "volume": 156.0258,
            "x_origin": 17.6784,
            "y_origin": 5.7912,
            "z_origin": 0,
            "zone_inside_convection_algorithm": "TARP"
        }

I was just reading through the E+ IO Reference and found that all I needed to do was change: "coordinate_system": "World" to "coordinate_system": "Relative" in the global geometry rules. It now renders correctly:
image

Hope this is helpful to somebody else

from eplusr.

corymosiman12 avatar corymosiman12 commented on July 2, 2024

This is an amazingly helpful and detailed answer. I am very impressed by the eplusr package :). Thanks!

from eplusr.

hongyuanjia avatar hongyuanjia commented on July 2, 2024

Glad it helps!

from eplusr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.