From f53113f02ea5369e50bd33232db3d2b48f64cc1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Constantin=20Ri=C3=9F?= Date: Sun, 7 Feb 2010 16:52:50 +0100 Subject: =?UTF-8?q?Cuboid=20nicht=20ben=E4tigt=20und=20NOTNEEDED=20ordner?= =?UTF-8?q?=20hinzugef=FCgt=20und=20Fehler=20behoben?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- House.cpp | 44 ++++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 20 deletions(-) (limited to 'House.cpp') diff --git a/House.cpp b/House.cpp index bf1724c..dca8d44 100644 --- a/House.cpp +++ b/House.cpp @@ -442,23 +442,26 @@ float x=0; // end; void House::calccollectoroutput(int day, int time, int month) { - if(collectorstatus == TRANSVERSAL) - collectoroutput = efficiencyvacuum[(int)(collectortemp-tempoutside[month][time]+0.5)] - *anglecorrectiontransversal[(int)(fabs(sun.azimutangle(day, time)/2)+0.5)] - *anglecorrectionlongitudinal[(int)(fabs(roofangle-sun.elevationangle(day, time))+0.5)] - /**100*/; - else if(collectorstatus == LONGITUDINAL) - collectoroutput = efficiencyvacuum[(int)(collectortemp-tempoutside[month][time]+0.5)] - *anglecorrectionlongitudinal[(int)(fabs(sun.azimutangle(day, time)/2)+0.5)] - *anglecorrectiontransversal[(int)(fabs(roofangle-sun.elevationangle(day, time))+0.5)] - /**100*/; - else if(collectorstatus == FLAT) - collectoroutput = efficiencyflat[(int)(collectortemp-tempoutside[month][time]+0.5)] - *anglecorrectionflat[(int)(fabs(sun.azimutangle(day, time)/2)+0.5)] - *anglecorrectionflat[(int)(fabs(roofangle-sun.elevationangle(day, time))+0.5)] - /**100*/; - - collectoroutput = collectoroutput*collectorarea*radiation; + if(sun.elevationangle(day, time) >= 0){ + if(collectorstatus == TRANSVERSAL) + collectoroutput = efficiencyvacuum[(int)(collectortemp-tempoutside[month][time]+0.5)] + *anglecorrectiontransversal[(int)(fabs(sun.azimutangle(day, time)/2)+0.5)] + *anglecorrectionlongitudinal[(int)(fabs(roofangle-sun.elevationangle(day, time))+0.5)] + /**100*/; + else if(collectorstatus == LONGITUDINAL) + collectoroutput = efficiencyvacuum[(int)(collectortemp-tempoutside[month][time]+0.5)] + *anglecorrectionlongitudinal[(int)(fabs(sun.azimutangle(day, time)/2)+0.5)] + *anglecorrectiontransversal[(int)(fabs(roofangle-sun.elevationangle(day, time))+0.5)] + /**100*/; + else if(collectorstatus == FLAT) + collectoroutput = efficiencyflat[(int)(collectortemp-tempoutside[month][time]+0.5)] + *anglecorrectionflat[(int)(fabs(sun.azimutangle(day, time)/2)+0.5)] + *anglecorrectionflat[(int)(fabs(roofangle-sun.elevationangle(day, time))+0.5)] + /**100*/; + + collectoroutput = collectoroutput*collectorarea*radiation; + } + else collectoroutput = 0; } void House::calcprobeinput(int day, int time, int month) { @@ -468,12 +471,13 @@ void House::calcprobeinput(int day, int time, int month) { if(E>=collectoroutput && collectoroutput>0) {E -= collectoroutput; collectoroutput=0;} else if(E0) {collectoroutput -= E; E=0;}*/ calccollectoroutput(day, time, month); - std::cout << collectoroutput << std::endl; + std::cerr << "Time: " << time << " Output: " << collectoroutput << " Watt" << std::endl; +// std::cerr << sun.elevationangle(day, time) << std::endl; collectoroutput-=neededenergy[month][time]; } void House::controller(){ - static int day=90, time=0, month=0; + static int day=0, time=0, month=0; calcprobeinput(day, time, month); temp.setprobetemp(collectortemp); temp.setinput(collectoroutput); @@ -481,7 +485,7 @@ void House::controller(){ ++time; if(time > 23){ -// std::cerr << day << " " << temp.getaverage() << std::endl; + std::cerr << day << " " << temp.getaverage() << std::endl; time = 0; ++day; } -- cgit v1.2.3