VIRTUAL LABORATORIES FOR A COURSE ABOUT INDOOR ENVIRONMENTAL QUALITY

The author teaches a course on Indoor Environmental Quality in the Master and Ph. D. programs on Energy for Sustainability in the University of Coimbra, Portugal. In the teaching methodology of this course there is a coexistence of the different approaches commonly used to deal with engineering problems, i.e. analytical formulation, experimentation and numerical simulation. The main objective is to demonstrate concepts in a stimulating way and to provide effective teaching tools for students, improving their way of establishing connections between theory and practice; enhancing, thus, their physical sense of reality. Some innovative teaching strategies used in this course were already reported in previous papers (Gameiro da Silva (2007); Gameiro da Silva (2008); Gameiro da Silva and Mateus (2008); Gameiro da Silva (2009))


INTRODUCTION
The author teaches a course on Indoor Environmental Quality in the Master and Ph. D. programs on Energy for Sustainability in the University of Coimbra, Portugal. In the teaching methodology of this course there is a coexistence of the different approaches commonly used to deal with engineering problems, i.e. analytical formulation, experimentation and numerical simulation. The main objective is to demonstrate concepts in a stimulating way and to provide effective teaching tools for students, improving their way of establishing connections between theory and practice; enhancing, thus, their physical sense of reality. Some innovative teaching strategies used in this course were already reported in previous papers (Gameiro da Silva (2007); Gameiro da Silva (2008); Gameiro da Silva and Mateus (2008); Gameiro da Silva (2009))

SOFTWARE TOOLS
A diversified set of software tools was developed to allow the simulation of physical phenomena, the implementation of calculation procedures and the emulation of measuring and sound generation equipment using a portable computer and its sound card. As regards Thermal Environment, a set of spreadsheets was written in Microsoft Excel to calculate the PMV and PPD thermal comfort indices, allowing the breakdown of the different heat fluxes participating on the human body thermal balance. Various spreadsheets were written to take into account the different possibilities of sets of measuring equipment used to evaluate the indoor climate conditions. In the case of Indoor Air Quality, the developed tools consist on simulators of the time evolutions of the concentration of pollutants in indoor compartments written in Labview. The cases of metabolic CO2 and pollutants released by tobacco smoke were considered.
Three different virtual instruments were developed for the Acoustics part of the course -a Sound Pressure Level Meter, a Noise Equivalent Level Meter and a Third Octave Frequency Analyzer -using the sound card of a portable computer as data acquisition device. Another application tool, consisting of a sound generator, was also developed. The sound card of the computer is also used to generate and add sinus sounds with frequencies centered on the octave bands between 63 and 8000 Hz.

Thermal Comfort indices PMV and PPD
The method developed by Fanger (1972) and adapted in ISO Standard 7730 is based on the determination of the PMV index (Predicted Mean Vote), calculated from an equation of thermal balance for the human body (see Figure 1), involving the terms of internal generation and heat exchanges with the surrounding environment.

