MSPT design point w/ field layout design selected#976
Merged
Conversation
…ield and tower inputs in SAM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem: When one of the "optimize field" boxes is checked on the MSPT Solar Field page, design point calculations fail and the blue boxes display -789
Background: The MSPT model defines all calculated values by calling the cmod in “design point mode”, designated by cmod input sim_type = 2. The point of the checkboxes is to run the layout routines during the annual simulation, not before (otherwise, the user would just click the macro options). However, that means that the design point that the model will calculate at the beginning of the annual simulation doesn’t exist yet. In the current code, the cmod design-point routine will skip the heliostat field layout, which results in a crash downstream because subsequent design point calculations want these values defined.
Solution:
I think it’s clear we don’t want to call the layout model in these scenarios. This pull request checks if 1) the cmod is being called in design point mode and 2) one of the layout options is selected. If both are true, then the design-point code acts as if the layout boxes are not selected, and it uses the field layout (and possible tower/receiver dimensions) from the UI. This resolves the issue below, albeit with a “fake” design point. This solution adds logic to the cmod that we can’t capture through the “required_if” restrictions on the field layout and tower dimensions inputs in the cmod, but that downside is probably worth it to fix the design point crash.