commit a9e5942b7666db917afe4cfd6bd0efc70d50a8db
parent c2b8369207dd14d023cefc92adcbb152355f61c5
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Thu, 28 Sep 2017 14:21:53 +0200
Merge branch 'release_0.6.1'
Diffstat:
9 files changed, 104 insertions(+), 93 deletions(-)
diff --git a/README.md b/README.md
@@ -60,9 +60,16 @@ informations on CMake.
## Release notes
+### Version 0.6.1
+
+- Fix the solstice-input man page. The `extinction` parameter of the medium and
+ the atmosphere was named `absorption`.
+- Rename the pillbox `theta_max` parameter in `half_angle`.
+
### Version 0.6
-- Rename the atmosphere `absorption` parameter in `extinction`.
+- Rename the `absorption` parameter of the medium and the athmosphere 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
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.6 REQUIRED)
+find_package(SolSolver 0.6.1 REQUIRED)
find_package(Star3DUT 0.2 REQUIRED)
find_package(StarSP 0.4 REQUIRED)
find_package(StarSTL 0.3.1 REQUIRED)
@@ -97,7 +97,7 @@ configure_file(${SOLSTICE_SOURCE_DIR}/../doc/solstice.1.txt.in
set(VERSION_MAJOR 0)
set(VERSION_MINOR 6)
-set(VERSION_PATCH 0)
+set(VERSION_PATCH 1)
set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})
configure_file(${SOLSTICE_SOURCE_DIR}/solstice_version.h.in
diff --git a/doc/solstice-input.5.txt b/doc/solstice-input.5.txt
@@ -205,7 +205,7 @@ _______
<medium> ::= medium: <medium-descriptor>
<medium-descriptor> ::= refractive_index: <mtl-data> # in ]0, INF)
- absorption: <mtl-data> # in [0, INF)
+ extinction: <mtl-data> # in [0, INF)
----------------------------------------
@@ -253,12 +253,12 @@ _______
csr: REAL # in [1e-6, 0.849]
<pillbox> ::= pillbox:
- theta_max: REAL # in ]0, 90]
+ half_angle: REAL # in ]0, 90]
----------------------------------------
<atmosphere> ::= atmosphere:
- absorption: <mtl-data> # in [0, 1]
+ extinction: <mtl-data> # in [0, 1]
----------------------------------------
@@ -318,8 +318,8 @@ shapes are:
*pillbox*::
The *pillbox* distribution defines an uniform intensity over the sun's disk.
- 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.
+ Its single *half_angle* parameter is the sun's disk half-angle in degrees, that
+ is linked to the apparent size of the sun. A typical half_angle is 0.2664.
*buie*::
The *buie* distribution, as first discribed in [3]. Its single *csr*
@@ -331,13 +331,13 @@ ATMOSPHERE
----------
The *atmosphere*, when provided, describes the medium surrounding the
-solar plant. Its only parameter is its absorption coefficient in m^-1, that
-can either be a scalar if the *absorption* is constant over the spectrum, or
-can be spectrally described. The absorption along light paths is only computed
+solar plant. Its only parameter is its extinction coefficient in m^-1, that
+can either be a scalar if the *extinction* is constant over the spectrum, or
+can be spectrally described. The extinction along light paths is only computed
after the first reflector, as sun description must include all the atmospheric
effects before the first reflector (see sun description for more details).
-If no atmosphere is provided, atmospheric absorption after the first reflector
+If no atmosphere is provided, atmospheric extinction after the first reflector
is not taken into account.
MATERIAL
@@ -387,8 +387,8 @@ dielectrics with inverted media:
material:
front:
dielectric:
- medium_i: &vacuum { refractive_index: 1, absorption: 0 }
- medium_t: &glass { refractive_index: 1.5, absorption: 20 }
+ medium_i: &vacuum { refractive_index: 1, extinction: 0 }
+ medium_t: &glass { refractive_index: 1.5, extinction: 20 }
back:
dielectric:
medium_i: *glass
@@ -397,13 +397,13 @@ material:
+
If the media consistency is not ensured, *solstice*(1) will fail to run
simulations. Note that by default, the surrounding medium is assumed to be
-the vacuum, i.e. its refractive index and its absorption are scalars whose
+the vacuum, i.e. its refractive index and its extinction are scalars whose
values are 1 and 0, respectively. If an atmosphere is defined, the refractive
-index of the surrounding medium is still the scalar 1 but its absorption is
+index of the surrounding medium is still the scalar 1 but its extinction is
the one of the atmosphere. In other words, to reference the surrounding medium
in the *medium_i* or the *medium_t* attribute of a *dielectric* interface, one
-has to define a medium whose refractive index is the scalar 1 and absorption
-is either 0 or the absorption of the atmosphere if the latter is defined or
+has to define a medium whose refractive index is the scalar 1 and extinction
+is either 0 or the extinction of the atmosphere if the latter is defined or
not, respectively.
*matte*::
@@ -450,12 +450,12 @@ ray travelling in a medium _A_ can only encounter a medium interface whose
*medium_i* attribute is _A_. If the media consistency is not ensured,
*solstice*(1) will fail to run simulations. Note that by default, the
surrounding medium is assumed to be the vacuum, i.e. its refractive index and
-its absorption are scalars whose values are 1 and 0, respectively. If an
+its extinction are scalars whose values are 1 and 0, respectively. If an
atmosphere is defined, the refractive index of the surrounding medium is still
-the scalar 1 but its absorption is the one of the atmosphere. In other words,
+the scalar 1 but its extinction is the one of the atmosphere. In other words,
to reference the surrounding medium in the *medium_i* attribute of a
*thin-dielectric* interface, one has to define a medium whose refractive
-index is the scalar 1 and absorption is either 0 or the absorption of the
+index is the scalar 1 and extinction is either 0 or the extinction of the
atmosphere if the latter is defined.
*virtual*::
@@ -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 theta_max is 0.1 degree. Use anchors and tags of the
+pillbox-shaped sun whose *half_angle* 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: {theta_max: 0.1}}
+- sun: {dni: 1000, pillbox: {half_angle: 0.1}}
- geometry: &small-circle
- material: {matte: {reflectivity: 1}}
@@ -1011,7 +1011,7 @@ a *cuboid* using a glass material is located between the hyperbol and the
target. In this example, a small fraction of incoming power is absorbed by the
target. The rest is either missing the target, absorbed or refracted by the
glass. Furthermore, this example illustrates the use of a *spectrum* for
-*refractive index* and *absorption* by various *media* (air and glass).
+*refractive index* and *extinction* by various *media* (air and glass).
.......
# Spectra
- spectrum: &solar_spectrum
@@ -1049,15 +1049,15 @@ glass. Furthermore, this example illustrates the use of a *spectrum* for
# Media
- medium: &air_medium
refractive_index: 1
- absorption: *air_kabs
+ extinction: *air_kabs
- medium: &glass_medium
refractive_index: *glass_ref_index
- absorption: *glass_kabs
+ extinction: *glass_kabs
# Sun & atmosphere
- sun: {dni: 1, spectrum: *solar_spectrum}
-- atmosphere: {absorption: *air_kabs}
+- atmosphere: {extinction: *air_kabs}
# Materials
- material: &specular {mirror: {reflectivity: 1, roughness: 0}}
diff --git a/doc/solstice-output.5.txt b/doc/solstice-output.5.txt
@@ -112,10 +112,10 @@ _______
<front> ::= <side>
<back> ::= <side>
-<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>
+<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>"
-------------------------------------
@@ -141,10 +141,10 @@ _______
<rcvXprim-front> ::= <rcvXprim-side>
<rcvXprim-back> ::= <rcvXprim-side>
-<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>"
+<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>"
-------------------------------------
@@ -212,24 +212,25 @@ the exact number of lines being part of the headers. Currently this number is
7. Each global result is a pair of real numbers: the expected value and its
standard error. The global results are, in this order:
-- *potential-flux*: maximum flux that all the primary
- geometries could intercept if properly oriented and flat-shaped;
-- *absorbed-flux*: absorbed part of the flux reaching any
- receiver geometry. At most equal to the potential flux;
+- *potential-flux*: maximum flux that all the primary geometries could
+ intercept if properly oriented and flat-shaped;
+- *absorbed-flux*: absorbed part of the flux reaching any 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;
-- *materials-loss*: total flux absorbed by non-receivers along radiative paths;
- includes both surface and volume absorption;
-- *atmospheric-loss*: total flux extinction by the atmosphere along radiative paths.
+ radiative path, but is not absorbed; this flux could have bounced on
+ geometries, including receivers, but without being absorbed;
+- *materials-loss*: total flux absorbed by non-receivers along radiative
+ paths; includes both surface and volume absorption;
+- *atmospheric-loss*: total flux extinction by the atmosphere along radiative
+ paths.
This results can be used to check conservation of energy:
-potential-flux * cos-factor and (absorbed-flux + shadow-loss +
+potential-flux * cos-factor and (absorbed-flux + shadow-loss +
missing-loss + materials-loss + atmospheric-loss)
should be equal whithin their respective uncertainty ranges.
@@ -253,17 +254,17 @@ each of the following estimates is actually a pair of real numbers: the
expected value and its standard error.
- *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-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-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.
@@ -275,9 +276,9 @@ side are meaningless (invalid -1 value).
Per primary results
~~~~~~~~~~~~~~~~~~~
-Following the per-receiver results, the output includes various per-primary result
-lines, one line per primary geometry, the exact number of lines being part of
-the headers. Each line contains:
+Following the per-receiver results, the output includes various per-primary
+result lines, one line per primary geometry, the exact number of lines being
+part of the headers. Each line contains:
- *primary-name*: name of the primary geometry, i.e. *entity-identifier* of
the entity in in which the primary geometry is defined (see the
@@ -294,9 +295,9 @@ the headers. Each line contains:
Per receiver and per primary results
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Following the per-primary results, the output includes various result lines, each
-describing the contribution of a primary geometry to a given receiver. The
-total number of such lines is the number of receivers times the number of
+Following the per-primary results, the output includes various result lines,
+each describing the contribution of a primary geometry to a given receiver.
+The total number of such lines is the number of receivers times the number of
primary geometries. Each line contains:
- *receiver-id*: identifier of the involved receiver;
@@ -309,17 +310,17 @@ bellow. Each of these estimates is actually a pair of real numbers: the
expected value and its standard error.
- *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-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-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;
@@ -490,7 +491,7 @@ VTK-RADIATIVE-PATHS ::= # vtk DataFile Version 2.0
| 0.5 # Blue: for success paths
| 0.75 # Turquoise: for missing paths
| 1.0 # Yellow: for occluded paths
-
+
<color-error> ::= 1.0 0.0 0.0 1.0
<color-unused> ::= 0.0 1.0 0.0 1.0
<color-success> ::= 0.0 0.0 1.0 1.0
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 { THETA_MAX };
+ enum { HALF_ANGLE };
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, "theta_max")) {
- if(mask & BIT(THETA_MAX)) {
- log_err(parser, key, "the pillbox `theta_max' is already defined.\n");
+ if(!strcmp((char*)key->data.scalar.value, "half_angle")) {
+ if(mask & BIT(HALF_ANGLE)) {
+ log_err(parser, key, "the pillbox `half_angle' is already defined.\n");
res = RES_BAD_ARG;
goto error;
}
- mask |= BIT(THETA_MAX);
- res = parse_real(parser, val, nextafter(0, 1), 90, &sun->theta_max);
+ mask |= BIT(HALF_ANGLE);
+ res = parse_real(parser, val, nextafter(0, 1), 90, &sun->half_angle);
} else {
log_err(parser, pillbox, "unknown pillbox parameter `%s'.\n",
key->data.scalar.value);
@@ -138,8 +138,8 @@ parse_pillbox
}
}
- if(!(mask & BIT(THETA_MAX))) {
- log_err(parser, pillbox, "the pillbox theta_max parameter is missing.\n");
+ if(!(mask & BIT(HALF_ANGLE))) {
+ log_err(parser, pillbox, "the pillbox half_angle 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 theta_max; };
+struct solparser_sun_pillbox { double half_angle; };
struct solparser_sun {
double dni; /* In ]0, INF) */
diff --git a/src/parser/yaml/test_ko_0.yaml b/src/parser/yaml/test_ko_0.yaml
@@ -72,26 +72,26 @@
#
# <pillbox> ::=
# pillbox:
-# aperture: REAL # in ]0, 90]
+# half_angle: REAL # in ]0, 90]
#
# missing pillbox definition
- sun: { pillbox: }
---
-# missing aperture value
-- sun: { pillbox: { aperture: } }
+# missing half_angle value
+- sun: { pillbox: { half_angle: } }
---
-# aperture should be a number
-- sun: { pillbox: { aperture: "dummy"} }
+# half_angle should be a number
+- sun: { pillbox: { half_angle: "dummy"} }
---
# 0 invalid
-- sun: { pillbox: { aperture: 0} }
+- sun: { pillbox: { half_angle: 0} }
---
# 91 invalid
-- sun: { pillbox: { aperture: 91} }
+- sun: { pillbox: { half_angle: 91} }
---
-# 2x aperture
-- sun: { pillbox: { aperture: 1, aperture: 1} }
+# 2x half_angle
+- sun: { pillbox: { half_angle: 1, half_angle: 1} }
---
# unknown dummy parameter
- sun: { pillbox: { dummy: 1} }
@@ -152,7 +152,7 @@
---
# 2x radial-angular-distribution
- sun:
- pillbox: { aperture: 1}
+ pillbox: { half_angle: 1}
buie: { csr: 0.5}
---
diff --git a/src/parser/yaml/test_ok_1.yaml b/src/parser/yaml/test_ok_1.yaml
@@ -38,7 +38,10 @@
primary: 0
geometry: *cylinder
---
-- sun: { dni: 1, spectrum: [{wavelength: 1, data: 1}] }
+- sun:
+ dni: 1
+ pillbox: {half_angle: 0.064}
+
- entity:
name: entity
primary: 1
diff --git a/src/solstice_sun.c b/src/solstice_sun.c
@@ -105,10 +105,10 @@ create_sun_pillbox
goto error;
}
- res = ssol_sun_pillbox_set_theta_max
- (sun, MDEG2RAD(solparser_sun->radang_distrib.pillbox.theta_max));
+ res = ssol_sun_pillbox_set_half_angle
+ (sun, MDEG2RAD(solparser_sun->radang_distrib.pillbox.half_angle));
if(res != RES_OK) {
- fprintf(stderr, "Could not setup theta_max for the solver pillbox sun.\n");
+ fprintf(stderr, "Could not setup half_angle for the solver pillbox sun.\n");
goto error;
}