Figure 1 -Human Body Thermal Balance
The value of the thermal comfort index PMV, which is an estimate of the expected average vote of a panel of evaluators for a given thermal environment, is calculated by the method developed by Fanger (1972). He established a model of correlation between the subjective human perception, expressed through the vote of comfort on a scale ranging from -3 (very cold) to +3 (very hot), and the difference between the heat generated and the heat released by the human body, which corresponds to the following equation: where the different terms stand for, respectively: M -the metabolic rate, in Watt per square meter (W/m 2 ); W -the effective mechanical power, in Watt per square meter (W/m 2 ); H -the sensitive heat losses; E c -the heat exchange by evaporation on the skin; C res -heat exchange by convection in breathing; E res -the evaporative heat exchange in breathing.
The set of equations for the implementation of the method is given in ISO 7730. The main problem in the calculation results from the fact that the term corresponding to the external temperature of clothing is unknown, a priori. This temperature must be determined by an iterative process, from an equation resulting from a heat balance established for the clothing layer. It is considered that, in a steady-state regime, the heat flux transmitted by conduction through that same clothing from the inner layer, at skin temperature, until the outer layer, is equal to the sum of the heat exchangex by convection and by radiation with the surrounding environment.
The other index proposed in ISO Standard 7730 is PPD (Predicted Percentage of Dissatisfied) that quantifies the expected percentage of dissatisfied people in a given thermal environment. Fanger concluded in his studies that the variation of the PPD index, as a function of PMV, can be approximated by an analytic expression that corresponds to a curve whose appearance is similar to an inverted Gaussian distribution (see figure 3), thus: The first spreadsheet developed directly applies the method recommended by ISO Standard 7730, determining the comfort indices based on the following input data related to environmental conditions -air temperature, mean radiant temperature, air velocity and partial pressure of vapour. In the graphical interface of the spreadsheet (see Figure 2) and in addition to the comfort indices, the values of the various heat fluxes in certain intermediate calculations are presented, which allows developing the physical sensitivity of the user to this topic. The spreadsheet, of which a graphical interface for a given instance is presented in Figure 2, is divided into three sections: the first, located on the left side, is used for data input by the operator and the initiation and control of the calculation process; the second, in the middle, displays the results of intermediate calculations required to implement the method and, finally, the third section, located on the right side of the screen, where the output values of the two comfort indices, PMV and PPD, are presented. For each situation, the user has to fill in the seven cells in the field of data entry at the top left corner, which are the only cells throughout the spreadsheet that allow input from the user, and then click on the button named "Run", which starts the calculation process that lasts less than one second. The spreadsheet also provides, as output, a graphical representation of the relative weights, in percentage, of the different parts of heat exchange fluxes between the individual and the surrounding environment. Figure 3 shows the graph obtained for the situation corresponding to the data in Figure  Apart from the presented basic spreadsheet previously presented, some more versions were developed to ensure determination of PMV and PPD indices in situations where measurements were made with sets of sensors that, although not measuring directly the four environmental parameters (t a , t r , p a and v ar ), allow their calculation.

General equations for the time evolution of a pollutant concentration
Consider a uni-zone compartment, where there is a source of pollution, that has gas exchanges with the outside air, and where an air purifier may work. Admitting the possibility of deposition and absorption of the pollutant on the walls and other surfaces, the temporal evolution of the concentration of a pollutant is modeled by the following differential equation: C, the instantaneous average concentration of pollutant (mg/m 3 ) G, the pollutant generation inside the compartment (mg/h) V, the room volume (m 3 ) λ v , the air exchange rate (h -1 ), i.e., the fresh air flow-rate divided by the room volume C ext , the concentration of the pollutant in outside air (mg/m 3 ) ν d , the rate of deposition of the pollutant (mg/h.m 2 ) S, the surface of deposition (m 2 ) Q ac , the flow rate through the air purifier (m 3 /h) ε ac , the efficiency of the air purifier (dimensionless) The effects of absorption or deposition of the pollutant inside the compartment and the removal by filtering through the air purifier system may be considered in a simplified form, reducing the intensity of the source. Thus, for purposes of simplification, their terms in the equation may be despised, coming: That, integrated for a situation where V, G, C ext e Q remain constant, since an initial time instant t=0, where the initial concentration C 0 =C ext , till a generic time instant t, will come: The equilibrium concentration C equi , in the equation above, is the value that occurs when the steady-sate regime is reached, i.e. when it ceases the variation in concentration. Thus, it is obtained equalizing the first member of equation 4 (the time derivative of concentration) to zero, which gives: The implemented numerical method is based on an approximation of equation (4), through the trapezoid rule, which becomes: Once the size of the step interval (∆t) for the calculations has been fixedlculations, the method is numerically implemented within a "While" Loop where the variation of concentration (∆C) during the interval is calculated for each step and summed to the value occurring after the previous step (C i-1 ). The values of the room volume V, of the initial concentration of pollutant in outside air C ini , and of the step interval ∆t are defined in the beginning of the simulation and remain constant till the end of the run. The intensity of the source (G) and the fresh air flow-rate (Q) may be changed while the program is running, allowing a visualization of the effects of their changes. The outputs of the simulation are the instantaneous concentration of the pollutant, the graphical display of the time-evolution of the pollutant concentration and, once the simulation has been stopped by the operator, the statistical data about the time series of concentration values (average, maximum, minimum and standard deviation).

