MCPcopy Create free account
hub / github.com/NatLabRockies/OpenStudio / solarRadiationBreakdown

Method solarRadiationBreakdown

src/isomodel/SimModel.cpp:318–425  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

316 }
317 }
318 void SimModel::solarRadiationBreakdown(const Vector& weekdayOccupiedMegaseconds, const Vector& weekdayUnoccupiedMegaseconds,
319 const Vector& weekendOccupiedMegaseconds, const Vector& weekendUnoccupiedMegaseconds,
320 const Vector& clockHourOccupied, const Vector& clockHourUnoccupied, Vector& v_hrs_sun_down_mo,
321 Vector& frac_Pgh_wk_nt, Vector& frac_Pgh_wke_day, Vector& frac_Pgh_wke_nt, Vector& v_Tdbt_nt) const {
322
323 Matrix m_mhEgh = location->weather()->mhEgh();
324 Matrix m_mhdbt = location->weather()->mhdbt();
325
326 // TODO: unreadVariable
327 // Vector v_Tdbt_Day = prod(m_mhdbt, clockHourOccupied);
328 // v_Tdbt_Day /= sum(clockHourOccupied);
329
330 v_Tdbt_nt = prod(m_mhdbt, clockHourUnoccupied);
331 v_Tdbt_nt /= sum(clockHourUnoccupied);
332
333 Vector v_Egh_day = prod(m_mhEgh, clockHourOccupied);
334 v_Egh_day /= sum(clockHourOccupied);
335
336 Vector v_Egh_nt = prod(m_mhEgh, clockHourUnoccupied);
337 v_Egh_nt /= sum(clockHourUnoccupied);
338 /**
339v_mdbt=W.mdbt; % copy to a new variable so vector nature is clear
340M_mhdbt=W.mhdbt; % copy to a new variable so matrix nature is clear
341M_mhEgh=W.mhEgh; % copy to a new variable so matrix nature is clear
342
343% Note, these are matrix multiplies (matrix*vector) resulting in a vector
344v_Tdbt_day=(M_mhdbt*v_day_hrs_yesno)./sum(v_day_hrs_yesno); %monthly average dry bulb temp (dbt) during the occupied hours of days
345v_Tdbt_nt=(M_mhdbt*v_nt_hrs_yesno)./sum(v_nt_hrs_yesno); %monthly avg dbt during the unoccupied hours of days
346
347v_Egh_day=(M_mhEgh*v_day_hrs_yesno)./sum(v_day_hrs_yesno); %monthly avg global horiz rad power (Egh) during the "day" hours
348v_Egh_nt=(M_mhEgh*v_nt_hrs_yesno)./sum(v_nt_hrs_yesno); %monthly avg Egh during the "night" hours
349*/
350
351 Vector v_Wgh_wk_day = mult(v_Egh_day, weekdayOccupiedMegaseconds);
352 Vector v_Wgh_wk_nt = mult(v_Egh_nt, weekdayUnoccupiedMegaseconds);
353 Vector v_Wgh_wke_day = mult(v_Egh_day, weekendOccupiedMegaseconds);
354 Vector v_Wgh_wke_nt = mult(v_Egh_nt, weekendUnoccupiedMegaseconds);
355 Vector v_Wgh_tot = sum(sum(v_Wgh_wk_day, v_Wgh_wk_nt), sum(v_Wgh_wke_day, v_Wgh_wke_nt));
356 /**
357v_Wgh_wk_day=v_Egh_day.*v_Msec_wk_day; % monthly avg Egh energy (Wgh) during the week days
358v_Wgh_wk_nt=v_Egh_nt.*v_Msec_wk_nt; %monthly avg Wgh during week nights
359v_Wgh_wke_day=v_Egh_day.*v_Msec_wke_day; %monthly avg Wgh during weekend days
360v_Wgh_wke_nt=v_Egh_nt.*v_Msec_wke_nt; %monthly avg Wgh during weekend nights
361v_Wgh_tot=v_Wgh_wk_day+v_Wgh_wk_nt+v_Wgh_wke_day+v_Wgh_wke_nt; %Egh_avg_total MJ/m2
362*/
363 frac_Pgh_wk_nt = div(v_Wgh_wk_nt, v_Wgh_tot);
364 frac_Pgh_wke_day = div(v_Wgh_wke_day, v_Wgh_tot);
365 frac_Pgh_wke_nt = div(v_Wgh_wke_nt, v_Wgh_tot);
366 /**
367
368%FRAC_PGH_DAYTIME=v_Wgh_wk_day./v_Wgh_tot; %frac_Egh_occ
369frac_Pgh_wk_nt=v_Wgh_wk_nt./v_Wgh_tot; %frac_Egh_unocc_weekday_night
370frac_Pgh_wke_day=v_Wgh_wke_day./v_Wgh_tot; %frac_Egh_unocc_weekend_day
371frac_Pgh_wke_nt=v_Wgh_wke_nt./v_Wgh_tot; %frac_Egh_unocc_weekend_night
372*/
373 Vector v_frac_hrs_sun_down = Vector(12);
374 Vector v_frac_hrs_sun_up = Vector(12);
375 // TODO: unreadVariable

Callers

nothing calls this directly

Calls 6

prodFunction · 0.85
multFunction · 0.85
divFunction · 0.85
weatherMethod · 0.80
sumFunction · 0.70
sizeMethod · 0.45

Tested by

no test coverage detected