Module Shading
SolarFarmer has two models for calculating the near shading -- a simple sheds model that considers row-to-row shading as if the rows are infinitely long and an advanced model that takes into account all objects that cause near shading, including 3D shading objects.
Simple model
The model is based on the infinite sheds model in PVsyst. This was adjusted slightly so support system azimuths not pointing directly south/north and sites located in both hemispheres.
Beam shading
We can compute the projected sun shade angle as:
$$\tan \phi = \frac{\cos\left( \gamma_\text{s} - \gamma \right) \sin \theta_\text{z}}{\cos\theta_\text{z}}$$
The position of the shade line measured from the bottom of the rack relative to the total height of the rack is
$$F_{x} = \max\left( 0, \min \left( 1 - \frac{1}{\GCR \left( \cos\beta - \sin\beta \tan\phi \right)}, 1 \right) \right)$$
This is equivalent to the proportion of the rack that is shaded from the direct irradiance.
The absolute height of the shade line, \(H_\text{s}\) measured from the bottom of the rack is given as follows:
$$H_\text{s} = F_{x} H$$
Where \(H\) is the height of the rack in meters.
Sky Diffuse Shading
Given some point located a distance \(H_x\) from the bottom edge of one row (the "current" row), the angle to the top of the row immediately ahead of the current row (toward the equator) may be denoted as \(\psi_\text{t}\). This angle may be computed as (\(P\) is the pitch in the layout region):
$$\tan\psi_\text{t}(H_x) = \frac{ \left(H - H_x \right) \sin \beta}{ \left(H - H_x \right) \cos \beta - P}$$
Integrating a constant (isotropic irradiance) over a slice of a sphere from \(\psi_\text{t} - \beta\) to \(\pi - \beta\), we get a shading factor
$$F_\text{sky,dif,t} \left( H_x \right) = \frac{1 - \cos \left( \psi_\text{t} \left( H_x \right) - \beta \right)} {1 - \cos \left( \pi - \beta \right)}$$
If we consider the \(F_\text{sky,dif,t}\) shading be roughly linear between 0 and \(H_\text{s}\) for the diffuse-only area, then we can simply take the mean of the shading factors at the top and bottom of the shaded strip as an estimate for the shaded strip:
$$F_\text{sky,dif,s} = \left( F_\text{sky,dif,t} \left( H_\text{s} \right) + F_\text{sky,dif,t} \left( 0 \right) \right) / {2}$$
Similarly, for the unshaded strip from \(H_\text{s}\) and \(H\), we can take the mean of the shading factors at the top and bottom of the unshaded strip as an estimate for the whole unshaded strip:
$$F_\text{sky,dif,u} = \left( 1 + F_\text{sky,dif,t}\left( H_\text{s} \right) \right)/2$$
The overall shading factor for the sky diffuse irradiance is then simply the average of the factors for the shaded and unshaded strip. This is assumed for all the racks in a layout region that are not in a front row.
$$F_\text{sky,dif} = \left( F_\text{sky,dif,u} + F_\text{sky,dif,s} \right)/2$$
Ground diffuse shading
Ground Shading
The bright strip visible on the ground from the current row cast from the row ahead may fall under the closest visible point on the ground. In such a case the ground illumination due to the row-to-row space immediately in front of the current row will not be visible to the front side of the current row.
On average, the fraction of ground that is illuminated (unshaded) is
$$F_\text{gnd,illum} = 1 - \min\left( 1, \GCR \ \left| \cos \beta - \sin \beta \tan \phi \right| \ \right)$$
Note: Left and right vertical bars around \( \left| \cos \beta - \sin \beta \tan \phi \right| \) indicate the absolute value which is always positive.
Ground Obscuration
Looking toward the horizon from the top of the row, the row ahead obscures some of the diffuse irradiance reflection of irradiance off the ground. Viewed from the bottom of the row, the rows ahead only affect ground diffuse by shading of the ground as discussed in the previous section (the row ahead only obscures sky irradiance at that point).
At the top edge of the current row, some fraction of the ground is obscured by the row ahead. Returning to the point located a distance of \(H_x\) from the bottom edge of one row (the "current" row), the angle to the bottom of the row immediately ahead of the current row (toward the equator) may be denoted as \(\psi_\text{b}\). This angle may be computed using:
$$\tan\psi_\text{b} \left( H_x \right) = \frac{-H_x \sin \beta}{ - \left( P + H_x \cos \beta \right)}$$
Integrating a constant (isotropic irradiance) resolved by cosine of incidence angle over a slice of a hemisphere of visible directions (the slice from \(\psi_\text{b} - \beta\) to \(\pi\) is not blocked within the slice from \(\pi - \beta\) to \(\pi\)) we get a shading factor for the ground (reflected) diffuse irradiance,
$$F_\text{gnd,dif,b} \left( H_x \right) = \frac{1 + \cos \left( \psi_\text{b} \left( H_x \right) - \beta \right)} {1 + \cos \left( \pi - \beta \right)}$$
The shading factor for the diffuse from the ground reaching the shaded strip on the row is:
$$F_\text{gnd,dif,s} = \left( F_\text{gnd,illum} \left( 1 - \delta f \right) + \delta f \right) \left( F_\text{gnd,dif,b} \left( H_\text{s} \right) + 1 \right)/2$$
where \(\delta f\) is the (horizontal) diffuse fraction, \(\delta f = \frac{\DHI}{\GHI}\).
The shading factor for the diffuse from the ground reaching the unshaded strip on the row is:
$$F_\text{gnd,dif,u} = \left( F_\text{gnd,illum} \left( 1 - \delta f \right) + \delta f \right) \left( F_\text{gnd,dif,b} \left( H_\text{s} \right) + F_\text{gnd,dif,b} \left( H \right) \right)/2$$
The overall shading factor for the sky diffuse irradiance is then simply the average of the factors for the shaded and unshaded strip. This is assumed for all the racks in a layout region that are not in a front row.
$$F_\text{gnd,dif} = \left( F_\text{gnd,dif,u} + F_\text{gnd,dif,s} \right)/2$$
Full shading model
The model is based on a hemicube model where the scene (terrain, racks, shading obstacles) is rendered for each shading target point on the modules.
The sky, horizon, terrain and shading objects (racks or 3D shading obstacles) are rendered to determine beam shading as well as shading for the sky and ground diffuse irradiance. As the hemicube model does not consider how much of the ground is shaded by racks in front, the method from the simple sheds model is used to adjust the ground diffuse shading.
Precalculations
The following are calculated once after any changes to the layout or surroundings:
horizon lines for each target point in the array
% diffuse shading factor for each target point, then average across each submodule.
At each timestep
For each target point, first check if sun is below horizon, then check if target can see the sun. If the target is shaded, then the beam irradiance incident around the target is zero.
For each submodule SolarFarmer calculates the percent of the area shaded based on number of shaded target points. When positioning target points for the shading calculation, the inactive border of each module should be considered, i.e. position points in the active area only. Then SolarFarmer determines the percent shading of the most shaded cell in each submodule for Module Performance Model.