stardis-spk

Scripts and datasets for running Stardis simulations
git clone git://git.meso-star.fr/stardis-spk.git
Log | Files | Refs | README | LICENSE

commit dd7e94f9767d20a8550ad92ee11ae61d581c67f5
parent 65c46426f4051946d0db6bac02359c87b0164ec0
Author: Benjamin Piaud <benjamin.piaud@meso-star.com>
Date:   Fri,  4 Dec 2020 10:09:51 +0100

cube example

Diffstat:
Acube/analytical_T.txt | 401+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Acube/center_bc.stl | 2++
Acube/left_bc.stl | 2++
Acube/model.txt | 7+++++++
Acube/right_bc.stl | 2++
Acube/run_dump_path.sh | 40++++++++++++++++++++++++++++++++++++++++
Acube/run_green_evaluation.sh | 53+++++++++++++++++++++++++++++++++++++++++++++++++++++
Acube/run_probe_computation.sh | 51+++++++++++++++++++++++++++++++++++++++++++++++++++
Acube/solid.stl | 2++
Areadme.md | 151++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
10 files changed, 711 insertions(+), 0 deletions(-)

diff --git a/cube/analytical_T.txt b/cube/analytical_T.txt @@ -0,0 +1,401 @@ +0 300 +1 300.2 +2 300.4 +3 300.6 +4 300.8 +5 301 +6 301.2 +7 301.399 +8 301.597 +9 301.795 +10 301.99 +11 302.185 +12 302.377 +13 302.566 +14 302.754 +15 302.939 +16 303.121 +17 303.3 +18 303.477 +19 303.65 +20 303.821 +21 303.989 +22 304.153 +23 304.315 +24 304.474 +25 304.63 +26 304.783 +27 304.933 +28 305.08 +29 305.225 +30 305.367 +31 305.506 +32 305.642 +33 305.776 +34 305.907 +35 306.036 +36 306.162 +37 306.286 +38 306.407 +39 306.526 +40 306.643 +41 306.757 +42 306.87 +43 306.98 +44 307.087 +45 307.193 +46 307.297 +47 307.399 +48 307.498 +49 307.596 +50 307.692 +51 307.786 +52 307.878 +53 307.968 +54 308.057 +55 308.144 +56 308.229 +57 308.312 +58 308.394 +59 308.474 +60 308.553 +61 308.63 +62 308.706 +63 308.78 +64 308.853 +65 308.924 +66 308.994 +67 309.062 +68 309.13 +69 309.196 +70 309.26 +71 309.323 +72 309.386 +73 309.446 +74 309.506 +75 309.565 +76 309.622 +77 309.678 +78 309.733 +79 309.787 +80 309.841 +81 309.892 +82 309.943 +83 309.993 +84 310.042 +85 310.09 +86 310.138 +87 310.184 +88 310.229 +89 310.273 +90 310.317 +91 310.36 +92 310.401 +93 310.442 +94 310.483 +95 310.522 +96 310.561 +97 310.599 +98 310.636 +99 310.672 +100 310.708 +101 310.743 +102 310.777 +103 310.811 +104 310.844 +105 310.876 +106 310.908 +107 310.939 +108 310.97 +109 311 +110 311.029 +111 311.058 +112 311.086 +113 311.114 +114 311.141 +115 311.167 +116 311.193 +117 311.219 +118 311.244 +119 311.268 +120 311.292 +121 311.316 +122 311.339 +123 311.362 +124 311.384 +125 311.406 +126 311.427 +127 311.448 +128 311.469 +129 311.489 +130 311.509 +131 311.528 +132 311.547 +133 311.566 +134 311.584 +135 311.602 +136 311.619 +137 311.637 +138 311.654 +139 311.67 +140 311.686 +141 311.702 +142 311.718 +143 311.733 +144 311.748 +145 311.763 +146 311.777 +147 311.791 +148 311.805 +149 311.819 +150 311.832 +151 311.845 +152 311.858 +153 311.87 +154 311.883 +155 311.895 +156 311.907 +157 311.918 +158 311.93 +159 311.941 +160 311.952 +161 311.962 +162 311.973 +163 311.983 +164 311.993 +165 312.003 +166 312.013 +167 312.022 +168 312.032 +169 312.041 +170 312.05 +171 312.059 +172 312.067 +173 312.076 +174 312.084 +175 312.092 +176 312.1 +177 312.108 +178 312.116 +179 312.123 +180 312.131 +181 312.138 +182 312.145 +183 312.152 +184 312.159 +185 312.165 +186 312.172 +187 312.178 +188 312.185 +189 312.191 +190 312.197 +191 312.203 +192 312.208 +193 312.214 +194 312.22 +195 312.225 +196 312.231 +197 312.236 +198 312.241 +199 312.246 +200 312.251 +201 312.256 +202 312.261 +203 312.265 +204 312.27 +205 312.274 +206 312.279 +207 312.283 +208 312.287 +209 312.292 +210 312.296 +211 312.3 +212 312.304 +213 312.307 +214 312.311 +215 312.315 +216 312.318 +217 312.322 +218 312.326 +219 312.329 +220 312.332 +221 312.336 +222 312.339 +223 312.342 +224 312.345 +225 312.348 +226 312.351 +227 312.354 +228 312.357 +229 312.36 +230 312.362 +231 312.365 +232 312.368 +233 312.37 +234 312.373 +235 312.375 +236 312.378 +237 312.38 +238 312.382 +239 312.385 +240 312.387 +241 312.389 +242 312.391 +243 312.393 +244 312.396 +245 312.398 +246 312.4 +247 312.402 +248 312.403 +249 312.405 +250 312.407 +251 312.409 +252 312.411 +253 312.413 +254 312.414 +255 312.416 +256 312.418 +257 312.419 +258 312.421 +259 312.422 +260 312.424 +261 312.425 +262 312.427 +263 312.428 +264 312.43 +265 312.431 +266 312.432 +267 312.434 +268 312.435 +269 312.436 +270 312.437 +271 312.439 +272 312.44 +273 312.441 +274 312.442 +275 312.443 +276 312.444 +277 312.446 +278 312.447 +279 312.448 +280 312.449 +281 312.45 +282 312.451 +283 312.452 +284 312.453 +285 312.454 +286 312.454 +287 312.455 +288 312.456 +289 312.457 +290 312.458 +291 312.459 +292 312.46 +293 312.46 +294 312.461 +295 312.462 +296 312.463 +297 312.463 +298 312.464 +299 312.465 +300 312.465 +301 312.466 +302 312.467 +303 312.467 +304 312.468 +305 312.469 +306 312.469 +307 312.47 +308 312.47 +309 312.471 +310 312.472 +311 312.472 +312 312.473 +313 312.473 +314 312.474 +315 312.474 +316 312.475 +317 312.475 +318 312.476 +319 312.476 +320 312.477 +321 312.477 +322 312.478 +323 312.478 +324 312.478 +325 312.479 +326 312.479 +327 312.48 +328 312.48 +329 312.48 +330 312.481 +331 312.481 +332 312.482 +333 312.482 +334 312.482 +335 312.483 +336 312.483 +337 312.483 +338 312.484 +339 312.484 +340 312.484 +341 312.485 +342 312.485 +343 312.485 +344 312.485 +345 312.486 +346 312.486 +347 312.486 +348 312.487 +349 312.487 +350 312.487 +351 312.487 +352 312.488 +353 312.488 +354 312.488 +355 312.488 +356 312.489 +357 312.489 +358 312.489 +359 312.489 +360 312.489 +361 312.49 +362 312.49 +363 312.49 +364 312.49 +365 312.49 +366 312.491 +367 312.491 +368 312.491 +369 312.491 +370 312.491 +371 312.491 +372 312.492 +373 312.492 +374 312.492 +375 312.492 +376 312.492 +377 312.492 +378 312.493 +379 312.493 +380 312.493 +381 312.493 +382 312.493 +383 312.493 +384 312.493 +385 312.494 +386 312.494 +387 312.494 +388 312.494 +389 312.494 +390 312.494 +391 312.494 +392 312.494 +393 312.494 +394 312.495 +395 312.495 +396 312.495 +397 312.495 +398 312.495 +399 312.495 +400 312.495 diff --git a/cube/center_bc.stl b/cube/center_bc.stl @@ -0,0 +1 @@ +#$# git-wad 3de038d32c61a445ec20652370f22f52b65614850150347eac6889d9f509eaf6 1648 +\ No newline at end of file diff --git a/cube/left_bc.stl b/cube/left_bc.stl @@ -0,0 +1 @@ +#$# git-wad 876d9b008b9dea17bfcbee7f0cb7a831c2534575858678e75f8e3d3222636a67 441 +\ No newline at end of file diff --git a/cube/model.txt b/cube/model.txt @@ -0,0 +1,7 @@ +#medium +SOLID CUBE 0.1 25 2 0.01 300 UNKNOWN 10 FRONT solid.stl + +#boundary conditions +T_BOUNDARY_FOR_SOLID LTEMP 300 left_bc.stl +F_BOUNDARY_FOR_SOLID ADIA 0 center_bc.stl +T_BOUNDARY_FOR_SOLID RTEMP 300 right_bc.stl diff --git a/cube/right_bc.stl b/cube/right_bc.stl @@ -0,0 +1 @@ +#$# git-wad fd7d5175e6dae815f1d411dda3dbdd381f25e0559aadf0472c61a943484fbb72 440 +\ No newline at end of file diff --git a/cube/run_dump_path.sh b/cube/run_dump_path.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# Copyright (C) 2020 |Meso|Star> +# +# 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/>. + + +### USER PARAMETERS SECTION +NPATH=10 +GEOM_FILE=geom.vtk +PATH_FILE_PREFIX=path +X=0.5 +Y=0.5 +Z=0.5 +TIME=inf +### END USER PARAMETERS SECTION + +#erase previous files if exist +rm -f $GEOM_FILE ${PATH_FILE_PREFIX}* + +#launch Stardis to dump geometry in vtk format +stardis -V 3 -M model.txt -d > $GEOM_FILE + +#launch Stardis to dump path for the probe X,Y,Z,TIME +stardis -V 3 -M model.txt -p $X,$Y,$Z,$TIME -n $NPATH -D all,$PATH_FILE_PREFIX + + +echo " " +echo ">>> You can now visualize the paths in the geometry with opening $GEOM_FILE and ${PATH_FILE_PREFIX}xxxxx.vtk files in paraview." +echo " " diff --git a/cube/run_green_evaluation.sh b/cube/run_green_evaluation.sh @@ -0,0 +1,53 @@ +#!/bin/bash +# Copyright (C) 2020 |Meso|Star> +# +# 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/>. + + +### USER PARAMETERS SECTION +NREAL=10000 +X=0.5 +Y=0.5 +Z=0.5 +SOURCES_AND_BOUNDARIES="CUBE.VP = 12 LTEMP.T = 290 RTEMP.T = 310 ADIA.F = 5.2" +GREEN_FILE=probe_X${X}-Y${Y}-Z${Z}_N${NREAL}.green +SETTINGS_FILE=settings.txt +### END USER PARAMETERS SECTION + + +if [ -f "$GREEN_FILE" ]; then + echo " " + echo ">>> $GREEN_FILE exists." + echo ">>> Compute probe temperature by applying new source and boundary to the Green function." + echo " " + echo $SOURCES_AND_BOUNDARIES > $SETTINGS_FILE + sgreen -g $GREEN_FILE -a $SETTINGS_FILE -e + echo " " +else + echo " " + echo ">>> $GREEN_FILE does not exist." + echo ">>> Need to compute the Green function with stardis." + echo " " + #launch stardis to produce the Green function for the probe X,Y,Z at steady state + stardis -M model.txt -p $X,$Y,$Z -n $NREAL -G $GREEN_FILE + echo " " + echo ">>> Now, compute probe temperature by applying new source and boundary to the Green function." + echo " " + echo $SOURCES_AND_BOUNDARIES > $SETTINGS_FILE + sgreen -g $GREEN_FILE -a $SETTINGS_FILE -e + sgreen -g $GREEN_FILE -s ${GREEN_FILE}.html + echo " " + echo ">>> A html report (${GREEN_FILE}.html) was also produced about the Green function." + echo " " +fi diff --git a/cube/run_probe_computation.sh b/cube/run_probe_computation.sh @@ -0,0 +1,51 @@ +#!/bin/bash +# Copyright (C) 2020 |Meso|Star> +# +# 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/>. + + +### USER PARAMETERS SECTION +NREAL=10000 +TIME=("10" "50" "100" "200" "300" "400") +FILE=stardis_result_N$NREAL.txt +### END USER PARAMETERS SECTION + + +#erase FILE result if exists +rm -f $FILE + +#launch Stardis for each defined TIME +echo "#time Temperature errorbar N_failures N_Realizations" >> $FILE +for i in ${TIME[@]}; +do +echo -n "$i " >> $FILE +stardis -V 3 -M model.txt -p 0.5,0.5,0.5,$i -n $NREAL >> $FILE +done + +echo " " +echo ">>> Stardis simulation done" +echo ">>> Results are written in $FILE" +echo " " + +#plot result with gnuplot +if command -v gnuplot > /dev/null +then + rm -f plot.gp + echo "plot 'analytical_T.txt' w l title 'Analytical'" >> plot.gp + echo "replot '$FILE' u 1:2:3 w yerrorbar title 'Stardis'" >> plot.gp + echo "pause -1" >> plot.gp + gnuplot plot.gp +else + echo "gnuplot is not install on your system. You can install gnuplot or view the simulation results in other tool." +fi diff --git a/cube/solid.stl b/cube/solid.stl @@ -0,0 +1 @@ +#$# git-wad f15a98f85d714f1c9bd60eb982bf8ea6a41baf8e983803a4982add027dd8022a 2451 +\ No newline at end of file diff --git a/readme.md b/readme.md @@ -0,0 +1,151 @@ +# Stardis: Starter Pack + +The Stardis: Starter Pack is a collection of few examples of input data ready +for computing with Stardis. It also provides GNU Bash scripts that make easier +the invocation of the stardis program. That gives an overview of the required +input data and the features of stardis. + + +# Install and run + +Download the Stardis: Starter-Pack archive and verify its integrity against +its PGP signature. Then extract it. Assuming that stardis is installed and +registered in the current shell. Then you can browse into the subdirectory and +run stardis program. For instance you can launch the first script in cube +directory: + +$ cd ~/Stardis-Starter-Pack-0.X.X/cube +~/Stardis-Starter-Pack-0.X.X/cube $ bash ./run_probe_computation.sh + +With ~/Stardis-Starter-Pack-0.6.0 the directory where the Starter Pack is +installed. + +Each example and their launching scripts are explained hereafter. + +# The cube + +This example is simply a cube with a constant source term in whole volume. Only +the conduction is considered in this example. + +The interest of this example is to be able to compare with an analytical solution. + +The 3 scripts illustrate 3 of the features of Stardis: the *probe computation*, +the *visualization of thermal paths* and the *Green function evaluation*. + + +## the data + +The geometrical data are described in ASCII STL format. So the cube is given by +the **solid.stl** file. If you visualize the stl file with a software like +paraview or meshlab, you can see the cube is described by a basic triangulation. +Stardis does not require a fine meshing. The computation is not based on any +geometrical meshing. The STL file must only describe the contour of a solid. + +You can see three other STL files: **left_bc.stl**, **right_bc.stl** and +**center_bc.stl**. This files are required to attach the boundary conditions to +the geometry. We note an important constraint in the CAD process: the triangles +in these boundary STL files which coincide with the triangles in the solid STL +files must be *rigorously* the same. This *conformal mesh* constraint is also +required for adjacent solids that share a common interface. + +Finally you can watch the **model.txt** file which is the Stardis input data +files. In this file we *connect*: + +- the physical properties (thermal conductivity, thermal capacity, ...) to the + geometrical data (here solid.stl only); + +- the boundary condition description to the geometrical data. You can see here a + fiexd temperature is apply to the boundaries represented by right_bc.stl and + left_bc.stl and null flux condition to the boundaries represented by + center_bc.stl. + +You can refer to stardis-input man page to read this file and modify it as you +wish. + + +## Probe computation + +The script **run_probe_computation.sh** invokes the stardis program to compute +the temperature of the center of the cube for different times. The results will +be written in a file and plotted with gnuplot (if you it is installed) to be +compared to the analytical solution (analytical_T.txt) + +Assuming the current shell directory is ~/Stardis-Starter-Pack-0.X.X/cube, you +can run script as below: + +$ bash ./run_probe_computation.sh + +You can also simply invoke stardis program to compute the temperature at +the center of the cube in the steady steady by typing in the shell: + +$ stardis -M model.txt -p 0.5,0.5,0.5,INF -e + +You can refer to the stardis man page. + +You can also open and modify the bash script. There is a section "USER +PARAMETERS SECTION" in which you can modify the numbers of Monte-Carlo +realisations or the time of the probe. + + +## Dump some "thermal paths" + +The script **run_dump_paths.sh** invokes stardis twice: + +- first to dump the scene in **vtk** format. This feature is useful to check the + integrity of the geometrical data. For instance if the stl files describe + non-conformal triangle mesh, some errors will be indicated in the vtk file. + +- to produce some "thermal paths" beginnning from the probe. Vizualise these + paths is a useful tool to analyze the thermal phenomenon. This example is + simple but it is very interesting to see the thermal paths in complex geometry + with radiative, convective and conductive coupled heat transfers. + +You can change the numbers of paths or the probe position in the script. + + +## Green function evaluation + +The last script **run_green_evaluation.sh** shows how produce a Green function +evalutation with stardis and how use it with the sgreen program. + +If you launch the script a first time, stardis will produce an evaluation of the +Green function by generating the thermal and storing some data (the end position +of paths) in a binary file. This Green function is evaluating only for a probe +(defined in the "USER PARAMETER SECTION"). If you change **X**, **Y**, **Z** or +the number of Monte-Carlo realizations **NREAL**, it will produce another Green +function. + +This Green function is independent of the value of the sources (boundary +conditions value and heat volumic dissipation) + +Now, if you launch the script again. The sgreen program will process the Green +function to compute the probe temperature. + +If you want to compute the probe temperature for another set of the sources, you +can change in the script the value of the line: + +``` +SOURCES_AND_BOUNDARIES="CUBE.VP = 12 LTEMP.T = 290 RTEMP.T = 310 ADIA.F = 5.2" +``` + +with **CUBE.VP** the value of the heat volumic dissipation (in W/m^3). **LTEMP.T** and +**RTEMP.T** are the temperature value of the left (LTEMP) and right (RTEMP) +boundaries. And **ADIA.F** is the value of the heat flux density imposed to the +boundary ADIA (in W/m^2). + +The names **CUBE**, **RTEMP**, **LTEMP** and **ADIA** refer to the names given +in the file **model.txt** + +We note also you can not define at this stage the value ADIA.T because in the +file model.txt, the boundary ADIA is defined with imposed value for the flux +density with the keyword **F_BOUNDARY_FOR_SOLID**. If you want fix the +temperature at this boundary, you must write another model.txt file and with the +keyword **T_BOUNDARY_FOR_SOLID** for this boundary. + + +# Download + + +# Copyright notice + +# Licence