scieee AI-readable full text Open interactive document viewer

Solar thermal energy installation for student tutorial: Implementation of hot water load, acquisition and measurements, software interface for supervision.

Rovira Cladera, Magín

Abstract

Practical education is a powerful tool that can be used to complete the education of future engineers. The aim of this thesis is to adapt a standard solar water heater in order to make it able to be used for academic uses. As its use won’t be the usual one, and it’s wanted to observe the operation of the system, it will be necessary to monitor the significant variables and to design a load for the system. The load must cool the system in one way or another to close the cycle. Those values that become impossible or difficult to measure could be simulated.

Full text

Solar thermal energy installation for student tutorial: Implementation of hot water load, acquisition and measurements, software interface for supervision. Magín Rovira Cladera July 2012 Supervisors: Mr. Damien Paire Mr. David Bouquain Université de technologie Belfort-Montbéliard Département Énergie et Environnement (EE) Overview The present document represents the Master Thesis I need to complete in order to finish my studies of Industrial Engineering in thermoenergetic specialization by the Polytechnic University of Catalonia (UPC). The objective of this thesis is to design a load for a solar thermal energy installation. And propose some software and uses of the system for a student tutorial. By realizing such a transversal Master Thesis I had the chance to learn a lot about some subjects (Astronomy, electronics, thermodynamics, computer science, energetics) but also about the tools I had to use. It has been a real challenge for me to deal with it with de added incentive of foreign languages. I would like to thank Ms Cofield-Ilhe for its constant and diligent support with bureaucracy. Thanks to my supervisor Mr. Bouquain and specially to Mr. Damien Paire for its support and its respect for my way of working during the last semester in UTBM. I would like to thank also my mother and sister that, in their own ways, have supported me both economical and moral ways. Lastly, I would like to thank my friends, the old ones in the distance, and the new ones I met in France, for their absolute support that encouraged me to do that work. This work would be nothing without you. Table of contents 1. Objectives...................................................................................................1 2. Introduction................................................................................................2 2.1. Introduction to solar energy...................................................................................................2 2.2. Low temperature solar water heating system........................................................................4 2.2.1. Close-coupled thermosiphon solar water heater...........................................................4 2.2.2. Pump-circulated solar water heater...............................................................................4 2.2.3. Use of antifreeze fluids..................................................................................................5 2.2.4. Additional heating..........................................................................................................5 3. System owned by UTBM...........................................................................7 3.1. Flat panels............................................................................................................................7 3.2 Tank.......................................................................................................................................9 3.3. Operation............................................................................................................................10 3.3.1. Becoming operational..................................................................................................10 3.3.2. Auto-calibration phase.................................................................................................10 3.3.3. Standard operation......................................................................................................10 3.3.4. Security protocols........................................................................................................11 4. Sun ...........................................................................................................12 4.1. Importance of panel situation and facing.............................................................................12 4.2. Solar movement..................................................................................................................14 4.2.1. Azimuth and altitude ..................................................................................................14 4.2.1.1. Azimuth................................................................................................................14 4.2.1.2. Altitude.................................................................................................................15 4.2.1.3. Sun path..............................................................................................................15 4.2.2. Movement seen from the north hemisphere................................................................15 4.3. Optimal panel orientation....................................................................................................17 5. Load...........................................................................................................18 5.1. Why a load is needed?.......................................................................................................18 5.2. Load alternatives.................................................................................................................19 5.2.1. Throw hot water away.................................................................................................19 5.2.2. Cool the coolant..........................................................................................................19 5.2.3. Cool water...................................................................................................................20 5.2.4. Cover solar panels......................................................................................................20 5.2.5. Use hot water..............................................................................................................20 5.3. Alternatives criteria..............................................................................................................21 5.4. Alternative election..............................................................................................................22 5.4.1. Cooling coolant or water..............................................................................................22 5.4.2. Throw hot water away.................................................................................................22 5.4.3. Cover solar panels......................................................................................................22 5.4.4. Use hot water..............................................................................................................22 5.5. Load design........................................................................................................................24 6. Acquisition and measurements..............................................................26 6.1. Measurements....................................................................................................................26 6.1.1. Measurements given by the original system................................................................26 6.1.2. Energy balance...........................................................................................................26 6.2. Acquisition: Needed meters................................................................................................28 6.3. Equations............................................................................................................................30 6.3.1. Energy balances and equations..................................................................................30 6.3.2. Equation possibilities...................................................................................................30 6.3.2.1. Tank sub-system..................................................................................................31 6.3.2.2. Panel sub-system................................................................................................31 6.3.2.3. Load sub-system.................................................................................................31 7. Simulation software.................................................................................33 7.1. Initial program.....................................................................................................................33 7.2 Adapting the software..........................................................................................................34 7.2.1. Program1....................................................................................................................34 7.2.2. Datecalculus and Program2........................................................................................34 7.2.3. Timecalculus, Program3 and situation.........................................................................35 7.3. Conclusion..........................................................................................................................36 8. References................................................................................................37 9. Appendices...............................................................................................38 9.1. Appendix 1: Programa CARTASOL by Manuel Martín Monroy............................................38 9.2. Appendix 2: Program1 .......................................................................................................39 9.3. Appendix 3: datecalculus and Program2 ............................................................................41 9.3.1. datecalculus code........................................................................................................41 9.3.2. Program2 code............................................................................................................41 9.4. Appendix 4: timecalculus and situation...............................................................................43 9.4.1. timecalculus code........................................................................................................43 9.4.2. situation code..............................................................................................................43 The author declares that the text and work presented in this thesis is original and that no sources other than those mentioned in the text and its references have been used in creating this thesis. The copyright of this thesis lies with the owner. The author is responsible for its contents. UTBM cannot be held responsible for any claims with regard to implementing results of the thesis. Solar thermal energy installation for student tutorial 1. Objectives Practical education is a powerful tool that can be used to complete the education of future engineers. The aim of this thesis is to adapt a standard solar water heater in order to make it able to be used for academic uses. As its use won’t be the usual one, and it’s wanted to observe the operation of the system, it will be necessary to monitor the significant variables and to design a load for the system. The load must cool the system in one way or another to close the cycle. Those values that become impossible or difficult to measure could be simulated. D. Paire M. Rovira 1 Solar thermal energy installation for student tutorial 2. Introduction Solar thermal energy is the one plants, animals and human beings have used since ever for heating themselves when they simply stay in the Sun. Nowadays heat can be stored, transported and concentrated according to the use they are required for. Using solar thermal energy is a very effective way of using solar energy. It is quite commonly used in some countries such as Greece, Turkey, Israel or Austria, specially for domestic uses. 2.1. Introduction to solar energy There are two main sources of energy that human beings are able to use nowadays: ● Nuclear power intrinsic to matter that can be use by fission. ● Solar energy. All the energy received by the Earth comes from the Sun. Although they are not called solar energy, the energy that comes from wind, rivers, fossil fuels or tides are, at last, consequences of the Sun. Besides them there is energy known as solar energy. They are called solar because they suffer less transformations to become useful for us. There is two types of that kind of energy: ● Photovoltaic energy: Transform luminous energy into electric one by using photovoltaic cells. Transformation is done directly in cells and their performance can hardly exceed 20%. ● Solar thermal energy: Collect heat from the sunlight to produce hot water, heat or electrical power. Depend of the reached temperature the system can be classified as: ○ High temperature collectors. Reach over 500 ºC. They need greats amounts of surface. They concentrate sunlight by using mirrors in order to reach high temperatures. They use parabolic dish, parabolic trough, or power tower. ○ Middle temperature collectors. Supply temperatures between 100 and 300 ºC. They also use parabolic trough. D. Paire M. Rovira 2 Solar thermal energy installation for student tutorial ○ Low temperature collectors. Supply temperatures under 65 ºC. They use flat plates to heat flux directly (with no concentration). They are used in some industrial activities (pasteurization, textile cleaning), and for domestic uses as well (domestic hot water, domestic heating or swimming pool heating). In the next pages the study will focus on the low temperature collectors used for heating water, as the thesis is based on one of them. D. Paire M. Rovira 3 Solar thermal energy installation for student tutorial 2.2. Low temperature solar water heating system Solar water heating system's operation is really simple: A group of pipes are arranged into a flat panel, usually south facing. Because of the dark absorber plate under the pipes and the glazing that produce a little greenhouse effect, the water in the pipes become hotter. This water can be stored in a tank waiting for its need. 2.2.1. Close-coupled thermosiphon solar water heater Image 1: Schematic of a “close-coupled” thermosiphon solar water heater and image of a roof-mounted one. In its most simple expression, the close-coupled thermosiphon solar water heater, the tank is situated immediately above the panel. It doesn’t even need a pump because water rises upwards naturally into the tank due a thermosiphon flow (cold water is heavier than hot one. As the water gain temperature it expands and flow up while the cold water replace it because of the gravity). The best quality of this system is its simplicity and so its sturdiness. 2.2.2. Pump-circulated solar water heater From the simplest system there are improvements done in the matter. Renouncing some simplicity, a pump can be added in order to be able to locate the tank vertically below the D. Paire M. Rovira 4 Solar thermal energy installation for student tutorial Standard operation will finish when the tank acquires the reference temperature SX (factory set at 60 ºC, maximum 80 ºC). 3.3.4. Security protocols Security protocols have the aim to protect both tank and panels from overheat. There is a reference temperature (CX, factory set at 100 ºC), panels should not exceed. If it happens, pump will automatically become operational for cooling panels and maintain them this temperature. Pump will work until collector temperatures drops 5 ºC under CX or tank temperature reaches the maximum storage temperature (80 ºC). Once the collectors temperature drops under tank’s one (per example, during the night), tank starts getting cooled until reference temperature (SX). D. Paire M. Rovira 11 Solar thermal energy installation for student tutorial 4. Sun A solar system depends on the availability of solar light. Then is important to know how to maximize received energy. 4.1. Importance of panel situation and facing A solar flat panel will receive the maximum amount of energy when its normal direction points the sun (around 1000 and 1300 W/m2). When that doesn’t happen, the angle between sun’s direction and panel’s normal will determine the energy received. Image 7: Explanation of projection effect Then, received energy is the energy received by a surface perpendicular to sun’s direction (maxim received energy) multiplied by sinus of the angle between sun’s direction and panel’s perpendicular one. D. Paire M. Rovira 12 Solar thermal energy installation for student tutorial When using static panels it’s important to locate them so the sinus (and so the energy received) is the maxim possible after a year (or after a winter day). For that it’s necessary to know how the relative position between Sun and Earth changes. D. Paire M. Rovira 13 Solar thermal energy installation for student tutorial 4.2. Solar movement Solar movement itself is not really complex: Earth moves around the sun describing an elliptical trajectory. Earth also spin over an axis. The difficulty comes because the axis Earth spin around, is not perpendicular to the ellipse described by the Sun. That is the cause of the different seasons and also that sun trajectory saw from Earth is constantly changing all around the year. 4.2.1. Azimuth and altitude In order to understand how is solar movement seen from Earth it’s important to know a two astronomic concepts: Azimuth, altitude and sun paths. 4.2.1.1. Azimuth Azimuth is the angle formed between north direction and the direction of celestial interesting point projected in the horizon. Image 8: Azimuth and altitude schematic D. Paire M. Rovira 14 Solar thermal energy installation for student tutorial 4.2.1.2. Altitude Altitude is the angle formed between a celestial point and the horizon. 4.2.1.3. Sun path Sun path is the trajectory of the sun saw from the Earth. 4.2.2. Movement seen from the north hemisphere Hereafter the text will refer to the north hemisphere. Image 9 shows how the sun path changes during the year. Because of that change the day is longer in summer and shorter in winter, and sun shines more vertical in summer and more tangential in winter. Image 9: Sun paths of the sun according to season. Sun paths depends on the latitude and the date. The closer an observer is to the equator the higher the sun will be in spring and autumn during midday. The higher the sun gets, the longer de day will be. D. Paire M. Rovira 15 Solar thermal energy installation for student tutorial Per example, in Belfort, the longest day have 16 hours of sunlight (21st of June) and the shorter have 8.4 hours (21st December). D. Paire M. Rovira 16 Solar thermal energy installation for student tutorial 4.3. Optimal panel orientation Now we can understand what is the optimal orientation for static panels. In order to optimize the collected energy by static solar panels, its necessary to put the panel so it faces the sun as much as possible. Solar path is always symmetric. There is no significant difference between its east half and west one. That means that the optimal orientation is always south. What is the optimal altitude? It depends on the latitude of the panel. Despite there is an optimal inclination for each day (or season), it is accepted that the optimal one is around 40 and 45 ºC respect the horizontal.. Sometimes it is interesting to increase that inclination a few degrees, so the panel will be configured for winter because there is more energy demand in winter or because energy the system collects more than enough energy in summer. D. Paire M. Rovira 17 Solar thermal energy installation for student tutorial 5. Load Our system have been designed to produce heat water for different domestic uses (heat water or heating). From our system's point of view those uses become loads. In that case, an amount of energy that must be transferred to a water mass. But, as our intention is to use the system in an educational way, we have no standard loads so we need another one. 5.1. Why a load is needed? All systems are made for solving a problem or supporting loads. If there is no load the system won’t work as it have been designed for and it may break. In our case, with no load the system could become overheated or, simply, don't work at all. That could happen because part of the system (solar collectors) is not controlled. Luckily, there are security protocols that will prevent damages in the system. Anyway, for a good study of the system it’s interesting to see how the system works with a real (or as much real as possible) load. D. Paire M. Rovira 18 Solar thermal energy installation for student tutorial 5.2. Load alternatives It's interesting to consider some alternatives before deciding which one is the ideal one. •Throw hot water away •Cool coolant •Cool water •Cover solar panels and wait until the system gets cold. •Use hot water as usual •Use hot water to heat another system There can be more options, more elaborated, more complicated or maybe simpler. And there’s a few alternatives that are easy to reject. But it may be interesting to consider all of them and reject them according to a criteria. In order to decide which alternative could be viable and right for system's needs, let's see a few characteristics of each alternative: 5.2.1. Throw hot water away Removing hot water and replacing it with new cold one, it allows the system to evacuate a lot of energy in few time. That would make the system works in a standard way (the same way that it would work in a domestic use). In addition it would need no additional machinery. The bad point is that it would suppose a great waste of water and so it is a very unsustainable option 5.2.2. Cool the coolant Coolant has lower specific heat than water, so it carries less energy than water. That can allow the cooler to be smaller. Despite that, there are a lot of bad points: The system would have to be dismantled in order to have access to the coolant. It would be complicated and expensive because it would need D. Paire M. Rovira 19 Solar thermal energy installation for student tutorial a lot of new machinery. Or course it would make the system work in a totally different way than usual. It also would make difficult, almost impossible, to determine heat transfers or efficiencies. 5.2.3. Cool water This alternative consists in cooling hot water provided by the system and returning it back to it. It's more sustainable than throwing hot water away because water is reused. It have a higher efficiency in the cooler. And, if cooler is well sized, the system will work as if the system works in its standard. The only bad point is the need of a cooler. 5.2.4. Cover solar panels An easy and simple alternative is to cover solar panels and wait until the system gets cold. It wouldn’t need incoming energy at all. The bad points are the next ones: The system doesn't work in standard conditions because, actually, it doesn't work at all. It needs an initial investment to build another system or machine that have to cover the panels. And it would take a lot of time because the tank is made specially for loosing as few energy as possible. 5.2.5. Use hot water Use hot water consists in use produced hot water to satisfy building's hot water demand. The system would work in standard conditions and it is a sustainable option for it also hot useful water for “free”. The problem is that there would be no control on the system because it is impossible to control hot water's demand. In addition, it would require new equipment (pipes and pumps) to carry the hot water to the building plumbing system. D. Paire M. Rovira 20 Solar thermal energy installation for student tutorial Image 11: Schematic of system's energy balance Losses are difficult to measure so they will be calculated or simulated. That means that we may know by measuring, both the incoming and outgoing energies. To know that values it's necessary to know, for each of the 4 connections, the mass flux and the temperature (as we know the specific heat of their flows, we won't need anything else). D. Paire M. Rovira 27 Solar panels Load Losses Solar thermal energy installation for student tutorial 6.2. Acquisition: Needed meters One may think that we need for each connection a flow meter and a thermometer. Actually it would be good to have them all. But, once more, it wouldn't be a smart engineering answer. Assuming that there are no significant mass losses neither in the load, nor in the solar panels we can take the outgoing and incoming mass (not volume because of the different temperatures may make one of them more dense than the other) flux as equals. It is true that specific heat also changes with temperature and it can be taken into account. But is not actually necessary because the error introduced by not considering the variation of specific heat between water at 10 ºC and water at 90 ºC is less than 0,31%. So we have reduced the number of needed meters from 8 to 6 (2 flow meters and 4 thermometers) with no significant accuracy loose. If it was necessary to minimize even more the expense in meters, we could take two more actions: •To calibrate the pump so we could relate its (known) regime with the flow it gives. It would save just one flow meter, because we need the other one to calibrate the pump and for measure the flow of the load circuit (we don't know the other pump regime). This action is not so good because the relation between pump's regime and its flow may be not constant in time and depends in other unknown factors. This would introduce a significant error so it's better not to do it. •Another action that can save up to three thermometers is to trust the original system (the measures it gives), and accept some hypothesis: ◦Accept that the flux that comes from the panels is at the (known) temperature of the panel sensor (or X ºC under it). ◦Accept that both fluxes that part from the tank are at the temperature shown by the tank sensor. In this case the error of one of the fluxes can compensate a little the error of the other. D. Paire M. Rovira 28 Solar thermal energy installation for student tutorial Image 12: DIEHL Metering flow meter Even if we could measure the error introduced by these actions it is risky to compare measures taken from different kinds of meter. So, for a good measurement, our system needs 2 flow meters and 4 thermometers. In order to collect the data and allow a software to supervise the measures it is necessary that both thermometers and flow meters are electronic and provide some interfaces (par example M-Bus or L-Bus). Once done, a software should be implemented with a few of simple equations. Then, the computer will have all the data and we could know the states of every part of the system. D. Paire M. Rovira 29 Solar thermal energy installation for student tutorial 6.3. Equations We can divide our system in three sub-systems: Panels, tank and load. They all are related by the energy balance done in the tank (already seen in section 6.1.2). 6.3.1. Energy balances and equations Remember: Incoming energy = Outgoing energy + Losses + Stored energy variation In order to be more understandable, we are going to appoint a name to each pipe where we have information such as temperature and flux. Image 13: Numbered schematic of system's energy balance Now, we can say: Incoming power = Flow1 (or2) * Cp1 (or 2) * (T1 – T2); Incoming energy = Incoming power * time Outgoing power = Flow3 (or4) * Cp3 (or4) * (T3 - T 4); Outgoing energy = Outgoing power * time So: Δ Stored energy + Losses = [Flow1 * Cp1 * ΔT1-2 - Flow3 * Cp3 * ΔT3-4] * time 6.3.2. Equation possibilities Now there are a few degrees of freedom because of the unknown variables. But it is not necessary a bad point. A lot of things can be calculated from now. D. Paire M. Rovira 30 Solar panels Load Losses 3 4 1 2 Solar thermal energy installation for student tutorial 6.3.2.1. Tank sub-system If we focus in the tank: •If the gap of time is short enough, we can suppose there is no losses and find out the stored energy variation. Then, per example, we can check out if system's display is right about energy stored in the system or how accurate it is. ◦After a few repetitions, if we think system's display is trustworthy. We can take the value of Δ Stored energy from it in a longer periods, so losses will be more significant and find it out. •If the system works for a while and there is no variation in any parameter, we can say it is in a stable state. That means that Δ Stored energy is 0. So we will be able, again, to find out losses. 6.3.2.2. Panel sub-system In panel's sub-system a balance can be done so: Flow1 * Cp1 * (T1 – T2) = Power received from the panel - pipe losses Energy = Power * time Here we can make a few calculus: •If we trust the supplier handbook, we can accept that optical efficiency is 80% and find out the power that arrives to the panels (taking measures in short space of time so pipe losses ≈ 0): Power arriving to panels * 0.80 = Pipe losses + Flow1 * Cp1 * (T1 – T2) ◦Here we can do the same done in tank's case. After a few similar, and so we suppose they are correct, measures we can use them to calculate pipe losses. •Once we have the Power arriving to panels, we can try yo guess where does it come from. There are two kinds of sun radiation: diffuse and direct. Direct is the one that heat us when we can see the sun. Diffuse is the one that still heating us (much less, but still) when it's cloudy but there is sunlight. So, once we know the power that the sun is giving us, and knowing (thanks to a program explained in the next chapter) the direct radiation that panels would receive in a sunny day, we can determine which amount of energy comes from each type of radiation. ◦After a few calculus, we could even determine if it's cloudy or not in the outside. 6.3.2.3. Load sub-system See the equations already seen for the load: Removed power = Flow3 * Cp3 * (T3 - T 4); D. Paire M. Rovira 31 Solar thermal energy installation for student tutorial Removed energy = Removed power * time In this case we have no distinguished losses. Does it mean that load pipes are well isolated? Absolutely not, but on the contrary they should be as much conductor as possible. The aim of the load is to remove energy, so all the losses become more removed energy and that makes our load a better one. So, in the equation, losses are included in term Removed power. In this case, just assuming that a radiator acts just as a “convector”, we can say that Removed power is equal to heat transferred by convection: Flow3 * Cp3 * (T3 - T 4) = hc * A * (T0 – T∞) Where hc is the convection coefficient. A is the exposed area. And T0 and T∞ are surface temperature and air (room) one. •In this case we will have the value of the term Removed power and we will have to find out the others. ◦Area can be easily measured if the radiator is flat (if not, we will have to look for an acceptable “equivalent area”. ◦Temperatures can be measured by using standard thermometers. ◦And finally we will find out the convection coefficient. If there is time enough the process can be repeated after modifying the load (switching of the fan, the wetting system, or both) to find out other convection coefficients. Probably there are even more possibilities and calculus to do with this system. Here the author tried to point a little but varied group of them, touching a few different topics. D. Paire M. Rovira 32 Solar thermal energy installation for student tutorial 7. Simulation software In a proposed calculus we had assumed that we know the amount of energy that sun gives to our panels. Actually, it's false. We don't know yet how many energy the sun is giving our panels at every moment. Yet. Once the solar movement is understood, we know that we can predict where it will be any day at any time. But, if we have really understood its movement, we may see that this venture is not trivial. 7.1. Initial program I started by understand a program by Manuel M. Monroy for Matlab called Programa CARTASOL (that goes for solar “card” or solar map). This software is a very useful, powerful and simple tool for our objective. CARTASOL1 works the next way: •It ask the user for the latitude and the date that they want to know the sun path. •From latitude, program find out the declination with this equation: DECL = 23,45º * SIN [360 * (DATE-81)/365] ◦This equation is easily to understand, once one have the concept of declination. Declination is the angle between a star (the sun) and the celestial equator. It's maximum is 23,45º in day number 172 (81+ a quarter a year); it's minimum is -23,45º in day number 355 (81+ ¾ a year); it value 0 in days 81 and 263 (81+ half a year). These four days are the solstices and equinoxes. •Then the system divide a hole day in 48 parts of half an hour, and fins out the altitude and azimuth of the sun for each half an hour. •Lastly the program displays all the 48 altitudes and azimuths calculated for this day. This program is really adaptable because it can offer all the information for knowing a sun path for any place in the world. 1CARTASOL code is written in appendix 1. D. Paire M. Rovira 33 Solar thermal energy installation for student tutorial 7.2 Adapting the software After a few uses, one realize that M. Monroy program is too powerful, too big, too generic and a little annoying for users. For every use, the user have to introduce the latitude, calculate the date and introduce it too. The result is a list of 48 pairs of numbers, so the user have to search for the one he/she needs. 7.2.1. Program1 Because of that the author introduced a few changes. •Latitude was fixed for Belfort situation. That makes the program adapted to Belfort. And save time because it doesn't ask the latitude to the user any more. Anyway the latitude can be changed easily by setting up the program. •On the other hand, a new variable was added: TIME. The program still calculating son location for all the day, but it will show just the one asked by the user instead of showing them all. ◦The bad point about that is that, initially, user could ask just for exactly hours or hours and a half. ▪For solving that problem, the program was configured so it interpolates when is necessary. •Interpolation results were compared for different Spanish cities with the Spanish National Astronomical Observatory, and the error was under 1%. •To increase the ergonomics of the program it shows the results in a user-friendly way: “At _ Sun's altitude is: _ and it's azimuth is: _”. •And lastly, if the wanted altitude is negative the program will display “The sun is not visible (Negative altitude)”, instead of giving a negative value, that is useless for our objective. All that changes result in Program11. 7.2.2. Datecalculus and Program2 The writer still think it was a bit annoying and non ergonomic to introduce the date in the asked format. Then little function (datecalculus) was made for solving the problem. 1Program1 code is written in appendix 2. D. Paire M. Rovira 34 Solar thermal energy installation for student tutorial Datecalculus uses the date of the present day to find out the same date in the correct format so Program1 would understand. It is not only a date format transformer but a function. It means it have no inputs so the user won't have to write the date any more. Program1 using function datecalculus1 was called Program22. 7.2.3. Timecalculus, Program3 and situation The last step to was to make one of the most simple function: timecalculus3. This function is similar to datecalculus but it gives the time instead of the date. Despite the simplicity of the function, this step is important. because, added to Program2, the result is a program with no inputs. It don't need any input from the user. This new program was called Program34. But, why do we need a program with no inputs? Exactly, with a few changes Program3 became in a function. Then there were no need any more to be ergonomic because the new function can be used even for other functions or programs. This new functions was called situation5. 1datecalculus code is written in appendix 3. 2Program2 code is written in appendix 3. 3timecalculus code is written in appendix 4. 4Program3 code is NOT written in appendix because is too similar to situation's one. 5situation code is written in appendix 4. D. Paire M. Rovira 35 Solar thermal energy installation for student tutorial 7.3. Conclusion With those programs and functions it's easy to know the position of the sun in every moment. Accepting that direct radiation may be in Belfort around 1000-1100W/m2. The calculus suggested in chapter 6.3.2.2. can be quite accurately done. D. Paire M. Rovira 36 Solar thermal energy installation for student tutorial 9.4. Appendix 4: timecalculus and situation 9.4.1. timecalculus code function TIME = timecalculus (); t=clock; TIME = t(4)+ t(5)/60 + t(6)/3600; 9.4.2. situation code function [a,z] = situation (); DATE = datecalculus; TIME = timecalculus; LAT = 47.64; %Belfort's latitude = 47.64 It can be changed for other locations ASOL = zeros(1, 48); ZSOL = zeros(1, 48); RAD = 2*pi / 360 ; DECL = (23.45 * RAD) * sin(360 * RAD * (DATE - 81) / 365); C1 = sin(LAT * RAD) * sin(DECL); C2 = cos(LAT * RAD) * cos(DECL); for X = 1:1:48 W = (X / 48 * 360 - 180) * RAD; SENASOL = C1 + C2 * cos(W); COSASOL = sqrt(1 - SENASOL ^ 2); ASOL(X) = atan(SENASOL / COSASOL) / RAD; COSZSOL = (sin(LAT * RAD) * SENASOL - sin(DECL)) / (cos(LAT * RAD) * COSASOL); if COSZSOL >= 1 COSZSOL = 1; elseif COSZSOL <= -1 COSZSOL =1; end; SENZSOL = sqrt(1 - COSZSOL ^ 2); ZSOL(X) = 90; %EVITA ERROR if COSZSOL ~= 0 ZSOL(X) = atan(SENZSOL / COSZSOL) / RAD; end if ZSOL(X) < 0 ZSOL(X) = 180 + ZSOL(X); end if W < 0 ZSOL(X) = -ZSOL(X); end D. Paire M. Rovira 43 Solar thermal energy installation for student tutorial end %Now all the azimuths and altitudes of the day are calculated. X = TIME*2; %X is the number of "half hours" if rem(X,1)==0.0; %Time asked is an hour o'clock, or an hour and a half. a= ASOL(X); z= ZSOL(X); else %Interpolation dec = rem(X,1); a1= ASOL(X-rem(X,1)); a2= ASOL(X-rem(X,1)+1); a = a1 + dec*(a2-a1); z1= ZSOL(X-rem(X,1)); z2= ZSOL(X-rem(X,1)+1); z = z1 + dec*(z2-z1); end D. Paire M. Rovira 44