Skip to content

Commit

Permalink
Merge pull request #485 from cse-sim/descond-solar
Browse files Browse the repository at this point in the history
Bug fix: ASHRAE clear sky model (used in DESCOND)
  • Loading branch information
nealkruis authored Apr 30, 2024
2 parents edf2a20 + ff97db4 commit af488cb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/cgwthr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -628,8 +628,8 @@ RC DESCOND::dc_CheckFixSolar(
else
{ float ebn, edh;
/*float egl =*/ slASHRAETauModel(sunZen, dc_tauB, dc_tauD, ebn, edh);
if (frDiff( ebn, dc_ebnSlrNoon) > .01f
|| frDiff( edh, dc_edhSlrNoon) > .01f)
if (frDiff( ebn, dc_ebnSlrNoon) > .001f
|| frDiff( edh, dc_edhSlrNoon) > .001f)
oWarn( "ebn/edh mismatch");
}
#endif
Expand Down
4 changes: 2 additions & 2 deletions src/solar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1053,8 +1053,8 @@ static bool slASHRAETauModelInv( // derive tauB/tauD from irradiance
// calculate Jacobian
double Jbb = 1.0 / tauB + logm * (-0.406 + 0.021 * tauD);
double Jbd = logm * (-0.268 + 0.021 * tauB);
double Jdb = logm * (+0.205 - 0.190 * tauD);
double Jdd = 1.0 / tauD + logm * (-0.080 - 0.190 * tauB);
double Jdb = logm * (+0.205 - 0.190 * tauD);

// solve system {-F} = [J]{dtau} using Cramer's rule
double detJ = Jbb * Jdd - Jdb * Jbd;
Expand Down Expand Up @@ -2849,7 +2849,7 @@ float ASHRAETauModel( // ASHRAE "tau" clear sky model
double ab,ad;
if (options & 1)
{ // 2013 form
ab = 1.454 - 0.406*tauB - 0.268*tauD - 0.021*tauB*tauD;
ab = 1.454 - 0.406*tauB - 0.268*tauD + 0.021*tauB*tauD;
ad = 0.507 + 0.205*tauB - 0.080*tauD - 0.190*tauB*tauD;
}
else
Expand Down

0 comments on commit af488cb

Please sign in to comment.