idf file causing segfault and mirrors of nonconvex shading surfaces are classified as convex
marklemay opened this issue · comments
Issue overview
This idf file causes a segfualt. It is likely there is bad geometry in the file, but this should be reported through the eplusout.err and not a crash.
The file may be failing the assert
at: src\EnergyPlus\DataSurfaces.cc, line 183. But this should be confirmed.
Details
Some additional details for this issue (if relevant):
- Platform: Windows
- Version of EnergyPlus: 23.1.0-87ed9199d4 (also think it happens with 24.1.0-1c07712767)
- Unmethours link or helpdesk ticket number
Checklist
Add to this list or remove from it as applicable. This is a simple templated set of guidelines.
- Defect file: in.zip
- Ticket added to Pivotal for defect (development team task)
- Pull request created (the pull request will have additional tasks related to reviewing changes that fix this defect)
@MatthewSteen this is the issue we were discussing earlier.
@marklemay Yes, it is failing at that assert (when running a debug build). The surface that it's failing on appears to be Mir-AIM108660
which is the mirror of AIM108660
a shading surface with 24 vertices.
I see why it's failing the assert
. The surface is convex with 24 vertices, so it falls into this block:
EnergyPlus/src/EnergyPlus/DataSurfaces.cc
Line 125 in 6eaeca6
It goes through some gymnastics and fails here, because crossEdges.size()=4
.
EnergyPlus/src/EnergyPlus/DataSurfaces.cc
Line 183 in 6eaeca6
For reference:
EnergyPlus/src/EnergyPlus/DataSurfaces.hh
Lines 467 to 468 in 6eaeca6
However, deleting all of the shading surfaces with >=20 vertices doesn't solve the crash (for release builds).
The root of the segfault problem is here:
EnergyPlus/src/EnergyPlus/HeatBalanceSurfaceManager.cc
Lines 408 to 413 in 6eaeca6
The second argument should be state.dataViewFactor->NumOfSolarEnclosures
which is 363 for this file, not NumOfZones
which is 115 for this file. This argument is used to size some arrays that are only used for interzone windows and this results in an array bounds error later on.
So, there are actually two issues here:
- The surface geometry problem that fails the assert.
- The array size problem for models with interzone (or interspace) windows where
NumZones
<NumOfSolarEnclosures
.
If the interior window(s) are not important for this simulation, the easiest (possibly only) workaround is to delete them.
Surfaces "aim39809" and "aim39809 Reversed" are the interzone window surfaces. With these removed, the simulation runs to completion.