Avoid duplicate view factor calculations (Plan B)#11364
Conversation
|
|
| bool AndShadingControlInModel = false; // true if there is any window shading control for any fenestration surface | ||
| bool AnyShadingControlInModel = false; // true if there is any window shading control for any fenestration surface | ||
| bool AnyInsideShelf = false; // true if these is any inside daylighting shelf |
There was a problem hiding this comment.
Add new flag to track if there are any inside light shelves.
Fixed the name of "AndShadingControlInModel" to "AnyShading...."
| if (ShelfSurf > 0) { | ||
| // Double surface area so that both sides of the shelf are treated as internal mass | ||
| state.dataSurface->Surface(ShelfSurf).Area *= 2.0; | ||
| state.dataGlobal->AnyInsideShelf = true; // Set this to force recalc for radiant view factors due to area change |
There was a problem hiding this comment.
Set the flag here. This is where the shelf area gets doubled (after InitSolarViewFactors and before InitInteriorRadExchange).
| if (state.dataHeatBalIntRadExchg->CarrollMethod) { | ||
| thisEnclosure.Fp.dimension(numEnclosureSurfaces, 1.0); | ||
| thisEnclosure.FMRT.dimension(numEnclosureSurfaces, 0.0); |
There was a problem hiding this comment.
These are only used for CarrollMethod.
There was a problem hiding this comment.
And the statement is just to save initialization when not needed? The values you are initializing to don't seem to matter since they are not used until they are set below. That's fine if correct. Just noting it. Let me know otherwise.
There was a problem hiding this comment.
Fp and FMRT are not even dimensioned now unless the CarrollMethod is being used. Minor, but seems reasonable, esp for a large model.
| // For radiant enclosures: | ||
| // If UseRepresentativeSurfaceCalculations is true and there are no user input view factors, then calc approx view factors | ||
| // (If User supplied view factors are present, then UseRepresentativeSurfaceCalculations is skipped in SufaceGeometry::GetSurfaceData) | ||
| // Otherwise, copy final view factors from the solar enclosure |
There was a problem hiding this comment.
These are the new rules to decide if the solar view factors can be used for radiant exchange or if they need to be recalculated.
oops - need to add a line about the daylighting inside shelf.
| int NumZonesWithUserFbyS = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); | ||
| if (NumZonesWithUserFbyS > 0) { | ||
|
|
||
| GetInputViewFactorsbyName(state, |
There was a problem hiding this comment.
These are gotten in InitSolarViewFactors so no need to get them again.
Hmm, but what if there are user input view factors and an inside light shelf? Argh. May need to revert this part.
| bool useSolarViewFactors = ((!state.dataSurface->UseRepresentativeSurfaceCalculations || NumZonesWithUserFbyS > 0) && | ||
| !state.dataGlobal->AnyInsideShelf && !state.dataViewFactor->EnclSolInfo(enclosureNum).F.empty()); | ||
|
|
||
| if (useSolarViewFactors) { | ||
| thisEnclosure.F = state.dataViewFactor->EnclSolInfo(enclosureNum).F; | ||
| } else { | ||
| // Calculate the view factors and make sure they satisfy reciprocity | ||
| CalcApproximateViewFactors(state, |
There was a problem hiding this comment.
This is the heart of the change. Either copy the solar view factors or calculate approximate view factors. Plus some later reporting that is skipped when useSolarViewFactors is true.
|
|
|
|
| " ** ~~~ ** So, when there are three or less surfaces in a zone, EnergyPlus will make sure there are no losses of energy but", | ||
| " ** ~~~ ** it will not exchange the full amount of radiation with the rest of the zone as it would if there was a completed " | ||
| "enclosure.", | ||
| " ************* Testing Individual Branch Integrity", |
There was a problem hiding this comment.
Nice to have the duplicate error message gone.
mitchute
left a comment
There was a problem hiding this comment.
No further comments from me. Tests, regressions, and diffs all look good.
|
|
||
| if (NoUserInputF) { | ||
| bool useSolarViewFactors = ((!state.dataSurface->UseRepresentativeSurfaceCalculations || NumZonesWithUserFbyS > 0) && | ||
| !state.dataGlobal->AnyInsideShelf && !state.dataViewFactor->EnclSolInfo(enclosureNum).F.empty()); |
There was a problem hiding this comment.
This is where the new flag AnyInsideShelf is used to avoid a new view factor calculation. At least that part of the change is apparent.
|
|
|
@mitchute do you know what is causing the linux UnitTestsCoverage CI failure? |
|
@rraustad not currently. I did build it on my personal linux box in this config yesterday, and it all was successful. I haven't had the chance to try it on the CI machines directly yet. |
|
|
|
@rraustad I didn't change anything related to CI, so I guess there was something else going on. We'll merge this now. |

Pull request overview
Pull Request Author
Reviewer