Add marion_diffuse_tracking, to be used instead of marion_diffuse for vector surface_tilt inputs - #2824
Add marion_diffuse_tracking, to be used instead of marion_diffuse for vector surface_tilt inputs#2824cbcrespo wants to merge 2 commits into
marion_diffuse_tracking, to be used instead of marion_diffuse for vector surface_tilt inputs#2824Conversation
|
kudos to @kandersolar for raising the issue and everyone else who contributed to the conceptualization of this. was now thinking that neither me and @cbcrespo have never modelled bifacial, and we have no idea how IAM is calculated for that (not even sure if
likely it's not as simple as this.... |
I wonder if @shirubana is available to comment on this as bifacial PV is one of her many areas of expertise |
docs/sphinx/source/referencefor API changes.docs/sphinx/source/whatsnewfor all changes. Includes link to the GitHub Issue with:issue:`num`or this Pull Request with:pull:`num`. Includes contributor name and/or GitHub username (link with:ghuser:`user`).remote-data) and Milestone are assigned to the Pull Request and linked Issue.As noted in #1402,
marion_diffuseuses too much memory (and takes a long time) when thesurface_tiltinput is a vector, which occurs for trackers.marion_diffusecallsmarion_integratefor eachsurface_tiltand each region (sky, horizon or ground).marion_integrateintegrates over a solid angle for each of those. @cwhanse, @markcampanelli, @adriesse, @kdebrab and others discussed how this issue could be circumvented via interpolation.This PR proposes a solution via a new function called
marion_diffuse_tracking, to be used instead ofmarion_diffusefor trackers.marion_diffuse_trackingcreates vectors of 0-90 or 0-180º (for bifacial arrays) with a 0.5º step,marion_integrateis called for each angle in that vector and each region only once, and the results are used to create an interpolator function (usingscipy.interpolate.PchipInterpolator). This interpolator is then used to obtain an IAM value for each value insurface_tilt.Regardless of the length of
surface_tilt,marion_integrateis called a fixed number of times, helping to contain the computational burden.In addition, the interpolation is cached, meaning that e.g. for a
PVSystemobject with multiple trackerArrays which have identical tilt vectors, the interpolator will only have to be created once for each region.More details on time and memory savings, as well as deviation, here. For one example for a 8760-length vector,
marion_diffuse_trackinguses 4% of the max memory and 2% of the time ofmarion_diffuse.