commit 2159bfc23ebd2d1ab743681e9ed6e602a6da241f
parent 0183a927c8752ebf40b2948fcd1ae69de87f31c0
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Mon, 18 Sep 2017 10:55:39 +0200
Add the cyl project
Diffstat:
4 files changed, 234 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
@@ -19,7 +19,7 @@ INSTALL_PATH = /usr/local/bin
SOURCES = solpp.c solppraw.c solpaths.c
PROG = $(SOURCES:%.c=%)
-PROJECTS = themis
+PROJECTS = themis cyl
.PHONY: default
default: all
diff --git a/cyl/Makefile b/cyl/Makefile
@@ -0,0 +1,63 @@
+# Copyright (C) |Meso|Star> 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 ../Makefile.in
+
+NEXPERIMENTS=10000000
+NPATHS=1000
+SUN_DIRS=270,40
+
+RCV=cyl-rcv.yaml
+INPUT=cyl.yaml
+GEOM=geom
+SIMUL=simul
+
+PATH := $(PATH):.:../
+
+.PHONY: default
+default: all
+
+.PHONY: all
+all: run
+
+.PHONY: simul
+simul: $(INPUT)
+ @tput bold
+ @echo -e ">>> Run simulation: Sun dirs = $(SUN_DIRS); #Experiments = $(NEXPERIMENTS)"
+ @tput sgr0
+ @solstice -D$(SUN_DIRS) -n$(NEXPERIMENTS) -R$(RCV) -fo $(SIMUL) $(INPUT)
+ @solstice -D$(SUN_DIRS) -g format=obj:split=geometry -fo $(GEOM) $(INPUT)
+ @solppraw $(SIMUL)
+ @solpp $(GEOM) $(SIMUL)
+
+.PHONY: paths
+paths: $(PROG) $(INPUT)
+ @tput bold
+ @echo -e ">>> Sample paths: Sun dirs = $(SUN_DIRS); #Paths = $(NPATHS)"
+ @tput sgr0
+ @solstice -D$(SUN_DIRS) -q -n$(NPATHS) -R$(RCV) -p default $(INPUT) | solpaths
+
+.PHONY: run
+run: paths simul
+
+.PHONY: clean
+clean:
+ @rm -rf $(GEOM) $(SIMUL) \
+ *-miscellaneous.obj \
+ *-paths.vtk \
+ *-primaries.vtk \
+ *-receivers.vtk \
+ *-raw-results.txt
+
diff --git a/cyl/cyl-rcv.yaml b/cyl/cyl-rcv.yaml
@@ -0,0 +1,5 @@
+########################################
+# Receivers
+########################################
+- {name: parab_trough_e.pt_pivot.tube_steel, side: FRONT_AND_BACK, per_primitive: 1}
+- {name: pt_2_e.pt_pivot.tube_steel, side: FRONT_AND_BACK, per_primitive: 1}
+\ No newline at end of file
diff --git a/cyl/cyl.yaml b/cyl/cyl.yaml
@@ -0,0 +1,164 @@
+# Copyright (C) CNRS 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/>.
+
+# TUTORIAL MICROSOL-R
+# This YAML file describes the parabolic-trough collector and receiver systems
+# where concentrated solar fluxes are computed with SOLSTICE.
+# http://www.equipex-socrate.fr/equipements/microsol-r.html
+
+################################################################################
+# Sun & Atmosphere
+################################################################################
+# Only the Direct Normal Irradiation (DNI) from the sun is set. As an example
+# here, no solar spectrum is considered, but we also could define a solar
+# intensity spectrum.
+- sun: &sun
+ dni: 1000
+
+################################################################################
+# Materials
+################################################################################
+- medium: &air
+ refractive_index: 1
+ absorption: 0
+
+- medium: &glass
+ refractive_index: 1.2
+ absorption: 0.02
+
+- medium: &vacuum
+ refractive_index: 1
+ absorption: 0
+
+# Define a material purely absorbant (e.g. for pylons)
+- material: &occultant
+ front: {matte: {reflectivity: 0}}
+ back: {matte: {reflectivity: 0}}
+
+# Define a specular material for the reflectors
+- material: &specular
+ front: {mirror: {reflectivity: 0.9, roughness: 0}}
+ back: {matte: {reflectivity: 0.0}}
+
+# Define a diffusely reflecting material for the receiver
+- material: &lambertian
+ front: {matte: {reflectivity: 0.06}}
+ back: {matte: {reflectivity: 0.0}}
+
+# Define a refractive interface between air and glass
+- material: &refractive_out
+ front:
+ dielectric: # --> Front|Back
+ medium_i: *air # medium travelling in before hitting Front
+ medium_t: *glass # medium of refraction
+ back:
+ dielectric: # Front|Back <---
+ medium_i: *glass # medium travelling in before hitting Back
+ medium_t: *air # medium of refraction
+
+# Define a refractive interface between glass and vacuum
+- material: &refractive_in
+ front:
+ dielectric: # --> Front|Back
+ medium_i: *glass # medium travelling in before hitting Front
+ medium_t: *vacuum # medium of refraction
+ back:
+ dielectric: # Front|Back <---
+ medium_i: *vacuum # medium travelling in before hitting Back
+ medium_t: *glass # medium of refraction
+
+################################################################################
+# Geometries
+################################################################################
+# Define the geometry of the parabolic-cylinder mirror surface
+- geometry: &reflector
+ - material: *specular
+ transform: {translation: [0, 0, 0], rotation: [0, 0, 0]}
+ parabolic-cylinder:
+ focal: 1.73
+ slices: 32
+ clip:
+ - operation: AND
+ vertices: [[-6, -2.38], [-6, 2.38], [ 6, 2.38], [ 6, -2.38]]
+
+# Define the tube surface of the receiver
+- geometry: &tube_steel_g
+ - material: *lambertian
+ transform: {translation: [0, 0, 0], rotation: [0, 90, 0]}
+ cylinder:
+ height: 12
+ radius: 0.07
+ slices: 128
+ stacks: 32
+
+# Define the tube surface of the internal glass interface
+- geometry: &tube_glass_in_g
+ - material: *refractive_in
+ transform: {translation: [0, 0, 0], rotation: [0, 90, 0]}
+ cylinder: {height: 12, radius: 0.119, slices: 256, stacks: 32 }
+
+# Define the tube surface of the external glass interface
+- geometry: &tube_glass_out_g
+ - material: *refractive_out
+ transform: {translation: [0, 0, 0], rotation: [0, 90, 0]}
+ cylinder: {height: 12, radius: 0.125, slices: 256, stacks: 32 }
+
+################################################################################
+# Template of the parabolic trough (includes tubes and mirror)
+################################################################################
+# Create a template to link the tracking (pivot) with the surfaces of the
+# parabolic-trough geometry
+- template: ¶b_trough_t
+ name: pt_pivot
+ transform: {translation: [0, 0, 0],rotation: [0, 0, 0]}
+ x_pivot:
+ target: { sun: *sun }
+ ref_point: [0, 0, 0]
+ children:
+# Include the reflector
+ - name: pt_reflector
+ primary: 1
+ transform: { rotation: [0, 0, 0]}
+ geometry: *reflector
+# Include the glass tube internal interface
+ - name: tube_glass_in
+ primary: 0
+ transform: { translation: [0, 0, 1.73], rotation: [0, 0, 0]}
+ geometry: *tube_glass_in_g
+# Include the glass tube external interface
+ - name: tube_glass_out
+ primary: 0
+ transform: { translation: [0, 0, 1.73], rotation: [0, 0, 0]}
+ geometry: *tube_glass_out_g
+# Include the receiver tube
+ - name: tube_steel
+ primary: 0
+ transform: { translation: [0, 0, 1.73], rotation: [0, 0, 0]}
+ geometry: *tube_steel_g
+
+################################################################################
+# Entities defined to appear in the scene to simulate
+################################################################################
+# Define the parabolic-trough module and locate it inside the scene
+- entity:
+ name: parab_trough_e
+ transform: {translation: [0, 0, 0], rotation: [0, 0, 0]}
+ children: [*parab_trough_t]
+# Define another one in another location
+- entity:
+ name: pt_2_e
+ transform: {translation: [0, 10, 0], rotation: [0, 0, 0]}
+ children: [*parab_trough_t]
+