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 0096b6316cee27f9db74578a9bc3a305b71ed010
parent 790d023eea1e41e435e02d9a1e92e2d3f660d3ff
Author: Christophe Coustet <christophe.coustet@meso-star.com>
Date:   Tue, 26 Sep 2017 12:24:55 +0200

Rename pillbox parameter aperture in theta_max.

An aperture is a size, not an angle.

Diffstat:
Mdoc/solstice-input.5.txt | 10+++++-----
Msrc/parser/solparser_sun.c | 16++++++++--------
Msrc/parser/solparser_sun.h | 2+-
Msrc/solstice_sun.c | 6+++---
4 files changed, 17 insertions(+), 17 deletions(-)

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/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/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; }