Metabolic CO 2 simulation tool
In Emmerich and Persily (2001), the expressions to calculate the volumes of Oxygen (O 2 ) and Carbon Dioxide (CO 2 ) in the human respiration process are given as a function of the metabolic rate and the corpulence of the studied person. The volume of consumed O 2 is given by: where A D (m 2 ), the DuBois area, is the area of skin of the body of the analyzed person, M is the metabolic rate expressed in met, with 1 met = 58.15 W/m 2 and RQ is the ratio between the volume of released CO 2 and the consumed volume of O 2 . RQ usually takes the value of 0.83, but that may vary till 1, for a person with a very high metabolic rate (more than 5 met).
A D is calculated from: where H (m) and W (kg) are, respectively, the height and the weight of the analized person. Once the volume of O 2 has been calculated, the volume of released CO 2 , for normal metabolic rate cases is computed from: In the figure 4, it is depicted the front panel of the software, after a test performed for a one day evolution in a office, occupied from 08:30 till 18:00 by one person. It was assumed that the person has a metabolic rate of 1,2 met (69,78 W/m 2 ) when at the office, a typical value for office work. The considered weight and height are for a person close to European percentile 50. A daily routine with two breaks, a short one in the middle of the morning and about one hour at lunch time was simulated.

Simulation tool for PM10 released by tobacco
A similar application was implemented to simulate the Particulate Matter with diameter below 10 micron (PM10) released by tobacco cigarettes and pipes, because this type of pollutant is the one that puts more problems in terms of needed fresh air flow-rate to comply with limits for pollutants recommended for IAQ. It is possible to regulate the rate of particles release by the cigarette and to light or unlight it during the simulation. Typical values of pollutants usually checked in IAQ audits and released by one cigarette burning are given in  (2004) and Simone Charles et al (2008). In the figure 5, it is presented the software front panel after a simulation of a two hours period in a room occupied by a smoker. The fresh air flow-rate was fixed at 60 m 3 /h, because this is the recommended value in the Portuguese legislation for compartments with smokers in new buildings. It was simulated a situation where four cigarettes where smoked during the two hours. The spatial average concentration of PM10 in the room exceeds clearly the recommended limits for indoor spaces.

