![]() |
TuftedPuffin.co.uk |
||
|
Theoretical Energy From the sunAvailable as a free download from the NREL (National Renewable Energy Laboratory) is the source code ( in C ) for a Solar Position and Intensity Calculator called Solpos. I use the solpos code to calculate the azimuth and elevation of the sun and also to calculate the theoretical energy that should be reaching the solar thermal panels. So I can overlay the theoretical curve against the actual energy being reaped. The next step with this is to link the solpos software with weather station database so that solpos can take into account the air pressure and air temperature when calculating the airmass #include <math.h> #include <string.h> #include <stdio.h> #include <stdlib.h> #include <time.h> #include "solpos00.h" int main ( int argc, char *argv[0] ) { struct posdata pd, *pdat; /* declare a posdata struct and a pointer for it (if desired, the structure could be allocated dynamically with malloc) */ long retval; /* to capture S_solpos return codes */ struct tm *ct; time_t curTime; int i, j; double id; double prev_id; double total; time( &curTime ); ct = gmtime( &curTime ); fprintf( stderr, "Usage %s : <Lat> <Long> <tilt> <aspect>\n", argv[0] ); pdat = &pd; /* point to the structure for convenience */ S_init (pdat); pdat->longitude = atof( argv[2] ); pdat->latitude = atof( argv[1] ); pdat->timezone = 0.0; pdat->year = ct->tm_year + 1900; pdat->daynum = ct->tm_yday; /* Let's assume that the temperature is 27 degrees C and that the pressure is 1006 millibars. The temperature is used for the atmospheric refraction correction, and the pressure is used for the refraction correction and the pressure-corrected airmass. */ pdat->temp = 27.0; pdat->press = 1006.0; /* Finally, we will assume that you have a flat surface facing southeast, tilted at latitude. */ pdat->tilt = atof( argv[3] ); /*pdat->latitude; /* Tilted at latitude */ pdat->aspect = atof( argv[4] ); /*135.0; /* 135 deg. = SE */ total = 0; prev_id = 0; id = 0; for( i = 0; i < ct->tm_hour; i++ ) { pdat->hour = i; for( j = 0; j < 60; j++ ) { pdat->minute = j; pdat->second = 0; retval = S_solpos (pdat); /* S_solpos function call */ S_decode(retval, pdat); /* ALWAYS look at the return code! */ prev_id = id; id = 0; if( pdat->ampress > 0 ) { id = pdat->etrtilt * pow( 0.7, pow( pdat->ampress, 0.678 ) ); } total += ((prev_id + id)/2.0*1.0/60.0); printf( "%.4d-%.2d-%.2d %.2d:%.2d:00 %f %f %f %f %f %f\n", ct->tm_year+1900, ct->tm_mon+1, ct->tm_mday, i, j, pdat->elevetr, (pdat->elevetr > 0 ? pdat->azim : 0 ), pdat->etrtilt, pdat->ampress, id, total ); } } return 0; } This is compiled to be the utility I call kwh. A plot of collector feed pipe temperature against theoretical solar power
While the plot can't be used to directly monitor the efficiency of the panels, it does at least allow me to see when the panels should be working. |
||||||||||||||||||||
This page is best viewed using Firefox
|
|||||||||||||||||||||
|
|
|||||||||||||||||||||