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 c2b8369207dd14d023cefc92adcbb152355f61c5
parent d9604b0e67ac38c5f86ae4aeb8189459192a5477
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Wed, 27 Sep 2017 14:12:09 +0200

Merge branch 'release_0.6'

Diffstat:
MREADME.md | 22++++++++++++++++++++--
Mcmake/CMakeLists.txt | 4++--
Mdoc/solstice-input.5.txt | 10+++++-----
Mdoc/solstice-output.5.txt | 74+++++++++++++++++++++++++++++++++++++++++++++++++-------------------------
Msrc/parser/solparser_atmosphere.c | 10+++++-----
Msrc/parser/solparser_atmosphere.h | 2+-
Msrc/parser/solparser_entity.c | 2++
Msrc/parser/solparser_medium.c | 10+++++-----
Msrc/parser/solparser_medium.h | 2+-
Msrc/parser/solparser_sun.c | 16++++++++--------
Msrc/parser/solparser_sun.h | 2+-
Msrc/parser/test_solparser2.c | 2+-
Msrc/parser/test_solparser3.c | 2+-
Msrc/parser/test_solparser7.c | 12++++++------
Msrc/parser/test_solparser8.c | 12++++++------
Msrc/parser/test_solparser_normal_map.c | 8++++----
Msrc/parser/test_solparser_spectrum.c | 20++++++++++----------
Msrc/parser/yaml/test_ko_0.yaml | 50+++++++++++++++++++++++++-------------------------
Msrc/parser/yaml/test_ok_5.yaml | 12++++++------
Msrc/parser/yaml/test_ok_7.yaml | 16++++++++--------
Msrc/solstice.c | 17+++++++++++++++++
Msrc/solstice_atmosphere.c | 10+++++-----
Msrc/solstice_entity.c | 20+++++++-------------
Msrc/solstice_material.c | 8++++----
Msrc/solstice_solve.c | 50++++++++++++++++++++++++++++++++++++++++++++------
Msrc/solstice_sun.c | 8++++----
Myaml/beam_down.ref | 84++++++++++++++++++++++++++++++++++++++++----------------------------------------
Myaml/test01.ref | 4++--
Myaml/test02.ref | 8++++----
Myaml/test03.ref | 10+++++-----
Myaml/test04.ref | 10+++++-----
Myaml/test05.ref | 4++--
Myaml/test06.ref | 10+++++-----
Myaml/test07.ref | 10+++++-----
Myaml/test07.yaml | 2+-
Myaml/test08.ref | 10+++++-----
Myaml/test08.yaml | 2+-
37 files changed, 324 insertions(+), 231 deletions(-)

