Skip to content

Commit

Permalink
Fix typo in ASHRAE clear sky model (ASHRAETauModel())
Browse files Browse the repository at this point in the history
  • Loading branch information
chipbarnaby committed Apr 29, 2024
1 parent 49c5176 commit ff97db4
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 @@ -1039,7 +1039,7 @@ static bool slASHRAETauModelInv( // derive tauB/tauD from irradiance
tauD = 1.5;

bool bConverge = false;
for (int iT = 0; iT < 20 /*&& !bConverge*/; iT++)
for (int iT = 0; iT < 20 && !bConverge; iT++)
{ // update ab & ad
double ab = 1.454 - 0.406 * tauB - 0.268 * tauD + 0.021 * tauB * tauD;
double ad = 0.507 + 0.205 * tauB - 0.080 * tauD - 0.190 * tauB * tauD;
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 ff97db4

Please sign in to comment.