Sound Measuring Virtual Instruments
Three different virtual instruments were developed -a Sound Pressure Level Meter, a Noise Equivalent Level Meter and Recorder and a Third Octave Frequency Analyzer. The software application tools were written in the programming platform LabVIEW 7.1, using some of the Noise and Vibration Toolkits pertaining to the software package. The found solution, as regards the sound signal data acquisition, is very convenient because the computer sound card is used, which results in a very low investment. For teaching purposes, where the objective is mainly to demonstrate concepts and accuracy requirements may be lower than in the case of legal metrology measurements, a sound card with a 16 bits AD converter is enough. A stereo electret condenser microphone SONY DS70P was plugged to the computer sound card and used as primary sensor of the measuring chain. In the design of the graphical interfaces of the virtual sound measuring instruments, the idea was to reproduce the same type of controls for setting parameters as those existing in real measuring devices. As regards data displays, the objective was to be more elucidative than in real instruments, allowing the simultaneous display of the different phases of signal processing, from the beginning till the end. Digital displays were used to update the value of the main sound descriptors while the measurements are running. Students were very enthusiastic using these virtual instruments because they can see in real time the effect of a different sound in the displays. Interaction with the software is very easy because the users themselves can produce different sounds and look at their effect on the virtual instruments. The first software tool that was developed emulates a very simple soundmeter. Its graphical interface is presented in Fig. 8. It calculates, from a time series with the values of pressure measured by the microphone in the room, the sound pressure (SP) value, i. e. the standard deviation of pressure, and the sound pressure level, in dB, defined as: where SP ref, is the threshold of hearing (20 µPa).
Besides displaying in digital and analog formats the value of the Sound Pressure Level, the virtual instrument has a scopemeter where the time evolution of the pressure signal measured by the microphone is updated. In this way, students can have a better understanding of the relationships between the sound signal and its descriptors. It is possible to adjust some parameters, as it happens in a real soundmeter, e.g. the weighting curve (Linear, A, B, C or D), the frequency range, the amplification gain, etc. The sensitivity of the microphone, in the control panel of the software, is adjusted using a constant noise level source and a calibrated soundmeter as reference. With the microphone connected to the computer and the soundmeter's microphone placed in equivalent positions relatively to the noise source, the sensitivity of the microphone is adjusted in order to get the same lecture in both systems. This adjustment is dependent on the setting of the microphone gain that has been defined for the microphone channel in the sound card setting software. In computers working with Microsoft Windows operating system this adjustment is defined in Control Panel \ Sound and Audio Devices Properties. In case it is changed, the sensitivity of the microphone in the virtual soundmeter software should be adjusted. When analyzing the effect of sound over a certain period of time, there is a need of another type of descriptor. The most used is the Noise Equivalent Level (Leq), which is the Sound Pressure Level of a sound with constant amplitude with the same duration and energy content of the real signal which is being analyzed.
The following formula is used to calculate Leq from a time series of sound pressure values: The noise equivalent level is sometimes referred as the energetic mean of the sound pressure level time series and it is in general far from the value of the arithmetic mean, because maxima periods of SPL weight much more in its calculation than minima periods. The second software tool that was developed, to measure and display graphically the time evolutions of SPL and Leq is very convenient to call the attention of students for this fact and consequently to the special care that must be taken when defining sampling parameters for sound signals. While the graph of SPL is updated with the value calculated for the last interval, the value of Leq corresponds to the numerical integration since the beginning of the measurement. Analyzing the graphs of SPL(green) and Leq (yellow) displayed in the figure 9, characteristics of Leq evolutions are patent, once a certain level is reached it takes a very long time to have a significant reduction even if the SPL values remain at a low level. There is a button to restart the averaging process in the left part of the screen, as well as controls to set the measurement parameters of the emulated soundmeter, as regards the frequency range, the weighting factors, the sampling time for SPL calculation and the sensitivity of the sound measuring hardware (microphone, pre-amplifier, etc). The third emulated virtual instrument is a third-octave band frequency analyzer. It is based on a Fast Fourier Transform algorithm and allows the real time display of the frequency analysis of the acquired sound signal. The signal is decomposed into 30 elementary signals, each one of them with a frequency and amplitude given by the respective bar in the frequency spectrum graph. The real time display of the frequency spectrum of the signal helps students to feel the relationship between the graph and the respective Fourier series and the tonal content of the heard sound. In order to cement the concepts about the Fourier Series and also the sum of sound pressure levels from various sources, students are asked to calculate the overall SPL using the information given in the Power Spectrum. This calculation is asked with and without the application of the frequency weighting curves.

Sound Generator
Also based upon the computer's sound card, another software tool, similar to a simple synthesizer, was developed to allow the generation and reproduction of sounds, through the addition of mono-tonal sinus sound waves with eight possible frequencies, corresponding to the core values of the octave bands ranging from 63 Hz to 8 kHz.
The software, whose graphical interface is presented in Figure 10, allows the regulation of the amplitudes of sounds in the eight octave bands through the set of sliders located on the left side. In the center of the screen there are located two graphic displays, being displayed on the upper one the time evolution of the generated signal and on the lower one the results of implementation of Fast Fourier Transform algorithm to the generated signal, with the identification of the elementary frequencies and respective amplitudes.
On the right side, the analytical expression of the Fourier series corresponding to the generated signal is displayed, which is simultaneously graphically presented and played through the loudspeakers of the computer. In the analytical expression, below the digital displays which are showing the amplitudes for each frequency, there are LED-type indicators shifting gray to red if the amplitude value scale is different from zero, allowing for a rapid identification of what are the terms of the expression that are not null.

CONCLUSION
The use of software tools, either for the modeling of physical processes, either for the acquisition of data from experimental setups, resulted in a sound increase of the enthusiasm of the learners for the matters lectured in the course of Indoor Environmental Quality. They were used for the explanation of matters during lessons, as the basis for practical exercises and also tested by students. A first experience of an internet remote access was also demonstrated in the class room with the described virtual instruments, using the web publishing tool functionality of Labview software. The laptop computer of the teacher was used as the server, its URL was given to the students and they could in their place follow the measuring procedure and gain control of it. In the near future, the described virtual instruments will be integrated in a set of remote access laboratories that is now under implementation in the Department of Mechanical Engineering of the University of Coimbra.