solstice

Compute collected power and efficiencies of a solar plant
git clone git://git.meso-star.com/solstice.git
Log | Files | Refs | README | LICENSE

commit aa889d7f443e7cc8c79b2bb943f7c7560eb7d3b8
parent 9f1b5968e9ccd2ad020bb158eb4495944c91d676
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Fri, 21 Apr 2017 15:10:08 +0200

Add builtin sun spectrum

Handle the new Solstice Solver medium API.

Diffstat:
Mcmake/CMakeLists.txt | 8+++++---
Msrc/parser/solparser.c | 7+++++++
Msrc/parser/solparser.h | 4++++
Msrc/solstice_material.c | 16++++++++--------
Msrc/solstice_sun.c | 74+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------
Asrc/solstice_sun_spectrum.c | 400+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/solstice_sun_spectrum.h | 33+++++++++++++++++++++++++++++++++
7 files changed, 524 insertions(+), 18 deletions(-)

diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt @@ -93,11 +93,13 @@ set(SOLSTICE_FILES_SRC solstice_node.c solstice_object.c solstice_solve.c - solstice_sun.c) + solstice_sun.c + solstice_sun_spectrum.c) set(SOLSTICE_FILES_INC solstice.h solstice_args.h.in - solstice_c.h) + solstice_c.h + solstice_sun_spectrum.h) set(SOLSTICE_FILES_DOC COPYING README.md) # Prepend each file in the `SOLSTICE_FILES_<SRC|INC>' list by `SOLSTICE_SOURCE_DIR' @@ -143,7 +145,7 @@ if(NOT NO_TEST) build_test(test_solstice_simulation) function(add_test_simulation _name) add_test(NAME test_solstice_simulation_${_name} - COMMAND test_solstice_simulation + COMMAND test_solstice_simulation $<TARGET_FILE:solstice> ${SOLSTICE_SOURCE_DIR}/../yaml/ ${_name}) diff --git a/src/parser/solparser.c b/src/parser/solparser.c @@ -1109,6 +1109,13 @@ solparser_get_spectrum return darray_spectrum_cdata_get(&parser->spectra) + spectrum.i; } +int +solparser_has_spectrum(const struct solparser* parser) +{ + ASSERT(parser); + return darray_spectrum_size_get(&parser->spectra) != 0; +} + const struct solparser_sun* solparser_get_sun(const struct solparser* parser) { diff --git a/src/parser/solparser.h b/src/parser/solparser.h @@ -210,6 +210,10 @@ solparser_get_spectrum (const struct solparser* parser, const struct solparser_spectrum_id spectrum); +extern LOCAL_SYM int +solparser_has_spectrum + (const struct solparser* parser); + /******************************************************************************* * Entity interator ******************************************************************************/ diff --git a/src/solstice_material.c b/src/solstice_material.c @@ -326,10 +326,10 @@ create_material_dielectric SSOL(material_set_param_buffer(mtl, pbuf)); } - ssol_medium_i.refractive_index = medium_i->refractive_index; - ssol_medium_i.absorptivity = medium_i->absorptivity; - ssol_medium_t.refractive_index = medium_t->refractive_index; - ssol_medium_t.absorptivity = medium_t->absorptivity; + ssol_data_set_real(&ssol_medium_i.refractive_index, medium_i->refractive_index); + ssol_data_set_real(&ssol_medium_t.refractive_index, medium_t->refractive_index); + ssol_data_set_real(&ssol_medium_i.absorptivity, medium_i->absorptivity); + ssol_data_set_real(&ssol_medium_t.absorptivity, medium_t->absorptivity); SSOL(dielectric_setup(mtl, &shader, &ssol_medium_i, &ssol_medium_t)); exit: @@ -526,10 +526,10 @@ create_material_thin_dielectric SSOL(material_set_param_buffer(mtl, pbuf)); } - ssol_medium_i.refractive_index = medium_i->refractive_index; - ssol_medium_t.refractive_index = medium_t->refractive_index; - ssol_medium_i.absorptivity = medium_i->absorptivity; - ssol_medium_t.absorptivity = medium_t->absorptivity; + ssol_data_set_real(&ssol_medium_i.refractive_index, medium_i->refractive_index); + ssol_data_set_real(&ssol_medium_t.refractive_index, medium_t->refractive_index); + ssol_data_set_real(&ssol_medium_i.absorptivity, medium_i->absorptivity); + ssol_data_set_real(&ssol_medium_t.absorptivity, medium_t->absorptivity); SSOL(thin_dielectric_setup (mtl, &shader, &ssol_medium_i, &ssol_medium_t, thin->thickness)); diff --git a/src/solstice_sun.c b/src/solstice_sun.c @@ -14,6 +14,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include "solstice_c.h" +#include "solstice_sun_spectrum.h" #include "parser/solparser.h" #include "parser/solparser_sun.h" @@ -131,6 +132,15 @@ get_wavelength(const size_t i, double* wlen, double* data, void* ctx) *data = specdata[i].data; } +static void +get_wavelength_builtin(const size_t i, double* wlen, double* data, void* ctx) +{ + const double* spectrum = ctx; + ASSERT(wlen && data && ctx); + *wlen = spectrum[i*2+0]; + *data = spectrum[i*2+1]; +} + static res_T create_sun_spectrum (struct solstice* solstice, @@ -170,6 +180,53 @@ error: goto exit; } +static res_T +create_default_sun_spectrum + (struct solstice* solstice, + const struct solparser_sun* solparser_sun, + struct ssol_spectrum** out_spectrum) +{ + struct ssol_spectrum* spectrum = NULL; + const double* data; + size_t size; + res_T res = RES_OK; + + /* The solparser_sun may be used if the defautl spectrum is defined wrt the + * sun type */ + (void)solparser_sun; + + res = ssol_spectrum_create(solstice->ssol, &spectrum); + if(res != RES_OK) { + fprintf(stderr, "Could not create the spectrum of the solver sun.\n"); + goto error; + } + + if(solparser_has_spectrum(solstice->parser)) { + data = solstice_sun_spectrum_smarts295; + size = solstice_sun_spectrum_smarts295_size; + } else { + data = solstice_sun_spectrum_dummy; + size = solstice_sun_spectrum_dummy_size; + } + + res = ssol_spectrum_setup + (spectrum, get_wavelength_builtin, size, (void*)data); + if(res != RES_OK) { + fprintf(stderr, "Coul not setup the default spectrum of the solver sun.\n"); + goto error; + } + +exit: + *out_spectrum = spectrum; + return res; +error: + if(spectrum) { + SSOL(spectrum_ref_put(spectrum)); + spectrum = NULL; + } + goto exit; +} + /******************************************************************************* * Local function ******************************************************************************/ @@ -197,15 +254,18 @@ solstice_create_sun(struct solstice* solstice) } if(res != RES_OK) goto error; - if(SOLPARSER_ID_IS_VALID(solparser_sun->spectrum)) { + if(!SOLPARSER_ID_IS_VALID(solparser_sun->spectrum)) { + res = create_default_sun_spectrum(solstice, solparser_sun, &spectrum); + if(res != RES_OK) goto error; + } else { res = create_sun_spectrum(solstice, solparser_sun, &spectrum); - if (res != RES_OK) goto error; + if(res != RES_OK) goto error; + } - res = ssol_sun_set_spectrum(sun, spectrum); - if(res != RES_OK) { - fprintf(stderr, "Could not attach the spectrum to the sun.\n"); - goto error; - } + res = ssol_sun_set_spectrum(sun, spectrum); + if(res != RES_OK) { + fprintf(stderr, "Could not attach the spectrum to the sun.\n"); + goto error; } res = ssol_sun_set_dni(sun, solparser_sun->dni); diff --git a/src/solstice_sun_spectrum.c b/src/solstice_sun_spectrum.c @@ -0,0 +1,400 @@ +/* Copyright (C) CNRS 2016-2017 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include "solstice_sun_spectrum.h" + +const double solstice_sun_spectrum_dummy[] = { 1, 1 }; +const size_t solstice_sun_spectrum_dummy_size = 1; + +const double solstice_sun_spectrum_smarts295[] = { + 0.2800e+03, 0.3230e-25, + 0.2900e+03, 0.9925e-09, + 0.3000e+03, 0.6135e-03, + 0.3100e+03, 0.2614e-01, + 0.3200e+03, 0.1525e+00, + 0.3300e+03, 0.3587e+00, + 0.3400e+03, 0.4319e+00, + 0.3500e+03, 0.3749e+00, + 0.3600e+03, 0.5612e+00, + 0.3700e+03, 0.6070e+00, + 0.3800e+03, 0.4707e+00, + 0.3900e+03, 0.7168e+00, + 0.4000e+03, 0.8937e+00, + 0.4100e+03, 0.8838e+00, + 0.4200e+03, 0.8786e+00, + 0.4300e+03, 0.7032e+00, + 0.4400e+03, 0.1130e+01, + 0.4500e+03, 0.1341e+01, + 0.4600e+03, 0.1355e+01, + 0.4700e+03, 0.1414e+01, + 0.4800e+03, 0.1458e+01, + 0.4900e+03, 0.1502e+01, + 0.5000e+03, 0.1381e+01, + 0.5100e+03, 0.1422e+01, + 0.5200e+03, 0.1364e+01, + 0.5300e+03, 0.1386e+01, + 0.5400e+03, 0.1397e+01, + 0.5500e+03, 0.1408e+01, + 0.5600e+03, 0.1362e+01, + 0.5700e+03, 0.1384e+01, + 0.5800e+03, 0.1416e+01, + 0.5900e+03, 0.1287e+01, + 0.6000e+03, 0.1376e+01, + 0.6100e+03, 0.1357e+01, + 0.6200e+03, 0.1364e+01, + 0.6300e+03, 0.1281e+01, + 0.6400e+03, 0.1316e+01, + 0.6500e+03, 0.1240e+01, + 0.6600e+03, 0.1293e+01, + 0.6700e+03, 0.1312e+01, + 0.6800e+03, 0.1291e+01, + 0.6900e+03, 0.1127e+01, + 0.7000e+03, 0.1214e+01, + 0.7100e+03, 0.1230e+01, + 0.7200e+03, 0.9898e+00, + 0.7300e+03, 0.1089e+01, + 0.7400e+03, 0.1143e+01, + 0.7500e+03, 0.1133e+01, + 0.7600e+03, 0.3196e+00, + 0.7700e+03, 0.1081e+01, + 0.7800e+03, 0.1083e+01, + 0.7900e+03, 0.1034e+01, + 0.8000e+03, 0.1009e+01, + 0.8100e+03, 0.9829e+00, + 0.8200e+03, 0.8306e+00, + 0.8300e+03, 0.8917e+00, + 0.8400e+03, 0.9480e+00, + 0.8500e+03, 0.8229e+00, + 0.8600e+03, 0.9096e+00, + 0.8700e+03, 0.8980e+00, + 0.8800e+03, 0.8812e+00, + 0.8900e+03, 0.8665e+00, + 0.9000e+03, 0.7211e+00, + 0.9100e+03, 0.6374e+00, + 0.9200e+03, 0.7189e+00, + 0.9300e+03, 0.4862e+00, + 0.9400e+03, 0.5180e+00, + 0.9500e+03, 0.2243e+00, + 0.9600e+03, 0.4673e+00, + 0.9700e+03, 0.6353e+00, + 0.9800e+03, 0.6048e+00, + 0.9900e+03, 0.6883e+00, + 0.1000e+04, 0.6908e+00, + 0.1010e+04, 0.6779e+00, + 0.1020e+04, 0.6610e+00, + 0.1030e+04, 0.6559e+00, + 0.1040e+04, 0.6359e+00, + 0.1050e+04, 0.6251e+00, + 0.1060e+04, 0.6070e+00, + 0.1070e+04, 0.5804e+00, + 0.1080e+04, 0.5766e+00, + 0.1090e+04, 0.5442e+00, + 0.1100e+04, 0.4877e+00, + 0.1110e+04, 0.4891e+00, + 0.1120e+04, 0.2037e+00, + 0.1130e+04, 0.1307e+00, + 0.1140e+04, 0.2996e+00, + 0.1150e+04, 0.1741e+00, + 0.1160e+04, 0.3212e+00, + 0.1170e+04, 0.4473e+00, + 0.1180e+04, 0.4358e+00, + 0.1190e+04, 0.4467e+00, + 0.1200e+04, 0.4311e+00, + 0.1210e+04, 0.4322e+00, + 0.1220e+04, 0.4389e+00, + 0.1230e+04, 0.4385e+00, + 0.1240e+04, 0.4370e+00, + 0.1250e+04, 0.4323e+00, + 0.1260e+04, 0.4106e+00, + 0.1270e+04, 0.3752e+00, + 0.1280e+04, 0.3960e+00, + 0.1290e+04, 0.3951e+00, + 0.1300e+04, 0.3522e+00, + 0.1310e+04, 0.3159e+00, + 0.1320e+04, 0.2767e+00, + 0.1330e+04, 0.2623e+00, + 0.1340e+04, 0.1978e+00, + 0.1350e+04, 0.4197e-01, + 0.1360e+04, 0.1392e-03, + 0.1370e+04, 0.4692e-04, + 0.1380e+04, 0.1344e-02, + 0.1390e+04, 0.5292e-02, + 0.1400e+04, 0.2461e-05, + 0.1410e+04, 0.4293e-02, + 0.1420e+04, 0.2556e-01, + 0.1430e+04, 0.9898e-01, + 0.1440e+04, 0.6925e-01, + 0.1450e+04, 0.5774e-01, + 0.1460e+04, 0.1172e+00, + 0.1470e+04, 0.9169e-01, + 0.1480e+04, 0.9248e-01, + 0.1490e+04, 0.1937e+00, + 0.1500e+04, 0.2546e+00, + 0.1510e+04, 0.2677e+00, + 0.1520e+04, 0.2616e+00, + 0.1530e+04, 0.2574e+00, + 0.1540e+04, 0.2609e+00, + 0.1550e+04, 0.2627e+00, + 0.1560e+04, 0.2593e+00, + 0.1570e+04, 0.2379e+00, + 0.1580e+04, 0.2372e+00, + 0.1590e+04, 0.2287e+00, + 0.1600e+04, 0.2302e+00, + 0.1610e+04, 0.2170e+00, + 0.1620e+04, 0.2292e+00, + 0.1630e+04, 0.2322e+00, + 0.1640e+04, 0.2095e+00, + 0.1650e+04, 0.2183e+00, + 0.1660e+04, 0.2189e+00, + 0.1670e+04, 0.2154e+00, + 0.1680e+04, 0.1991e+00, + 0.1690e+04, 0.2022e+00, + 0.1700e+04, 0.1975e+00, + 0.1710e+04, 0.1864e+00, + 0.1720e+04, 0.1854e+00, + 0.1730e+04, 0.1752e+00, + 0.1740e+04, 0.1665e+00, + 0.1750e+04, 0.1670e+00, + 0.1760e+04, 0.1622e+00, + 0.1770e+04, 0.1504e+00, + 0.1780e+04, 0.1161e+00, + 0.1790e+04, 0.1068e+00, + 0.1800e+04, 0.4541e-01, + 0.1810e+04, 0.2518e-01, + 0.1820e+04, 0.5525e-02, + 0.1830e+04, 0.1963e-03, + 0.1840e+04, 0.9461e-05, + 0.1850e+04, 0.1700e-03, + 0.1860e+04, 0.2765e-03, + 0.1870e+04, 0.2355e-06, + 0.1880e+04, 0.1055e-02, + 0.1890e+04, 0.2512e-02, + 0.1900e+04, 0.4552e-04, + 0.1910e+04, 0.5519e-03, + 0.1920e+04, 0.3288e-02, + 0.1930e+04, 0.3281e-02, + 0.1940e+04, 0.1028e-01, + 0.1950e+04, 0.2698e-01, + 0.1960e+04, 0.3215e-01, + 0.1970e+04, 0.5907e-01, + 0.1980e+04, 0.8290e-01, + 0.1990e+04, 0.9252e-01, + 0.2000e+04, 0.4630e-01, + 0.2010e+04, 0.4664e-01, + 0.2020e+04, 0.5210e-01, + 0.2030e+04, 0.8816e-01, + 0.2040e+04, 0.9206e-01, + 0.2050e+04, 0.7283e-01, + 0.2060e+04, 0.7413e-01, + 0.2070e+04, 0.7092e-01, + 0.2080e+04, 0.8925e-01, + 0.2090e+04, 0.9080e-01, + 0.2100e+04, 0.8882e-01, + 0.2110e+04, 0.9074e-01, + 0.2120e+04, 0.8870e-01, + 0.2130e+04, 0.8978e-01, + 0.2140e+04, 0.9009e-01, + 0.2150e+04, 0.8515e-01, + 0.2160e+04, 0.8391e-01, + 0.2170e+04, 0.8109e-01, + 0.2180e+04, 0.8133e-01, + 0.2190e+04, 0.7937e-01, + 0.2200e+04, 0.7252e-01, + 0.2210e+04, 0.7862e-01, + 0.2220e+04, 0.7717e-01, + 0.2230e+04, 0.7534e-01, + 0.2240e+04, 0.7312e-01, + 0.2250e+04, 0.7211e-01, + 0.2260e+04, 0.6775e-01, + 0.2270e+04, 0.6582e-01, + 0.2280e+04, 0.6686e-01, + 0.2290e+04, 0.6381e-01, + 0.2300e+04, 0.5990e-01, + 0.2310e+04, 0.6448e-01, + 0.2320e+04, 0.5400e-01, + 0.2330e+04, 0.5834e-01, + 0.2340e+04, 0.4959e-01, + 0.2350e+04, 0.4533e-01, + 0.2360e+04, 0.5260e-01, + 0.2370e+04, 0.3567e-01, + 0.2380e+04, 0.4674e-01, + 0.2390e+04, 0.4126e-01, + 0.2400e+04, 0.4726e-01, + 0.2410e+04, 0.3924e-01, + 0.2420e+04, 0.3166e-01, + 0.2430e+04, 0.4852e-01, + 0.2440e+04, 0.4739e-01, + 0.2450e+04, 0.1931e-01, + 0.2460e+04, 0.3885e-01, + 0.2470e+04, 0.2266e-01, + 0.2480e+04, 0.1475e-01, + 0.2490e+04, 0.8442e-02, + 0.2500e+04, 0.1466e-01, + 0.2510e+04, 0.6496e-02, + 0.2520e+04, 0.2256e-02, + 0.2530e+04, 0.3021e-04, + 0.2540e+04, 0.2730e-04, + 0.2550e+04, 0.2779e-07, + 0.2560e+04, 0.4655e-06, + 0.2570e+04, 0.9511e-12, + 0.2580e+04, 0.5296e-13, + 0.2590e+04, 0.4757e-18, + 0.2600e+04, 0.1390e-16, + 0.2610e+04, 0.8284e-20, + 0.2620e+04, 0.1685e-15, + 0.2630e+04, 0.3664e-26, + 0.2640e+04, 0.4018e-10, + 0.2650e+04, 0.1219e-11, + 0.2660e+04, 0.2993e-14, + 0.2670e+04, 0.2406e-36, + 0.2680e+04, 0.0000e+00, + 0.2690e+04, 0.1286e-20, + 0.2700e+04, 0.2953e-41, + 0.2710e+04, 0.1743e-22, + 0.2720e+04, 0.4345e-27, + 0.2730e+04, 0.7687e-13, + 0.2740e+04, 0.5702e-15, + 0.2750e+04, 0.2985e-19, + 0.2760e+04, 0.1944e-35, + 0.2770e+04, 0.9937e-16, + 0.2780e+04, 0.3978e-25, + 0.2790e+04, 0.1796e-11, + 0.2800e+04, 0.1818e-08, + 0.2810e+04, 0.1790e-06, + 0.2820e+04, 0.1349e-07, + 0.2830e+04, 0.8420e-04, + 0.2840e+04, 0.9419e-05, + 0.2850e+04, 0.3244e-04, + 0.2860e+04, 0.2736e-03, + 0.2870e+04, 0.1159e-03, + 0.2880e+04, 0.1253e-02, + 0.2890e+04, 0.8788e-03, + 0.2900e+04, 0.2641e-02, + 0.2910e+04, 0.3721e-02, + 0.2920e+04, 0.6130e-02, + 0.2930e+04, 0.1064e-01, + 0.2940e+04, 0.3998e-02, + 0.2950e+04, 0.9301e-02, + 0.2960e+04, 0.8467e-02, + 0.2970e+04, 0.1220e-02, + 0.2980e+04, 0.3444e-02, + 0.2990e+04, 0.1462e-01, + 0.3000e+04, 0.1173e-01, + 0.3010e+04, 0.1033e-01, + 0.3020e+04, 0.2158e-02, + 0.3030e+04, 0.9299e-02, + 0.3040e+04, 0.4684e-02, + 0.3050e+04, 0.3120e-02, + 0.3060e+04, 0.9647e-02, + 0.3070e+04, 0.4417e-02, + 0.3080e+04, 0.6574e-02, + 0.3090e+04, 0.5481e-02, + 0.3100e+04, 0.7460e-02, + 0.3110e+04, 0.2883e-02, + 0.3120e+04, 0.1381e-01, + 0.3130e+04, 0.8512e-02, + 0.3140e+04, 0.5643e-02, + 0.3150e+04, 0.1019e-01, + 0.3160e+04, 0.1242e-01, + 0.3170e+04, 0.1546e-01, + 0.3180e+04, 0.1328e-01, + 0.3190e+04, 0.6653e-02, + 0.3200e+04, 0.1455e-02, + 0.3210e+04, 0.7609e-03, + 0.3220e+04, 0.3527e-02, + 0.3230e+04, 0.1212e-02, + 0.3240e+04, 0.5960e-02, + 0.3250e+04, 0.4193e-02, + 0.3260e+04, 0.2581e-02, + 0.3270e+04, 0.2590e-02, + 0.3280e+04, 0.4574e-02, + 0.3290e+04, 0.1112e-01, + 0.3300e+04, 0.3168e-02, + 0.3310e+04, 0.5679e-02, + 0.3320e+04, 0.2343e-03, + 0.3330e+04, 0.6243e-02, + 0.3340e+04, 0.5467e-02, + 0.3350e+04, 0.1045e-01, + 0.3360e+04, 0.7264e-02, + 0.3370e+04, 0.5567e-02, + 0.3380e+04, 0.6825e-02, + 0.3390e+04, 0.1132e-01, + 0.3400e+04, 0.1382e-01, + 0.3410e+04, 0.8955e-02, + 0.3420e+04, 0.1426e-01, + 0.3430e+04, 0.9903e-02, + 0.3440e+04, 0.9415e-02, + 0.3450e+04, 0.1221e-01, + 0.3460e+04, 0.1359e-01, + 0.3470e+04, 0.1326e-01, + 0.3480e+04, 0.1223e-01, + 0.3490e+04, 0.1153e-01, + 0.3500e+04, 0.1288e-01, + 0.3510e+04, 0.1292e-01, + 0.3520e+04, 0.1303e-01, + 0.3530e+04, 0.1211e-01, + 0.3540e+04, 0.1022e-01, + 0.3550e+04, 0.1153e-01, + 0.3560e+04, 0.1179e-01, + 0.3570e+04, 0.9701e-02, + 0.3580e+04, 0.1103e-01, + 0.3590e+04, 0.1057e-01, + 0.3600e+04, 0.1116e-01, + 0.3610e+04, 0.1051e-01, + 0.3620e+04, 0.1209e-01, + 0.3630e+04, 0.1081e-01, + 0.3640e+04, 0.1190e-01, + 0.3650e+04, 0.1077e-01, + 0.3660e+04, 0.1142e-01, + 0.3670e+04, 0.9043e-02, + 0.3680e+04, 0.9377e-02, + 0.3690e+04, 0.1037e-01, + 0.3700e+04, 0.1114e-01, + 0.3710e+04, 0.9977e-02, + 0.3720e+04, 0.1080e-01, + 0.3730e+04, 0.9894e-02, + 0.3740e+04, 0.9411e-02, + 0.3750e+04, 0.9769e-02, + 0.3760e+04, 0.9590e-02, + 0.3770e+04, 0.9703e-02, + 0.3780e+04, 0.9985e-02, + 0.3790e+04, 0.8581e-02, + 0.3800e+04, 0.1012e-01, + 0.3810e+04, 0.8925e-02, + 0.3820e+04, 0.9938e-02, + 0.3830e+04, 0.9884e-02, + 0.3840e+04, 0.9376e-02, + 0.3850e+04, 0.9185e-02, + 0.3860e+04, 0.8506e-02, + 0.3870e+04, 0.7832e-02, + 0.3880e+04, 0.7082e-02, + 0.3890e+04, 0.7347e-02, + 0.3900e+04, 0.8324e-02, + 0.3910e+04, 0.7550e-02, + 0.3920e+04, 0.7389e-02, + 0.3930e+04, 0.7457e-02, + 0.3940e+04, 0.7786e-02, + 0.3950e+04, 0.7975e-02, + 0.3960e+04, 0.8089e-02, + 0.3970e+04, 0.8058e-02, + 0.3980e+04, 0.7779e-02, + 0.3990e+04, 0.7693e-02, + 0.4000e+04, 0.7504e-02 +}; + +const size_t solstice_sun_spectrum_smarts295_size = + sizeof(solstice_sun_spectrum_smarts295) / sizeof(double[2]); + + diff --git a/src/solstice_sun_spectrum.h b/src/solstice_sun_spectrum.h @@ -0,0 +1,33 @@ +/* Copyright (C) CNRS 2016-2017 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#ifndef SOLSTICE_SUN_SPECTRUM_H +#define SOLSTICE_SUN_SPECTRUM_H + +#include <rsys/rsys.h> + +/* + * Each built-in spectrum is a list of double2: [Wavelength in nano-meter, + * DNI]. Its associated size is the number of double[2] into the spectrum + */ + +extern LOCAL_SYM const double solstice_sun_spectrum_dummy[]; +extern LOCAL_SYM const size_t solstice_sun_spectrum_dummy_size; + +extern LOCAL_SYM const double solstice_sun_spectrum_smarts295[]; +extern LOCAL_SYM const size_t solstice_sun_spectrum_smarts295_size; + +#endif /* SOLSTICE_SUN_SPECTRUM_H */ +