-
Notifications
You must be signed in to change notification settings - Fork 457
Avoid duplicate view factor calculations (Plan B) #11364
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
|
|
mjwitte
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code walk-thru
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are only used for CarrollMethod.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fp and FMRT are not even dimensioned now unless the CarrollMethod is being used. Minor, but seems reasonable, esp for a large model.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. Make sense.
| // 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added.
| int NumZonesWithUserFbyS = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); | ||
| if (NumZonesWithUserFbyS > 0) { | ||
|
|
||
| GetInputViewFactorsbyName(state, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, see below.
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice to have the duplicate error message gone.
mitchute
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No further comments from me. Tests, regressions, and diffs all look good.

Pull request overview
Pull Request Author
Reviewer