diff --git a/README.md b/README.md @@ -60,6 +60,24 @@ informations on CMake. ## Release notes +### Version 0.6 + +- Rename the atmosphere `absorption` parameter in `extinction`. +- Add several global and per-receiver estimations. The outputs now fully + describe the incoming and absorbed fluxes: overall flux, flux without + material loss, flux without atmospheric loss, material losses and atmospheric + losses. +- Rename the pillbox `aperture` parameter in `theta_max`. +- Fix the distribution of the pillbox sun: the pdf was wrong and its angular + parameter was internally used as an angular diameter while it is a angular + radius. +- Fix the solver for non parallel sun: the angle between the principal sun + direction and the sampled direction was not correctly taken into account + leading to a wrong initial weight for the optical paths. +- Fix the solver with shapes having perturbed normals: perturbed normals + must be taken into account in the bounces of the optical paths only, not in + the energy computations. + ### Version 0.5 - Improve the performances of the solver up to 50% in situations where the @@ -67,13 +85,13 @@ informations on CMake. ### Version 0.4.1 -- Update the name of the outputted data in the solstice-output man page. +- Update the name of the output data in the solstice-output man page. - Fix an issue in "dump geometry" mode, i.e. option `-g`. Solstice might fail to export the solar plant geometry due to a wrong constraint on the pivots. ### Version 0.4 -- Update the color of the paths outputted with the `-p` option. A path is blue, +- Update the color of the paths output with the `-p` option. A path is blue, turquoise or yellow if it reaches a receiver, misses the receivers or is occluded before it reaches a primary reflector, respectively. - Add a new type of paths tracked with the `-p` option: a path is red if it diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt @@ -45,7 +45,7 @@ find_package(LibYAML REQUIRED) find_package(RCMake 0.2.3 REQUIRED) find_package(RSys 0.4 REQUIRED) find_package(SolAnim 0.2 REQUIRED) -find_package(SolSolver 0.5 REQUIRED) +find_package(SolSolver 0.6 REQUIRED) find_package(Star3DUT 0.2 REQUIRED) find_package(StarSP 0.4 REQUIRED) find_package(StarSTL 0.3.1 REQUIRED) @@ -96,7 +96,7 @@ configure_file(${SOLSTICE_SOURCE_DIR}/../doc/solstice.1.txt.in ${CMAKE_CURRENT_BINARY_DIR}/doc/solstice.1.txt @ONLY) set(VERSION_MAJOR 0) -set(VERSION_MINOR 5) +set(VERSION_MINOR 6) set(VERSION_PATCH 0) set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}) diff --git a/doc/solstice-input.5.txt b/doc/solstice-input.5.txt @@ -253,7 +253,7 @@ _______ csr: REAL # in [1e-6, 0.849] <pillbox> ::= pillbox: - aperture: REAL # in ]0, 90] + theta_max: REAL # in ]0, 90] ---------------------------------------- @@ -318,8 +318,8 @@ shapes are: *pillbox*:: The *pillbox* distribution defines an uniform intensity over the sun's disk. - Its single *aperture* parameter is the sun's disk half-angle in degrees, that - is linked to the apparent size of the sun. A typical aperture is 0.2664. + Its single *theta_max* parameter is the sun's disk half-angle in degrees, that + is linked to the apparent size of the sun. A typical theta_max is 0.2664. *buie*:: The *buie* distribution, as first discribed in [3]. Its single *csr* @@ -877,12 +877,12 @@ is 1 and its center is positioned at {0,0,2}: ....... Define a circular diffuse reflector surrounded by a virtual sphere and a -pillbox-shaped sun whose aperture is 0.1 degree. Use anchors and tags of the +pillbox-shaped sun whose theta_max is 0.1 degree. Use anchors and tags of the YAML format to reference into the entities a pre-declared geometry. Rely on the YAML compact notation to reduce the number of lines required to describe the scene: ....... -- sun: {dni: 1000, pillbox: {aperture: 0.1}} +- sun: {dni: 1000, pillbox: {theta_max: 0.1}} - geometry: &small-circle - material: {matte: {reflectivity: 1}} diff --git a/doc/solstice-output.5.txt b/doc/solstice-output.5.txt @@ -112,8 +112,10 @@ _______ <front> ::= <side> <back> ::= <side> -<side> ::= "<absorbed-flux> <incoming-flux> - <materials-loss> <atmospheric-loss> +<side> ::= "<incoming-flux> <in-if-no-mat-loss> <in-if-no-atm-loss> + <in-mat-loss> <in-atm-loss> + <absorbed-flux> <abs-if-no-mat-loss> <abs-if-no-atm-loss> + <abs-mat-loss> <abs-atm-loss> <efficiency>" ------------------------------------- @@ -139,8 +141,10 @@ _______ <rcvXprim-front> ::= <rcvXprim-side> <rcvXprim-back> ::= <rcvXprim-side> -<rcvXprim-side> ::= "<absorbed-flux> <incoming-flux> - <materials-loss> <atmospheric-loss>" +<rcvXprim-side> ::= "<incoming-flux> <in-if-no-mat-loss> <in-if-no-atm-loss> + <in-mat-loss> <in-atm-loss> + <absorbed-flux> <abs-if-no-mat-loss> <abs-if-no-atm-loss> + <abs-mat-loss> <abs-atm-loss>" ------------------------------------- @@ -160,13 +164,21 @@ _______ <azimuth> ::= REAL # Degrees in [0, 360[ <elevation> ::= REAL # Degrees in [0, 90] -<potential-flux> ::= <estimate> +<incoming-flux> ::= <estimate> +<in-if-no-mat-loss> ::= <estimate> +<in-if-no-atm-loss> ::= <estimate> +<in-mat-loss> ::= <estimate> +<in-atm-loss> ::= <estimate> <absorbed-flux> ::= <estimate> -<atmospheric-loss> ::= <estimate> +<abs-if-no-mat-loss> ::= <estimate> +<abs-if-no-atm-loss> ::= <estimate> +<abs-mat-loss> ::= <estimate> +<abs-atm-loss> ::= <estimate> <cos-factor> ::= <estimate> <incoming-flux> ::= <estimate> <missing-loss> ::= <estimate> <materials-loss> ::= <estimate> +<atmospheric-loss> ::= <estimate> <shadow-loss> ::= <estimate> <efficiency> ::= <estimate> @@ -206,8 +218,8 @@ standard error. The global results are, in this order: receiver geometry. At most equal to the potential flux; - *cos-factor*: cos of the angle between the sun direction and the normal of the primary surfaces (average cos over all primary geometries); -- *shadow-loss*: potential flux intercepted by another geometry before reaching - a primary geometry. +- *shadow-loss*: potential flux intercepted by another geometry before reaching + a primary geometry; - *missing-loss*: part of the flux that reaches a primary geometry, follows a radiative path, but is not absorbed; this flux could have bounced on geometries, including receivers, but without being absorbed; @@ -240,13 +252,21 @@ The estimates of the *front* and *back* sides are listed bellow. Note that each of the following estimates is actually a pair of real numbers: the expected value and its standard error. -- *absorbed-flux*: flux absorbed by the receiver side; - *incoming-flux*: flux that reaches the receiver side; -- *materials-loss*: additional flux that could have been absorbed by the - receiver side if no absorption had occurred on non-receivers material until then; -- *atmospheric-loss*: additional flux that could have been absorbed by the - receiver side if atmospheric extinction had not been taken into account; -- *efficiency*: fraction of potential flux absorbed by the receiver side. +- *in-if-no-mat-loss*: incoming-flux if + absorption on non-receivers is not taken into account; +- *in-if-no-atm-loss*: incoming-flux if + atmospheric extinction is not taken into account; +- *in-mat-loss*: in-if-no-mat-loss - incoming-flux; +- *in-atm-loss*: in-if-no-atm-loss - incoming-flux; +- *absorbed-flux*: flux absorbed by the receiver side; +- *abs-if-no-mat-loss*: absorbed-flux if + absorption by non-receivers is not taken into account; +- *abs-if-no-atm-loss*: absorbed-flux if + atmospheric extinction is not taken into account; +- *abs-mat-loss*: abs-if-no-mat-loss - absorbed-flux; +- *abs-atm-loss*: abs-if-no-atm-loss - absorbed-flux; +- *efficiency*: fraction of the potential flux absorbed by this receiver side. Both *front* and *back* side estimates are output, even if the receiver has only a single receiving side. In this case, the results of the non-receiving @@ -268,7 +288,7 @@ the headers. Each line contains: geometry; - *cos-factor*: cos of the angle between the sun direction and the normal of the primary surface (average cos on the primary geometry); -- *shadow-loss*: potential flux intercepted by another geometry before reaching +- *shadow-loss*: potential flux intercepted by another geometry before reaching the primary geometry of interest. Per receiver and per primary results @@ -288,16 +308,20 @@ The estimated values of *rcvXprim-front* and *rcvXprim-back* are listed bellow. Each of these estimates is actually a pair of real numbers: the expected value and its standard error. -- *absorbed-flux*: flux absorbed by the receiver side coming - from the primary geometry; -- *incoming-flux*: flux reaching the receiver side coming from the primary - geometry; -- *materials-loss*: additional flux that could have been absorbed by the - receiver side coming from the primary geometry if no absorption had occurred - on non-receivers material until then; -- *atmospheric-loss*: additional flux that could have been absorbed by - the receiver side coming from the primary geometry if atmospheric - extinction had not been taken into account. +- *incoming-flux*: flux that reaches the receiver side; +- *in-if-no-mat-loss*: incoming-flux if + absorption on non-receivers is not taken into account; +- *in-if-no-atm-loss*: incoming-flux if + atmospheric extinction is not taken into account; +- *in-mat-loss*: in-if-no-mat-loss - incoming-flux; +- *in-atm-loss*: in-if-no-atm-loss - incoming-flux; +- *absorbed-flux*: flux absorbed by the receiver side; +- *abs-if-no-mat-loss*: absorbed-flux if + absorption by non-receivers is not taken into account; +- *abs-if-no-atm-loss*: absorbed-flux if + atmospheric extinction is not taken into account; +- *abs-mat-loss*: abs-if-no-mat-loss - absorbed-flux; +- *abs-atm-loss*: abs-if-no-atm-loss - absorbed-flux; Both front and back side estimates are output, even if the receiver has only a single receiving side. In this case, the results of the non-receiving side are diff --git a/src/parser/solparser_atmosphere.c b/src/parser/solparser_atmosphere.c @@ -28,7 +28,7 @@ parse_atmosphere yaml_node_t* atm, struct solparser_atmosphere** out_solatm) { - enum { ABSORPTION }; + enum { EXTINCTION }; struct solparser_atmosphere* solatm = NULL; int mask = 0; /* Register the parsed attributes */ intptr_t i, n; @@ -77,10 +77,10 @@ parse_atmosphere } \ mask |= BIT(Flag); \ } (void)0 - if(!strcmp((char*)key->data.scalar.value, "absorption")) { - SETUP_MASK(ABSORPTION, "absorption"); + if(!strcmp((char*)key->data.scalar.value, "extinction")) { + SETUP_MASK(EXTINCTION, "extinction"); res = parse_mtl_data - (parser, doc, val, 0, 1, &solatm->absorption); + (parser, doc, val, 0, 1, &solatm->extinction); } else { log_err(parser, key, "unknown atmosphere parameter `%s'.\n", key->data.scalar.value); @@ -100,7 +100,7 @@ parse_atmosphere res = RES_BAD_ARG; \ goto error; \ } (void)0 - CHECK_PARAM(ABSORPTION, "absorption"); + CHECK_PARAM(EXTINCTION, "extinction"); #undef CHECK_PARAM exit: diff --git a/src/parser/solparser_atmosphere.h b/src/parser/solparser_atmosphere.h @@ -19,7 +19,7 @@ #include "solparser_mtl_data.h" struct solparser_atmosphere { - struct solparser_mtl_data absorption; + struct solparser_mtl_data extinction; }; static INLINE void diff --git a/src/parser/solparser_entity.c b/src/parser/solparser_entity.c @@ -391,6 +391,8 @@ parse_entity } else if(!strcmp((char*) key->data.scalar.value, "primary")) { long tmp; SETUP_MASK(PRIMARY, "primary"); + /* FIXME: add NONE/ FRONT / BACK / FRONT_AND_BACK qualifier + * to avoid a misunderstanding about shadows results */ res = parse_integer(parser, val, 0, 1, &tmp); solent.primary = (int)tmp; } else { diff --git a/src/parser/solparser_medium.c b/src/parser/solparser_medium.c @@ -28,7 +28,7 @@ parse_medium yaml_node_t* medium, struct solparser_medium_id* out_imedium) { - enum { ABSORPTION, REFRACTIVE_INDEX }; + enum { EXTINCTION, REFRACTIVE_INDEX }; struct solparser_medium* mdm = NULL; size_t* pimedium = NULL; size_t imedium = SIZE_MAX; @@ -81,9 +81,9 @@ parse_medium } \ mask |= BIT(Flag); \ } (void)0 - if(!strcmp((char*)key->data.scalar.value, "absorption")) { - SETUP_MASK(ABSORPTION, "absorption"); - res = parse_mtl_data(parser, doc, val, 0, DBL_MAX, &mdm->absorption); + if(!strcmp((char*)key->data.scalar.value, "extinction")) { + SETUP_MASK(EXTINCTION, "extinction"); + res = parse_mtl_data(parser, doc, val, 0, DBL_MAX, &mdm->extinction); } else if(!strcmp((char*)key->data.scalar.value, "refractive_index")) { SETUP_MASK(REFRACTIVE_INDEX, "refractive_index"); res = parse_mtl_data @@ -107,7 +107,7 @@ parse_medium res = RES_BAD_ARG; \ goto error; \ } (void)0 - CHECK_PARAM(ABSORPTION, "absorption"); + CHECK_PARAM(EXTINCTION, "absorption"); CHECK_PARAM(REFRACTIVE_INDEX, "refractive_index"); #undef CHECK_PARAM diff --git a/src/parser/solparser_medium.h b/src/parser/solparser_medium.h @@ -21,7 +21,7 @@ struct solparser_medium { struct solparser_mtl_data refractive_index; - struct solparser_mtl_data absorption; + struct solparser_mtl_data extinction; }; struct solparser_medium_id { size_t i; }; diff --git a/src/parser/solparser_sun.c b/src/parser/solparser_sun.c @@ -93,7 +93,7 @@ parse_pillbox const yaml_node_t* pillbox, struct solparser_sun_pillbox* sun) { - enum { APERTURE }; + enum { THETA_MAX }; intptr_t i, n; int mask = 0; /* Register the parsed attributes */ res_T res = RES_OK; @@ -118,14 +118,14 @@ parse_pillbox res = RES_BAD_ARG; goto error; } - if(!strcmp((char*)key->data.scalar.value, "aperture")) { - if(mask & BIT(APERTURE)) { - log_err(parser, key, "the pillbox `aperture' is already defined.\n"); + if(!strcmp((char*)key->data.scalar.value, "theta_max")) { + if(mask & BIT(THETA_MAX)) { + log_err(parser, key, "the pillbox `theta_max' is already defined.\n"); res = RES_BAD_ARG; goto error; } - mask |= BIT(APERTURE); - res = parse_real(parser, val, nextafter(0, 1), 90, &sun->aperture); + mask |= BIT(THETA_MAX); + res = parse_real(parser, val, nextafter(0, 1), 90, &sun->theta_max); } else { log_err(parser, pillbox, "unknown pillbox parameter `%s'.\n", key->data.scalar.value); @@ -138,8 +138,8 @@ parse_pillbox } } - if(!(mask & BIT(APERTURE))) { - log_err(parser, pillbox, "the pillbox aperture parameter is missing.\n"); + if(!(mask & BIT(THETA_MAX))) { + log_err(parser, pillbox, "the pillbox theta_max parameter is missing.\n"); res = RES_BAD_ARG; goto error; } diff --git a/src/parser/solparser_sun.h b/src/parser/solparser_sun.h @@ -26,7 +26,7 @@ enum solparser_sun_radang_distrib_type { /* Radial Angular distribution */ }; struct solparser_sun_buie { double csr; }; -struct solparser_sun_pillbox { double aperture; }; +struct solparser_sun_pillbox { double theta_max; }; struct solparser_sun { double dni; /* In ]0, INF) */ diff --git a/src/parser/test_solparser2.c b/src/parser/test_solparser2.c @@ -101,7 +101,7 @@ main(int argc, char** argv) fprintf(stream, " dni: 1\n"); fprintf(stream, " spectrum: [ { wavelength: 1, data: 1} ]\n"); fprintf(stream, "- atmosphere:\n"); - fprintf(stream, " absorption: 0\n"); + fprintf(stream, " extinction: 0\n"); rewind(stream); CHECK(solparser_setup(parser, NULL, stream), RES_OK); diff --git a/src/parser/test_solparser3.c b/src/parser/test_solparser3.c @@ -43,7 +43,7 @@ static const char* input[] = { " dni: 1\n", " spectrum: [{wavelength: 1, data: 1}]\n", "- atmosphere:\n", - " absorption: [{wavelength: 1, data: 1}]\n", + " extinction: [{wavelength: 1, data: 1}]\n", "- entity:\n", " name: entity0\n", " primary: 0\n", diff --git a/src/parser/test_solparser7.c b/src/parser/test_solparser7.c @@ -54,13 +54,13 @@ main(int argc, char** argv) fprintf(stream, " thickness: 0.123\n"); fprintf(stream, " medium_i: &outside\n"); fprintf(stream, " refractive_index: 1\n"); - fprintf(stream, " absorption: 0\n"); + fprintf(stream, " extinction: 0\n"); fprintf(stream, " medium_t: &inside\n"); fprintf(stream, " refractive_index: \n"); fprintf(stream, " - {wavelength: 1.2, data: 2.3}\n"); fprintf(stream, " - {wavelength: 4.5, data: 6.7}\n"); fprintf(stream, " - {wavelength: 0.5, data: 0.25}\n"); - fprintf(stream, " absorption:\n"); + fprintf(stream, " extinction:\n"); fprintf(stream, " - {wavelength: 3, data: 3}\n"); fprintf(stream, " - {wavelength: 1, data: 1}\n"); fprintf(stream, " - {wavelength: 5, data: 5}\n"); @@ -98,8 +98,8 @@ main(int argc, char** argv) medium = solparser_get_medium(parser, thin->medium_i); CHECK(medium->refractive_index.type, SOLPARSER_MTL_DATA_REAL); CHECK(medium->refractive_index.value.real, 1); - CHECK(medium->absorption.type, SOLPARSER_MTL_DATA_REAL); - CHECK(medium->absorption.value.real, 0); + CHECK(medium->extinction.type, SOLPARSER_MTL_DATA_REAL); + CHECK(medium->extinction.value.real, 0); medium = solparser_get_medium(parser, thin->medium_t); CHECK(medium->refractive_index.type, SOLPARSER_MTL_DATA_SPECTRUM); @@ -112,8 +112,8 @@ main(int argc, char** argv) CHECK(darray_spectrum_data_cdata_get(&spectrum->data)[1].data, 2.3); CHECK(darray_spectrum_data_cdata_get(&spectrum->data)[2].data, 6.7); - CHECK(medium->absorption.type, SOLPARSER_MTL_DATA_SPECTRUM); - spectrum = solparser_get_spectrum(parser, medium->absorption.value.spectrum); + CHECK(medium->extinction.type, SOLPARSER_MTL_DATA_SPECTRUM); + spectrum = solparser_get_spectrum(parser, medium->extinction.value.spectrum); CHECK(darray_spectrum_data_size_get(&spectrum->data), 5); CHECK(darray_spectrum_data_cdata_get(&spectrum->data)[0].wavelength, 1); CHECK(darray_spectrum_data_cdata_get(&spectrum->data)[1].wavelength, 2); diff --git a/src/parser/test_solparser8.c b/src/parser/test_solparser8.c @@ -45,10 +45,10 @@ main(int argc, char** argv) NCHECK(stream, NULL); fprintf(stream, "- sun: { dni: 1, spectrum: [{wavelength: 1, data: 1 }] }\n"); - fprintf(stream, "- medium: &vacuum {refractive_index: 1, absorption: 0}\n"); + fprintf(stream, "- medium: &vacuum {refractive_index: 1, extinction: 0}\n"); fprintf(stream, "- medium: &glass \n"); fprintf(stream, " refractive_index: 1.5\n"); - fprintf(stream, " absorption: \n"); + fprintf(stream, " extinction: \n"); fprintf(stream, " - {wavelength: 1, data: 21}\n"); fprintf(stream, " - {wavelength: 2, data: 22}\n"); fprintf(stream, " - {wavelength: 3, data: 23}\n"); @@ -99,14 +99,14 @@ main(int argc, char** argv) vacuum = solparser_get_medium(parser, dielec->medium_i); CHECK(vacuum->refractive_index.type, SOLPARSER_MTL_DATA_REAL); CHECK(vacuum->refractive_index.value.real, 1); - CHECK(vacuum->absorption.type, SOLPARSER_MTL_DATA_REAL); - CHECK(vacuum->absorption.value.real, 0); + CHECK(vacuum->extinction.type, SOLPARSER_MTL_DATA_REAL); + CHECK(vacuum->extinction.value.real, 0); glass = solparser_get_medium(parser, dielec->medium_t); CHECK(glass->refractive_index.type, SOLPARSER_MTL_DATA_REAL); CHECK(glass->refractive_index.value.real, 1.5); - CHECK(glass->absorption.type, SOLPARSER_MTL_DATA_SPECTRUM); - spectrum = solparser_get_spectrum(parser, glass->absorption.value.spectrum); + CHECK(glass->extinction.type, SOLPARSER_MTL_DATA_SPECTRUM); + spectrum = solparser_get_spectrum(parser, glass->extinction.value.spectrum); CHECK(darray_spectrum_data_size_get(&spectrum->data), 6); CHECK(darray_spectrum_data_cdata_get(&spectrum->data)[0].wavelength, 1); CHECK(darray_spectrum_data_cdata_get(&spectrum->data)[1].wavelength, 2); diff --git a/src/parser/test_solparser_normal_map.c b/src/parser/test_solparser_normal_map.c @@ -40,8 +40,8 @@ test_dielectric(struct solparser* parser) fprintf(stream, "- material: &glass\n"); fprintf(stream, " front:\n"); fprintf(stream, " dielectric:\n"); - fprintf(stream, " medium_i: &out {refractive_index: 1, absorption: 0}\n"); - fprintf(stream, " medium_t: &in {refractive_index: 1.5, absorption: 20}\n"); + fprintf(stream, " medium_i: &out {refractive_index: 1, extinction: 0}\n"); + fprintf(stream, " medium_t: &in {refractive_index: 1.5, extinction: 20}\n"); fprintf(stream, " normal_map: {path: my_normal_map}\n"); fprintf(stream, " back: {dielectric: {medium_i: *in, medium_t: *out}}\n"); fprintf(stream, "\n"); @@ -267,10 +267,10 @@ test_thin_dielectric(struct solparser* parser) fprintf(stream, " thickness: 0.1\n"); fprintf(stream, " medium_i:\n"); fprintf(stream, " refractive_index: 1\n"); - fprintf(stream, " absorption: 0\n"); + fprintf(stream, " extinction: 0\n"); fprintf(stream, " medium_t:\n"); fprintf(stream, " refractive_index: 1.5\n"); - fprintf(stream, " absorption: 20\n"); + fprintf(stream, " extinction: 20\n"); fprintf(stream, " normal_map: { path: Bump }\n"); rewind(stream); diff --git a/src/parser/test_solparser_spectrum.c b/src/parser/test_solparser_spectrum.c @@ -210,10 +210,10 @@ test_thin_dielectric(struct solparser* parser) fprintf(stream, "- material:\n"); fprintf(stream, " thin_dielectric:\n"); fprintf(stream, " thickness: 1\n"); - fprintf(stream, " medium_i: { refractive_index: 1, absorption: 0 }\n"); + fprintf(stream, " medium_i: { refractive_index: 1, extinction: 0 }\n"); fprintf(stream, " medium_t: \n"); fprintf(stream, " refractive_index: *refractive_index\n"); - fprintf(stream, " absorption: *absorption\n"); + fprintf(stream, " extinction: *absorption\n"); rewind(stream); CHECK(solparser_setup(parser, NULL, stream), RES_OK); @@ -232,8 +232,8 @@ test_thin_dielectric(struct solparser* parser) mdm = solparser_get_medium(parser, thin->medium_i); CHECK(mdm->refractive_index.type, SOLPARSER_MTL_DATA_REAL); CHECK(mdm->refractive_index.value.real, 1); - CHECK(mdm->absorption.type, SOLPARSER_MTL_DATA_REAL); - CHECK(mdm->absorption.value.real, 0); + CHECK(mdm->extinction.type, SOLPARSER_MTL_DATA_REAL); + CHECK(mdm->extinction.value.real, 0); mdm = solparser_get_medium(parser, thin->medium_t); CHECK(mdm->refractive_index.type, SOLPARSER_MTL_DATA_SPECTRUM); @@ -245,7 +245,7 @@ test_thin_dielectric(struct solparser* parser) CHECK(darray_spectrum_data_cdata_get(&spectrum->data)[0].data, 1.1); CHECK(darray_spectrum_data_cdata_get(&spectrum->data)[1].data, 2.2); CHECK(darray_spectrum_data_cdata_get(&spectrum->data)[2].data, 3.3); - spectrum = solparser_get_spectrum(parser, mdm->absorption.value.spectrum); + spectrum = solparser_get_spectrum(parser, mdm->extinction.value.spectrum); CHECK(darray_spectrum_data_size_get(&spectrum->data), 2); CHECK(darray_spectrum_data_cdata_get(&spectrum->data)[0].wavelength, 0.123); CHECK(darray_spectrum_data_cdata_get(&spectrum->data)[1].wavelength, 0.456); @@ -281,10 +281,10 @@ test_dielectric(struct solparser* parser) fprintf(stream, " - { wavelength: 0.123, data: 0.1 }\n"); fprintf(stream, "- material:\n"); fprintf(stream, " dielectric:\n"); - fprintf(stream, " medium_i: { refractive_index: 1, absorption: 0 }\n"); + fprintf(stream, " medium_i: { refractive_index: 1, extinction: 0 }\n"); fprintf(stream, " medium_t: \n"); fprintf(stream, " refractive_index: *refractive_index\n"); - fprintf(stream, " absorption: *absorption\n"); + fprintf(stream, " extinction: *absorption\n"); rewind(stream); CHECK(solparser_setup(parser, NULL, stream), RES_OK); @@ -302,8 +302,8 @@ test_dielectric(struct solparser* parser) mdm = solparser_get_medium(parser, dielec->medium_i); CHECK(mdm->refractive_index.type, SOLPARSER_MTL_DATA_REAL); CHECK(mdm->refractive_index.value.real, 1); - CHECK(mdm->absorption.type, SOLPARSER_MTL_DATA_REAL); - CHECK(mdm->absorption.value.real, 0); + CHECK(mdm->extinction.type, SOLPARSER_MTL_DATA_REAL); + CHECK(mdm->extinction.value.real, 0); mdm = solparser_get_medium(parser, dielec->medium_t); CHECK(mdm->refractive_index.type, SOLPARSER_MTL_DATA_SPECTRUM); @@ -315,7 +315,7 @@ test_dielectric(struct solparser* parser) CHECK(darray_spectrum_data_cdata_get(&spectrum->data)[0].data, 1.1); CHECK(darray_spectrum_data_cdata_get(&spectrum->data)[1].data, 2.2); CHECK(darray_spectrum_data_cdata_get(&spectrum->data)[2].data, 3.3); - spectrum = solparser_get_spectrum(parser, mdm->absorption.value.spectrum); + spectrum = solparser_get_spectrum(parser, mdm->extinction.value.spectrum); CHECK(darray_spectrum_data_size_get(&spectrum->data), 2); CHECK(darray_spectrum_data_cdata_get(&spectrum->data)[0].wavelength, 0.123); CHECK(darray_spectrum_data_cdata_get(&spectrum->data)[1].wavelength, 0.456); diff --git a/src/parser/yaml/test_ko_0.yaml b/src/parser/yaml/test_ko_0.yaml @@ -252,31 +252,31 @@ # medium_t: <dielectric-medium> # -# invalid absorption +# invalid extinction - material: thin_dielectric: thickness: 0 - medium_i: &m { refractive_index: 1, absorption: -1 } + medium_i: &m { refractive_index: 1, extinction: -1 } medium_t: *m --- # invalid thickness - material: thin_dielectric: thickness: -0.01 - medium_i: &m { refractive_index: 1, absorption: 0 } + medium_i: &m { refractive_index: 1, extinction: 0 } medium_t: *m --- # invalid refractive index - material: thin_dielectric: thickness: 0 - medium_i: &m { refractive_index: 0, absorption: 0 } + medium_i: &m { refractive_index: 0, extinction: 0 } medium_t: *m --- # missing thickness - material: thin_dielectric: - medium_i: &m { refractive_index: 1, absorption: 0 } + medium_i: &m { refractive_index: 1, extinction: 0 } medium_t: *m --- @@ -290,22 +290,22 @@ # invalid refractive_index - material: dielectric: - medium_i: &m { refractive_index: 0, absorption: 0 } + medium_i: &m { refractive_index: 0, extinction: 0 } medium_t: *m --- -# invalid absorption +# invalid extinction - material: dielectric: - medium_i: &m { refractive_index: 1, absorption: -1 } + medium_i: &m { refractive_index: 1, extinction: -1 } medium_t: *m --- # missing refractive_index - material: dielectric: - medium_i: &m { absorption: 0 } + medium_i: &m { extinction: 0 } medium_t: *m --- -# missing absorption +# missing extinction - material: dielectric: medium_i: &m { refractive_index: 1 } @@ -314,12 +314,12 @@ # missing medium_i - material: dielectric: - medium_t: { refractive_index: 1, absorption: 0 } + medium_t: { refractive_index: 1, extinction: 0 } --- # missing medium_t - material: dielectric: - medium_i: { refractive_index: 1, absorption: 0 } + medium_i: { refractive_index: 1, extinction: 0 } --- # @@ -1897,7 +1897,7 @@ # # <atmosphere> ::= # atmosphere: -# absorption: <mtl-data> # in [0, 1] +# extinction: <mtl-data> # in [0, 1] # # missing atmosphere definition @@ -1907,30 +1907,30 @@ - atmosphere: dummy: 1 --- -# missing absorption definition +# missing extinction definition - atmosphere: - absorption: + extinction: --- -# absorption should be a number +# extinction should be a number - atmosphere: - absorption: "dummy" + extinction: "dummy" --- # 2 invalid - atmosphere: - absorption: 2 + extinction: 2 --- # 0 invalid - atmosphere: - absorption: [{wavelength: 0, data: 1}] + extinction: [{wavelength: 0, data: 1}] --- # 2 invalid - atmosphere: - absorption: [{wavelength: 0, data: 2}] + extinction: [{wavelength: 0, data: 2}] --- -# 2x absorption +# 2x extinction - atmosphere: - absorption: 0.1 - absorption: [{wavelength: 1, data: 1}] + extinction: 0.1 + extinction: [{wavelength: 1, data: 1}] --- # @@ -1967,6 +1967,6 @@ --- # 2x atmosphere - atmosphere: - absorption: 0.1 + extinction: 0.1 - atmosphere: - absorption: 0.1 + extinction: 0.1 diff --git a/src/parser/yaml/test_ok_5.yaml b/src/parser/yaml/test_ok_5.yaml @@ -3,8 +3,8 @@ - material: &thin_dielectric thin_dielectric: thickness: 1 - medium_i: { absorption: 0, refractive_index: 1.00027 } - medium_t: { absorption: 0.1, refractive_index: 1.5 } + medium_i: { extinction: 0, refractive_index: 1.00027 } + medium_t: { extinction: 0.1, refractive_index: 1.5 } - entity: name: "entity" @@ -18,8 +18,8 @@ - material: &thin_dielectric thin_dielectric: thickness: 0 - medium_i: { absorption: 0, refractive_index: 0.00027 } - medium_t: { absorption: 0.1, refractive_index: 1.5 } + medium_i: { extinction: 0, refractive_index: 0.00027 } + medium_t: { extinction: 0.1, refractive_index: 1.5 } - entity: name: "entity" @@ -38,6 +38,6 @@ material: thin_dielectric: thickness: 10 - medium_i: { absorption: 0, refractive_index: 1 } - medium_t: { absorption: 20, refractive_index: 1.5 } + medium_i: { extinction: 0, refractive_index: 1 } + medium_t: { extinction: 20, refractive_index: 1.5 } diff --git a/src/parser/yaml/test_ok_7.yaml b/src/parser/yaml/test_ok_7.yaml @@ -2,8 +2,8 @@ - material: &dielectric dielectric: - medium_i: { absorption: 0, refractive_index: 1.00027 } - medium_t: { absorption: 0.1, refractive_index: 1.5 } + medium_i: { extinction: 0, refractive_index: 1.00027 } + medium_t: { extinction: 0.1, refractive_index: 1.5 } - entity: name: "entity" @@ -16,8 +16,8 @@ - material: &dielectric dielectric: - medium_i: { absorption: 0, refractive_index: 0.00027 } - medium_t: { absorption: 0.1, refractive_index: 1.5 } + medium_i: { extinction: 0, refractive_index: 0.00027 } + medium_t: { extinction: 0.1, refractive_index: 1.5 } - entity: name: "entity" @@ -35,13 +35,13 @@ - cylinder: { height: 1, radius: 1 } material: dielectric: - medium_i: { absorption: 0, refractive_index: 1 } - medium_t: { absorption: 20, refractive_index: 1.5 } + medium_i: { extinction: 0, refractive_index: 1 } + medium_t: { extinction: 20, refractive_index: 1.5 } --- - sun: { dni: 1 } -- medium: &vacuum { refractive_index: 1, absorption: 0 } -- medium: &glass { refractive_index: 1.5, absorption: 20 } +- medium: &vacuum { refractive_index: 1, extinction: 0 } +- medium: &glass { refractive_index: 1.5, extinction: 20 } - entity: name: "entity" primary: 0 diff --git a/src/solstice.c b/src/solstice.c @@ -115,6 +115,22 @@ clear_nodes(struct darray_nodes* nodes) darray_nodes_clear(nodes); } +static void +clear_anchors(struct htable_anchor* anchors) +{ + struct htable_anchor_iterator it, end; + ASSERT(anchors); + + htable_anchor_begin(anchors, &it); + htable_anchor_end(anchors, &end); + while(!htable_anchor_iterator_eq(&it, &end)) { + struct solstice_node* node = *htable_anchor_iterator_data_get(&it); + solstice_node_ref_put(node); + htable_anchor_iterator_next(&it); + } + htable_anchor_clear(anchors); +} + static res_T auto_look_at (struct ssol_scene* scn, @@ -676,6 +692,7 @@ solstice_release(struct solstice* solstice) clear_materials(&solstice->materials); clear_objects(&solstice->objects); clear_nodes(&solstice->roots); + clear_anchors(&solstice->anchors); /* Don't clear pivots, as they are cleared from some root */ if(solstice->ssol) SSOL(device_ref_put(solstice->ssol)); if(solstice->scene) SSOL(scene_ref_put(solstice->scene)); diff --git a/src/solstice_atmosphere.c b/src/solstice_atmosphere.c @@ -23,7 +23,7 @@ res_T solstice_create_atmosphere(struct solstice* solstice) { struct ssol_atmosphere* atm = NULL; - struct ssol_data absorption = SSOL_DATA_NULL; + struct ssol_data extinction = SSOL_DATA_NULL; const struct solparser_atmosphere* solparser_atm = NULL; res_T res = RES_OK; ASSERT(solstice); @@ -34,12 +34,12 @@ solstice_create_atmosphere(struct solstice* solstice) res = ssol_atmosphere_create(solstice->ssol, &atm); if(res != RES_OK) goto error; - res = mtl_to_ssol_data(solstice, &solparser_atm->absorption, &absorption); + res = mtl_to_ssol_data(solstice, &solparser_atm->extinction, &extinction); if(res != RES_OK) goto error; - res = ssol_atmosphere_set_absorption(atm, &absorption); + res = ssol_atmosphere_set_extinction(atm, &extinction); if(res != RES_OK) { - fprintf(stderr, "Could not set atmosphere absorbtion.\n"); + fprintf(stderr, "Could not set atmosphere extinction.\n"); goto error; } @@ -50,7 +50,7 @@ solstice_create_atmosphere(struct solstice* solstice) } exit: - ssol_data_clear(&absorption); + ssol_data_clear(&extinction); solstice->atmosphere = atm; return res; error: diff --git a/src/solstice_entity.c b/src/solstice_entity.c @@ -389,9 +389,6 @@ create_node res = solstice_node_add_child(node, tgt); if(res != RES_OK) goto error; - - solstice_node_ref_put(tgt); - tgt = NULL; } /* Setup children */ @@ -464,15 +461,6 @@ solstice_setup_entities(struct solstice* solstice) goto error; } - /* Initialialised the world space position of the entity geometry */ - res = sanim_node_visit_tree - (&root->anim, dummy_sun_dir, solstice, update_instance_transform); - if(res != RES_OK) { - fprintf(stderr, - "Could not setup the transformation of the entity geometries.\n"); - goto error; - } - res = darray_nodes_push_back(&solstice->roots, &root); if(res != RES_OK) { fprintf(stderr, "Could not register a root entity.\n"); @@ -483,6 +471,13 @@ solstice_setup_entities(struct solstice* solstice) root = NULL; } + /* Initialise the world space position of the geometries */ + res = solstice_update_entities(solstice, dummy_sun_dir); + if(res != RES_OK) { + fprintf(stderr, "Could not setup the initial position of the entities.\n"); + goto error; + } + exit: str_release(&name); return res; @@ -502,7 +497,6 @@ solstice_update_entities(struct solstice* solstice, const double sun_dir[3]) FOR_EACH(i, 0, n) { struct solstice_node* node = darray_nodes_data_get(&solstice->roots)[i]; - /* Initialialised the world space position of the entity geometry */ res = sanim_node_visit_tree (&node->anim, sun_dir, solstice, update_instance_transform); if(res != RES_OK) { diff --git a/src/solstice_material.c b/src/solstice_material.c @@ -335,8 +335,8 @@ create_material_dielectric } (void)0 SET_SSOL_DATA(medium_i, refractive_index); SET_SSOL_DATA(medium_t, refractive_index); - SET_SSOL_DATA(medium_i, absorption); - SET_SSOL_DATA(medium_t, absorption); + SET_SSOL_DATA(medium_i, extinction); + SET_SSOL_DATA(medium_t, extinction); #undef SET_SSOL_DATA SSOL(dielectric_setup(mtl, &shader, &ssol_medium_i, &ssol_medium_t)); @@ -547,8 +547,8 @@ create_material_thin_dielectric } (void)0 SET_SSOL_DATA(medium_i, refractive_index); SET_SSOL_DATA(medium_t, refractive_index); - SET_SSOL_DATA(medium_i, absorption); - SET_SSOL_DATA(medium_t, absorption); + SET_SSOL_DATA(medium_i, extinction); + SET_SSOL_DATA(medium_t, extinction); #undef SET_SSOL_DATA SSOL(thin_dielectric_setup (mtl, &shader, &ssol_medium_i, &ssol_medium_t, thin->thickness)); diff --git a/src/solstice_solve.c b/src/solstice_solve.c @@ -19,6 +19,11 @@ #include <solstice/ssol.h> #include <star/ssp.h> +/* How many percent of random walk realisations may fail before solve() stops + * in a standard solve() invocation. + * It is not used when solve() is invoked in order to dump paths. */ +#define MAX_PERCENT_FAILURES 0.01 + /******************************************************************************* * Helper function ******************************************************************************/ @@ -60,7 +65,7 @@ write_mc_global(struct solstice* solstice, struct ssol_estimator* estimator) PRINT_MC_GLOBAL(shadowed); PRINT_MC_GLOBAL(missing); PRINT_MC_GLOBAL(other_absorbed); - PRINT_MC_GLOBAL(absorbed_by_atmosphere); + PRINT_MC_GLOBAL(extinguished_by_atmosphere); #undef PRINT_MC_GLOBAL /* Receivers' data */ @@ -102,16 +107,30 @@ write_mc_global(struct solstice* solstice, struct ssol_estimator* estimator) SSOL(instance_get_area(inst, &area)); fprintf(solstice->output, "%s %u %g " + "%g %g %g %g %g %g %g %g %g %g %g %g " "%g %g %g %g %g %g %g %g %g %g " + "%g %g %g %g %g %g %g %g %g %g %g %g " "%g %g %g %g %g %g %g %g %g %g\n", str_cget(name), (unsigned)id, area, - front.absorbed_flux.E, front.absorbed_flux.SE, front.incoming_flux.E, front.incoming_flux.SE, + front.incoming_if_no_field_loss.E, front.incoming_if_no_field_loss.SE, + front.incoming_if_no_atm_loss.E, front.incoming_if_no_atm_loss.SE, + front.incoming_lost_in_field.E, front.incoming_lost_in_field.SE, + front.incoming_lost_in_atmosphere.E, front.incoming_lost_in_atmosphere.SE, + front.absorbed_flux.E, front.absorbed_flux.SE, + front.absorbed_if_no_field_loss.E, front.absorbed_if_no_field_loss.SE, + front.absorbed_if_no_atm_loss.E, front.absorbed_if_no_atm_loss.SE, front.absorbed_lost_in_field.E, front.absorbed_lost_in_field.SE, front.absorbed_lost_in_atmosphere.E, front.absorbed_lost_in_atmosphere.SE, f_eff_E, f_eff_SE, - back.absorbed_flux.E, back.absorbed_flux.SE, back.incoming_flux.E, back.incoming_flux.SE, + back.incoming_if_no_field_loss.E, back.incoming_if_no_field_loss.SE, + back.incoming_if_no_atm_loss.E, back.incoming_if_no_atm_loss.SE, + back.incoming_lost_in_field.E, back.incoming_lost_in_field.SE, + back.incoming_lost_in_atmosphere.E, back.incoming_lost_in_atmosphere.SE, + back.absorbed_flux.E, back.absorbed_flux.SE, + back.absorbed_if_no_field_loss.E, back.absorbed_if_no_field_loss.SE, + back.absorbed_if_no_atm_loss.E, back.absorbed_if_no_atm_loss.SE, back.absorbed_lost_in_field.E, back.absorbed_lost_in_field.SE, back.absorbed_lost_in_atmosphere.E, back.absorbed_lost_in_atmosphere.SE, b_eff_E, b_eff_SE); @@ -176,15 +195,29 @@ write_mc_global(struct solstice* solstice, struct ssol_estimator* estimator) } fprintf(solstice->output, "%u %u " + "%g %g %g %g %g %g %g %g %g %g %g %g " "%g %g %g %g %g %g %g %g " + "%g %g %g %g %g %g %g %g %g %g %g %g " "%g %g %g %g %g %g %g %g\n", (unsigned) rcv_id, (unsigned) prim_id, - front.absorbed_flux.E, front.absorbed_flux.SE, front.incoming_flux.E, front.incoming_flux.SE, + front.incoming_if_no_field_loss.E, front.incoming_if_no_field_loss.SE, + front.incoming_if_no_atm_loss.E, front.incoming_if_no_atm_loss.SE, + front.incoming_lost_in_field.E, front.incoming_lost_in_field.SE, + front.incoming_lost_in_atmosphere.E, front.incoming_lost_in_atmosphere.SE, + front.absorbed_flux.E, front.absorbed_flux.SE, + front.absorbed_if_no_field_loss.E, front.absorbed_if_no_field_loss.SE, + front.absorbed_if_no_atm_loss.E, front.absorbed_if_no_atm_loss.SE, front.absorbed_lost_in_field.E, front.absorbed_lost_in_field.SE, front.absorbed_lost_in_atmosphere.E, front.absorbed_lost_in_atmosphere.SE, - back.absorbed_flux.E, back.absorbed_flux.SE, back.incoming_flux.E, back.incoming_flux.SE, + back.incoming_if_no_field_loss.E, back.incoming_if_no_field_loss.SE, + back.incoming_if_no_atm_loss.E, back.incoming_if_no_atm_loss.SE, + back.incoming_lost_in_field.E, back.incoming_lost_in_field.SE, + back.incoming_lost_in_atmosphere.E, back.incoming_lost_in_atmosphere.SE, + back.absorbed_flux.E, back.absorbed_flux.SE, + back.absorbed_if_no_field_loss.E, back.absorbed_if_no_field_loss.SE, + back.absorbed_if_no_atm_loss.E, back.absorbed_if_no_atm_loss.SE, back.absorbed_lost_in_field.E, back.absorbed_lost_in_field.SE, back.absorbed_lost_in_atmosphere.E, back.absorbed_lost_in_atmosphere.SE); htable_primary_iterator_next(&p_it); @@ -472,6 +505,7 @@ solstice_solve(struct solstice* solstice) { struct ssol_estimator* estimator = NULL; struct ssp_rng* rng = NULL; + size_t max_failure; res_T res = RES_OK; ASSERT(solstice); @@ -481,7 +515,11 @@ solstice_solve(struct solstice* solstice) goto error; } - res = ssol_solve(solstice->scene, rng, solstice->nexperiments, + max_failure = solstice->dump_paths ? + solstice->nexperiments + : (size_t)((double)solstice->nexperiments * MAX_PERCENT_FAILURES); + + res = ssol_solve(solstice->scene, rng, solstice->nexperiments, max_failure, solstice->dump_paths ? &solstice->path_tracker : NULL, &estimator); if(res != RES_OK) { fprintf(stderr, "Error in integrating the solar flux.\n"); diff --git a/src/solstice_sun.c b/src/solstice_sun.c @@ -105,10 +105,10 @@ create_sun_pillbox goto error; } - res = ssol_sun_set_pillbox_aperture - (sun, MDEG2RAD(solparser_sun->radang_distrib.pillbox.aperture)); + res = ssol_sun_pillbox_set_theta_max + (sun, MDEG2RAD(solparser_sun->radang_distrib.pillbox.theta_max)); if(res != RES_OK) { - fprintf(stderr, "Could not setup the aperture of the solver pillbox sun.\n"); + fprintf(stderr, "Could not setup theta_max for the solver pillbox sun.\n"); goto error; } @@ -143,7 +143,7 @@ create_default_sun_spectrum size_t size; res_T res = RES_OK; - /* The solparser_sun may be used if the defautl spectrum is defined wrt the + /* The solparser_sun may be used if the default spectrum is defined wrt the * sun type */ (void)solparser_sun; diff --git a/yaml/beam_down.ref b/yaml/beam_down.ref @@ -1,52 +1,52 @@ #--- Sun direction: 90 90 (-3.7494e-33 -6.12323e-17 -1) -7 2 5 100000 0 +7 2 5 10000 0 500.043 0 -465.46 0.0057839 -0.930834 1.15684e-05 +465.484 0.0183212 +0.930888 3.66392e-05 0 0 0 0 0 0 0 0 -tower.secondary.hyperbol 10 421.957 0 0 465.46 0.0057839 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -tower.receptor 14 25 465.46 0.0057839 465.46 0.0057839 0 0 0 0 0.93084 1.15668e-05 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -heliostat4.temp-heliostat150.pivot.reflector 6 100.009 19915 0.931616 2.47038e-05 0 0 -heliostat5.temp-heliostat150.pivot.reflector 30 100.009 20068 0.929594 2.509e-05 0 0 -heliostat3.temp-heliostat150.pivot.reflector 22 100.009 19919 0.931716 2.47979e-05 0 0 -heliostat2.temp-heliostat150.pivot.reflector 26 100.009 20054 0.93164 2.4549e-05 0 0 -heliostat1.temp-heliostat150.pivot.reflector 34 100.009 20044 0.929616 2.5199e-05 0 0 -10 6 0 0 92.7742 0.588324 0 0 0 0 0 0 0 0 0 0 0 0 -10 30 0 0 93.2842 0.588736 0 0 0 0 0 0 0 0 0 0 0 0 -10 22 0 0 92.8029 0.588432 0 0 0 0 0 0 0 0 0 0 0 0 -10 26 0 0 93.4242 0.589876 0 0 0 0 0 0 0 0 0 0 0 0 -10 34 0 0 93.1748 0.588486 0 0 0 0 0 0 0 0 0 0 0 0 -14 6 92.7742 0.588324 92.7742 0.588324 0 0 0 0 -1 -1 -1 -1 -1 -1 -1 -1 -14 30 93.2842 0.588736 93.2842 0.588736 0 0 0 0 -1 -1 -1 -1 -1 -1 -1 -1 -14 22 92.8029 0.588432 92.8029 0.588432 0 0 0 0 -1 -1 -1 -1 -1 -1 -1 -1 -14 26 93.4242 0.589876 93.4242 0.589876 0 0 0 0 -1 -1 -1 -1 -1 -1 -1 -1 -14 34 93.1748 0.588486 93.1748 0.588486 0 0 0 0 -1 -1 -1 -1 -1 -1 -1 -1 +tower.secondary.hyperbol 10 421.957 465.484 0.0183212 465.484 0.0183212 465.484 0.0183212 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +tower.receptor 14 25 465.484 0.0183212 465.484 0.0183212 465.484 0.0183212 0 0 0 0 465.484 0.0183212 465.484 0.0183212 465.484 0.0183212 0 0 0 0 0.930888 3.66392e-05 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 +heliostat4.temp-heliostat150.pivot.reflector 6 100.009 1999 0.931645 7.76782e-05 0 0 +heliostat5.temp-heliostat150.pivot.reflector 30 100.009 1986 0.929678 7.95031e-05 0 0 +heliostat3.temp-heliostat150.pivot.reflector 22 100.009 1997 0.931827 7.8194e-05 0 0 +heliostat2.temp-heliostat150.pivot.reflector 26 100.009 1994 0.931626 7.95559e-05 0 0 +heliostat1.temp-heliostat150.pivot.reflector 34 100.009 2024 0.929675 7.9316e-05 0 0 +10 6 93.126 1.86312 93.126 1.86312 93.126 1.86312 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +10 30 92.325 1.85463 92.325 1.85463 92.325 1.85463 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +10 22 93.051 1.86278 93.051 1.86278 93.051 1.86278 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +10 26 92.8912 1.86133 92.8912 1.86133 92.8912 1.86133 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +10 34 94.0913 1.86784 94.0913 1.86784 94.0913 1.86784 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +14 6 93.126 1.86312 93.126 1.86312 93.126 1.86312 0 0 0 0 93.126 1.86312 93.126 1.86312 93.126 1.86312 0 0 0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 +14 30 92.325 1.85463 92.325 1.85463 92.325 1.85463 0 0 0 0 92.325 1.85463 92.325 1.85463 92.325 1.85463 0 0 0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 +14 22 93.051 1.86278 93.051 1.86278 93.051 1.86278 0 0 0 0 93.051 1.86278 93.051 1.86278 93.051 1.86278 0 0 0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 +14 26 92.8912 1.86133 92.8912 1.86133 92.8912 1.86133 0 0 0 0 92.8912 1.86133 92.8912 1.86133 92.8912 1.86133 0 0 0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 +14 34 94.0913 1.86784 94.0913 1.86784 94.0913 1.86784 0 0 0 0 94.0913 1.86784 94.0913 1.86784 94.0913 1.86784 0 0 0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 #--- Sun direction: 50 50 (-0.413176 -0.492404 -0.766044) -7 2 5 100000 0 +7 2 5 10000 0 500.043 0 -135.852 0.602426 -0.800261 7.05527e-05 +136.561 1.90791 +0.800384 0.000222269 0 0 -245.21 0.615008 -19.1054 0.268227 +244.012 1.94769 +19.6535 0.85974 0 0 -tower.secondary.hyperbol 10 421.957 0 0 400.167 0.0352796 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -tower.receptor 14 25 135.852 0.602426 135.852 0.602426 0 0 0 0 0.271681 0.00120475 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -heliostat4.temp-heliostat150.pivot.reflector 6 100.009 20095 0.785227 4.21758e-05 0 0 -heliostat5.temp-heliostat150.pivot.reflector 30 100.009 20027 0.769756 4.33957e-05 0 0 -heliostat3.temp-heliostat150.pivot.reflector 22 100.009 19777 0.799897 4.08915e-05 0 0 -heliostat2.temp-heliostat150.pivot.reflector 26 100.009 19976 0.815845 3.92572e-05 0 0 -heliostat1.temp-heliostat150.pivot.reflector 34 100.009 20125 0.830515 3.78765e-05 0 0 -10 6 0 0 78.903 0.497568 0 0 0 0 0 0 0 0 0 0 0 0 -10 30 0 0 77.0867 0.487147 0 0 0 0 0 0 0 0 0 0 0 0 -10 22 0 0 79.1052 0.503835 0 0 0 0 0 0 0 0 0 0 0 0 -10 26 0 0 81.4942 0.515816 0 0 0 0 0 0 0 0 0 0 0 0 -10 34 0 0 83.5784 0.526554 0 0 0 0 0 0 0 0 0 0 0 0 -14 6 22.1799 0.286704 22.1799 0.286704 0 0 0 0 -1 -1 -1 -1 -1 -1 -1 -1 -14 30 18.6614 0.26147 18.6614 0.26147 0 0 0 0 -1 -1 -1 -1 -1 -1 -1 -1 -14 22 25.3271 0.308097 25.3271 0.308097 0 0 0 0 -1 -1 -1 -1 -1 -1 -1 -1 -14 26 31.6777 0.345324 31.6777 0.345324 0 0 0 0 -1 -1 -1 -1 -1 -1 -1 -1 -14 34 38.0063 0.378737 38.0063 0.378737 0 0 0 0 -1 -1 -1 -1 -1 -1 -1 -1 +tower.secondary.hyperbol 10 421.957 400.227 0.111144 400.227 0.111144 400.227 0.111144 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +tower.receptor 14 25 136.561 1.90791 136.561 1.90791 136.561 1.90791 0 0 0 0 136.561 1.90791 136.561 1.90791 136.561 1.90791 0 0 0 0 0.273098 0.0038155 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 +heliostat4.temp-heliostat150.pivot.reflector 6 100.009 2045 0.785215 0.000131988 0 0 +heliostat5.temp-heliostat150.pivot.reflector 30 100.009 1956 0.769715 0.000138356 0 0 +heliostat3.temp-heliostat150.pivot.reflector 22 100.009 1948 0.799928 0.000131691 0 0 +heliostat2.temp-heliostat150.pivot.reflector 26 100.009 2049 0.815877 0.000121947 0 0 +heliostat1.temp-heliostat150.pivot.reflector 34 100.009 2002 0.830429 0.000118476 0 0 +10 6 80.2952 1.58372 80.2952 1.58372 80.2952 1.58372 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +10 30 75.2847 1.52678 75.2847 1.52678 75.2847 1.52678 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +10 22 77.9198 1.58423 77.9198 1.58423 77.9198 1.58423 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +10 26 83.5939 1.64675 83.5939 1.64675 83.5939 1.64675 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +10 34 83.1332 1.66167 83.1332 1.66167 83.1332 1.66167 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +14 6 22.2344 0.907756 22.2344 0.907756 22.2344 0.907756 0 0 0 0 22.2344 0.907756 22.2344 0.907756 22.2344 0.907756 0 0 0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 +14 30 18.29 0.819036 18.29 0.819036 18.29 0.819036 0 0 0 0 18.29 0.819036 18.29 0.819036 18.29 0.819036 0 0 0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 +14 22 24.7238 0.963323 24.7238 0.963323 24.7238 0.963323 0 0 0 0 24.7238 0.963323 24.7238 0.963323 24.7238 0.963323 0 0 0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 +14 26 33.4259 1.11916 33.4259 1.11916 33.4259 1.11916 0 0 0 0 33.4259 1.11916 33.4259 1.11916 33.4259 1.11916 0 0 0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 +14 34 37.8866 1.19599 37.8866 1.19599 37.8866 1.19599 0 0 0 0 37.8866 1.19599 37.8866 1.19599 37.8866 1.19599 0 0 0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 diff --git a/yaml/test01.ref b/yaml/test01.ref @@ -7,6 +7,6 @@ 1 0 0 0 0 0 -square_receiver 2 100 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 0 1 0 0 0 0 0 0 0 +square_receiver 2 100 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 reflector 6 1 10000 1 0 0 0 -2 6 -1 -1 -1 -1 -1 -1 -1 -1 0 0 1 0 0 0 0 0 +2 6 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 diff --git a/yaml/test02.ref b/yaml/test02.ref @@ -1,12 +1,12 @@ #--- Sun direction: 0 90 (-6.12323e-17 -0 -1) 7 1 1 10000 0 100 0 -0.91 0.0949589 +0.96 0.0975082 1 0 0 0 -99.09 0.0949589 +99.04 0.0975082 0 0 0 0 -square_receiver 2 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0.91 0.0949589 0.91 0.0949589 0 0 0 0 0.0091 0.000949589 +square_receiver 2 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0.96 0.0975082 0.96 0.0975082 0.96 0.0975082 0 0 0 0 0.96 0.0975082 0.96 0.0975082 0.96 0.0975082 0 0 0 0 0.0096 0.000975082 reflector 6 100 10000 1 0 0 0 -2 6 -1 -1 -1 -1 -1 -1 -1 -1 0.91 0.0949589 0.91 0.0949589 0 0 0 0 +2 6 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0.96 0.0975082 0.96 0.0975082 0.96 0.0975082 0 0 0 0 0.96 0.0975082 0.96 0.0975082 0.96 0.0975082 0 0 0 0 diff --git a/yaml/test03.ref b/yaml/test03.ref @@ -2,11 +2,11 @@ 7 1 1 10000 0 1 0 0 0 -0.707107 2.44511e-09 +0.707107 0 0 0 -0.707107 2.44511e-09 +0.707107 0 0 0 0 0 -square_receiver 2 100 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 0 0.707107 2.44511e-09 0 0 0 0 0 0 -reflector 6 1 10000 0.707107 2.44511e-09 0 0 -2 6 -1 -1 -1 -1 -1 -1 -1 -1 0 0 0.707107 2.44511e-09 0 0 0 0 +square_receiver 2 100 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0.707107 0 0.707107 0 0.707107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +reflector 6 1 10000 0.707107 0 0 0 +2 6 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0.707107 0 0.707107 0 0.707107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 diff --git a/yaml/test04.ref b/yaml/test04.ref @@ -2,11 +2,11 @@ 7 1 1 10000 0 1 0 0 0 -0.707107 2.44511e-09 +0.707107 0 0 0 -0.707107 2.44511e-09 +0.707107 0 0 0 0 0 -square_receiver 2 100 0 0 0 0 0 0 0 0 0 0 0 0 0.707107 2.44511e-09 0 0 0 0 0 0 -reflector 6 1 10000 0.707107 2.44511e-09 0 0 -2 6 0 0 0 0 0 0 0 0 0 0 0.707107 2.44511e-09 0 0 0 0 +square_receiver 2 100 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.707107 0 0.707107 0 0.707107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +reflector 6 1 10000 0.707107 0 0 0 +2 6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.707107 0 0.707107 0 0.707107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 diff --git a/yaml/test05.ref b/yaml/test05.ref @@ -7,6 +7,6 @@ 1 0 0 0 0 0 -spherical_receiver 2 50.2403 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 0 1 0 0 0 0 0 0 0 +spherical_receiver 2 50.2403 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 reflector 6 1 10000 1 0 0 0 -2 6 -1 -1 -1 -1 -1 -1 -1 -1 0 0 1 0 0 0 0 0 +2 6 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 diff --git a/yaml/test06.ref b/yaml/test06.ref @@ -2,11 +2,11 @@ 7 1 1 10000 0 111.97 0 0 0 -0.896777 0.000575378 +0.893096 2.98023e-10 0 0 -100 2.33602e-08 +100 0 0 0 0 0 -reflector.ground.pivot.small_square 10 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 0 100 2.33602e-08 0 0 0 0 0 0 -reflector.ground.pivot.parabol 6 111.97 10000 0.896777 0.000575378 0 0 -10 6 -1 -1 -1 -1 -1 -1 -1 -1 0 0 100 2.33602e-08 0 0 0 0 +reflector.ground.pivot.small_square 10 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 100 0 100 0 100 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +reflector.ground.pivot.parabol 6 111.97 10000 0.893096 2.98023e-10 0 0 +10 6 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 100 0 100 0 100 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 diff --git a/yaml/test07.ref b/yaml/test07.ref @@ -2,11 +2,11 @@ 7 1 1 10000 0 56.3501 0 0 0 -0.66742 0.00232559 +0.498544 0 0 0 -28.093 5.04637e-08 +28.093 4.0179e-08 0 0 0 0 -square_receiver 2 100 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 0 28.0902 0.00280916 0 0 0 0 0 0 -reflector 6 56.3501 10000 0.66742 0.00232559 0 0 -2 6 -1 -1 -1 -1 -1 -1 -1 -1 0 0 28.0902 0.00280916 0 0 0 0 +square_receiver 2 100 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 28.093 4.0179e-08 28.093 4.0179e-08 28.093 4.0179e-08 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +reflector 6 56.3501 10000 0.498544 0 0 0 +2 6 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 28.093 4.0179e-08 28.093 4.0179e-08 28.093 4.0179e-08 0 0 0 0 0 0 0 0 0 0 0 0 0 0 diff --git a/yaml/test07.yaml b/yaml/test07.yaml @@ -1,7 +1,7 @@ - sun: &sun { dni: 1 } - atmosphere: - absorption: [{wavelength: 1, data: 0},{wavelength: 10, data: 0}] + extinction: [{wavelength: 1, data: 0},{wavelength: 10, data: 0}] - material: &specular front: diff --git a/yaml/test08.ref b/yaml/test08.ref @@ -2,11 +2,11 @@ 7 1 1 10000 0 85.5109 0 0 0 -0.918392 0.000433033 +0.917002 1.82501e-10 0 0 -78.4137 0 +78.4137 2.86102e-08 0 0 0 0 -reflector.pivot.small_square 6 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 0 78.4137 0 0 0 0 0 0 0 -reflector.pivot.parabol 2 85.5109 10000 0.918392 0.000433033 0 0 -6 2 -1 -1 -1 -1 -1 -1 -1 -1 0 0 78.4137 0 0 0 0 0 +reflector.pivot.small_square 6 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 78.4137 2.86102e-08 78.4137 2.86102e-08 78.4137 2.86102e-08 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +reflector.pivot.parabol 2 85.5109 10000 0.917002 1.82501e-10 0 0 +6 2 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 78.4137 2.86102e-08 78.4137 2.86102e-08 78.4137 2.86102e-08 0 0 0 0 0 0 0 0 0 0 0 0 0 0 diff --git a/yaml/test08.yaml b/yaml/test08.yaml @@ -1,7 +1,7 @@ - sun: &sun { dni: 1 } - atmosphere: - absorption: 0 + extinction: 0 - material: &lambertian front: