bigladder / kiva

Ground heat transfer calculation tool
BSD 3-Clause "New" or "Revised" License
25 stars 8 forks source link

Error in eSky calculation WeatherData.cpp #53

Closed ckm47 closed 1 year ago

ckm47 commented 2 years ago

If Kiva uses the Clark and Allen + Walton Eplus implementation then I believe line 212 of src/kiva/WeatherData.cpp should be

double eSky = 0.787 + 0.764 * log(Tdp / 273) * (1 + 0.0224 * fc - 0.0035 * pow(fc, 2) + 0.00028 * pow(fc, 3));

Instead of

double eSky = 0.787 + 0.764 * log(Tdp / Tdb) * (1 + 0.0224 * fc - 0.0035 * pow(fc, 2) + 0.00028 * pow(fc, 3));

nealkruis commented 2 years ago

Good catch! It must have come from a misinterpretation of the old code in EnergyPlus:

ESky = (0.787 + 0.764 * std::log(TDewK / TKelvin)) * (1.0 + 0.0224 * OSky - 0.0035 * pow_2(OSky) + 0.00028 * pow_3(OSky));

shorowit commented 1 year ago

@nealkruis Was this fixed in https://github.com/bigladder/kiva/pull/58? Should it be closed?

nealkruis commented 1 year ago

Indeed! Thanks, @shorowit!