| 1872 | } |
| 1873 | |
| 1874 | void SimModel::heatedWater(Vector& v_Q_dhw_elec, Vector& v_Q_dhw_gas) const { |
| 1875 | double n_dhw_tset = 60; // % water temperature set point (C) |
| 1876 | double n_dhw_tsupply = 20; //% water initial temp (C) |
| 1877 | double n_CP_h20 = 4.18; //% specific heat of water in MJ/m3/K |
| 1878 | Vector v_Q_dhw_solar(12); |
| 1879 | zero(v_Q_dhw_solar); //Q from solar energy hot water collectors - not included yet |
| 1880 | double Q_dhw_yr = heating->hotWaterDemand() * (n_dhw_tset - n_dhw_tsupply) * n_CP_h20; |
| 1881 | |
| 1882 | /*%% DHW and Solar Water Heating |
| 1883 | % |
| 1884 | % Qdhw= ((Qdem;DWH/?sys;DHW) - Qses;DHW)/?gen;DHW |
| 1885 | % Source: NEN 2916 12.2 |
| 1886 | |
| 1887 | n_dhw_tset = 60; % water temperature set point (C) |
| 1888 | n_dhw_tsupply = 20; % water initial temp (C) |
| 1889 | n_CP_h20=4.18; % specific heat of water in MJ/m3/K |
| 1890 | |
| 1891 | %solar hot water heating contribution |
| 1892 | %D738 =0; % solar collector surface area |
| 1893 | v_Q_dhw_solar =zeros(12,1); % Q from solar energy hot water collectors - not included yet |
| 1894 | |
| 1895 | |
| 1896 | Q_dhw_yr = In.DHW_demand*(n_dhw_tset-n_dhw_tsupply).*n_CP_h20; % total annual energy required for heating DHW MJ/yr |
| 1897 | |
| 1898 | % n_dhw_dist_eff_table=[1 0.8 0.6]; % all taps < 3m from gen = 1, taps> 3m = 0.8, circulation or unknown =0.6 |
| 1899 | % %eta_dhw_dist = n_dhw_dist_eff_table(In.DHW_dist_sys_type); % set the distribution efficiency from table |
| 1900 | % |
| 1901 | % eta_dhw_dist = In.DHW_dist_eff; % DHW distribtuion efficiency |
| 1902 | % eta_dhw_sys = In.DHW_sys_eff; % DHW system efficiency |
| 1903 | |
| 1904 | |
| 1905 | */ |
| 1906 | Vector v_MonthlyDemand = mult(daysInMonth, Q_dhw_yr, 12); |
| 1907 | Vector v_frac_MonthlyDemand_yr = div(v_MonthlyDemand, daysInYear); |
| 1908 | Vector v_Qe_demand = div(v_frac_MonthlyDemand_yr, heating->hotWaterDistributionEfficiency()); |
| 1909 | Vector v_Q_dhw_demand = div(v_Qe_demand, kWh2MJ); |
| 1910 | Vector v_Q_dhw_need = maximum(div(dif(v_Q_dhw_demand, v_Q_dhw_solar), heating->hotWaterSystemEfficiency()), 0); |
| 1911 | Vector Z(v_Q_dhw_need.size()); |
| 1912 | printVector("v_MonthlyDemand", v_MonthlyDemand); |
| 1913 | printVector("v_frac_MonthlyDemand_yr", v_frac_MonthlyDemand_yr); |
| 1914 | printVector("v_Qe_demand", v_Qe_demand); |
| 1915 | printVector("v_Q_dhw_demand", v_Q_dhw_demand); |
| 1916 | printVector("v_Q_dhw_need", v_Q_dhw_need); |
| 1917 | zero(Z); |
| 1918 | printVector("Z", Z); |
| 1919 | |
| 1920 | if (heating->hotWaterEnergyType() == 1) { |
| 1921 | v_Q_dhw_elec = v_Q_dhw_need; |
| 1922 | v_Q_dhw_gas = Z; |
| 1923 | } else { |
| 1924 | v_Q_dhw_gas = v_Q_dhw_need; |
| 1925 | v_Q_dhw_elec = Z; |
| 1926 | } |
| 1927 | printVector("v_Q_dhw_gas", v_Q_dhw_gas); |
| 1928 | printVector("v_Q_dhw_elec", v_Q_dhw_elec); |
| 1929 | |
| 1930 | /* |
| 1931 | v_Q_dhw_demand = Q_dhw_yr.*v_days_ina_mo./days_ina_year./In.DHW_dist_eff/kWh2MJ; % monthly DHW energy demand including distribution inefficiency |
nothing calls this directly
no test coverage detected