Comments (4)
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()
Created on 2022-02-18 by the reprex package (v2.0.1)
from eplusr.
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:
Hope this is helpful to somebody else
from eplusr.
This is an amazingly helpful and detailed answer. I am very impressed by the eplusr
package :). Thanks!
from eplusr.
Glad it helps!
from eplusr.
Related Issues (20)
- Add support for EnergyPlus v23.1
- Use cli for verbose logging
- CI errors for Schedule Vignette
- Release eplusr 0.16.0
- Remove {hms} dependencies
- Release eplusr 0.16.1
- CRAN check error due to IDD parsing
- CRAN check errors HOT 1
- Use character input in `numeric_version()`
- Truncate messages for large parametric simulations
- Update Lincense info
- epw file loading error HOT 3
- CRAN checks error about non-character numeric version inputs
- EPW downloading error
- Add support for EnergyPlus 23.2.0
- Handle EnergyPlus download url more gracefully
- Add support for EnergyPlus v24.1.0
- Add support to install EnergyPlus locally on macOS HOT 1
- `unzip()` may fail on Windows when file paths are too long
- Add control for whether to run `ReadVarsESO` in `Idf$run()`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eplusr.