Initial Commit
[HECS.git] / SpaceHeating.cpp
blob357b1bf1404aac3d1d6e3d9a7de2894a5bcb58a6
1 /***************************************************************************
2 * *
3 * SpaceHeating.cpp Copyright (C) 2008 by Jon Rumble *
4 * j.w.rumble@reading.ac.uk *
5 * *
6 * *
7 * This file is part of HECS, *
8 * *
9 * HECS is free software: you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation, either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 * *
15 * HECS is distributed in the hope that it will be useful, *
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
18 * GNU General Public License for more details. *
19 * *
20 * You should have received a copy of the GNU General Public License *
21 * along with this program. If not, see <http://www.gnu.org/licenses/>. *
22 ***************************************************************************/
25 #include "SpaceHeating.h"
28 SpaceHeating::SpaceHeating (const ConfigParser& config, Gains *gains)
30 cf = config;
31 ptrGains = gains;
32 initVars();
33 calcAll();
36 SpaceHeating::~SpaceHeating () { }
38 void SpaceHeating::calcAll()
40 calcSpaceHeatingFuelMain();
41 calcSpaceHeatingFuelSec();
45 void SpaceHeating::initVars()
47 m_fracHeatFromSecondary = cf.getValueDouble("EnergyRequirements:fracHeatFromSecondary");
48 m_effcyMainHeatingSys = cf.getValueInt("EnergyRequirements:effcyMainHeatingSys");
49 m_effcySecondaryHeatingSystem = cf.getValueInt("EnergyRequirements:effcySecondaryHeatingSystem");
50 m_spaceHeatingFuelMainReq = cf.getValueDouble("EnergyRequirements:spaceHeatingFuelMainReq");
51 m_spaceHeatingFuelSecondary = cf.getValueDouble("EnergyRequirements:spaceHeatingFuelMainSecondary");
55 void SpaceHeating::calcSpaceHeatingFuelMain()
57 m_spaceHeatingFuelMainReq = (1 - m_fracHeatFromSecondary) *
58 ptrGains->getSpaceHeatingReq() *
59 100 /
60 m_effcyMainHeatingSys;
63 void SpaceHeating::calcSpaceHeatingFuelSec()
65 m_spaceHeatingFuelSecondary = m_fracHeatFromSecondary *
66 ptrGains->getSpaceHeatingReq() *
67 100 /
68 m_effcySecondaryHeatingSystem;
71 void SpaceHeating::setFracHeatFromSecondary ( double val_in ) {
72 m_fracHeatFromSecondary = val_in;
76 double SpaceHeating::getFracHeatFromSecondary ( ) {
77 return m_fracHeatFromSecondary;
81 void SpaceHeating::setEffcyMainHeatingSys ( int val_in ) {
82 m_effcyMainHeatingSys = val_in;
86 int SpaceHeating::getEffcyMainHeatingSys ( ) {
87 return m_effcyMainHeatingSys;
91 void SpaceHeating::setEffcySecondaryHeatingSystem ( int val_in ) {
92 m_effcySecondaryHeatingSystem = val_in;
96 int SpaceHeating::getEffcySecondaryHeatingSystem ( ) {
97 return m_effcySecondaryHeatingSystem;
101 void SpaceHeating::setSpaceHeatingFuelMainReq ( double val_in ) {
102 m_spaceHeatingFuelMainReq = val_in;
106 double SpaceHeating::getSpaceHeatingFuelMainReq ( ) {
107 return m_spaceHeatingFuelMainReq;
111 void SpaceHeating::setSpaceHeatingFuelSecondary ( double val_in ) {
112 m_spaceHeatingFuelSecondary = val_in;
116 double SpaceHeating::getSpaceHeatingFuelSecondary ( ) {
117 return m_spaceHeatingFuelSecondary;
119 // END OF SpaceHeating.cpp