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 36b980c0a77b162353d563cf5c5f634fc19d9c23
parent 16a3aeb79c5ef9e10153516d7d0ed9b5dc8a8dca
Author: Benjamin Piaud <benjamin.piaud@meso-star.com>
Date:   Tue,  1 Mar 2022 15:24:07 +0100

Mise à jour modèle pour Picard et passage à shell POSIX

Diffstat:
Mcity/model.txt | 15+++++++++------
Mcity/run_IR_rendering.sh | 11+++++------
Mcube/run_dump_path.sh | 13++++++-------
Mcube/run_green_evaluation.sh | 25++++++++++++-------------
Mcube/run_probe_computation.sh | 31+++++++++++++++----------------
Mheatsink/model.txt | 4+++-
Mheatsink/model_multiple.txt | 4+++-
Mheatsink/run_medium_computation.sh | 11+++++------
Mheatsink/run_medium_computation_multiple.sh | 11+++++------
Mporous/porous.txt | 10++++++----
Mporous/run_IR_rendering.sh | 13++++++-------
11 files changed, 75 insertions(+), 73 deletions(-)

diff --git a/city/model.txt b/city/model.txt @@ -1,3 +1,6 @@ +#ambient +TRAD 300 300 + #medium SOLID WALL 1.5 25 2 AUTO 300 UNKNOWN 0 FRONT S_walls.stl SOLID INSULATOR 0.035 25 2 AUTO 300 UNKNOWN 0 FRONT S_insulator.stl @@ -8,9 +11,9 @@ SOLID LAKE 0.8 25 2 AUTO 300 UNKNOWN 0 FRONT S_lak #boundary conditions -H_BOUNDARY_FOR_SOLID EXTERNAL 0.9 0.2 10 273 B_external_walls.stl -H_BOUNDARY_FOR_SOLID INTERNAL 0.9 0 10 293 B_internal_walls.stl -H_BOUNDARY_FOR_SOLID GROUNDTOP 0.9 0.1 10 273 B_ground_top.stl -H_BOUNDARY_FOR_SOLID GROUNDSIDE 0.9 0.1 0 273 B_ground_side.stl -T_BOUNDARY_FOR_SOLID GROUNDBOTTOM 286 B_ground_bottom.stl -H_BOUNDARY_FOR_SOLID LAKETOP 0.9 0.6 10 273 B_lake_top.stl +H_BOUNDARY_FOR_SOLID EXTERNAL 273 0.9 0.2 10 273 B_external_walls.stl +H_BOUNDARY_FOR_SOLID INTERNAL 293 0.9 0 10 293 B_internal_walls.stl +H_BOUNDARY_FOR_SOLID GROUNDTOP 273 0.9 0.1 10 273 B_ground_top.stl +H_BOUNDARY_FOR_SOLID GROUNDSIDE 273 0.9 0.1 0 273 B_ground_side.stl +T_BOUNDARY_FOR_SOLID GROUNDBOTTOM 286 B_ground_bottom.stl +H_BOUNDARY_FOR_SOLID LAKETOP 273 0.9 0.6 10 273 B_lake_top.stl diff --git a/city/run_IR_rendering.sh b/city/run_IR_rendering.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh -e # Copyright (C) 2021, 2022 |Meso|Star> # # This program is free software: you can redistribute it and/or modify @@ -16,7 +16,6 @@ ### USER PARAMETERS SECTION -TRAD=273 SPP=1024 #samples per pixel WIDTH=640 HEIGHT=480 @@ -28,10 +27,10 @@ FILE=IR_rendering_${MODEL}_${WIDTH}x${HEIGHT}x${SPP} #erase FILE result if exists -rm -f ${FILE}.ht ${FILE}.ppm +rm -f "${FILE}".ht "${FILE}".ppm #check stardis installation -if !(command -v stardis > /dev/null) +if ! (command -v stardis > /dev/null) then echo ">>> stardis command not found !" echo ">>> To register stardis in the current shell you must type :" @@ -41,8 +40,8 @@ then fi #launch Stardis -stardis -V 3 -a $TRAD -r $TRAD -M $MODEL -R spp=${SPP}:img=${WIDTH}x${HEIGHT}:fov=30:pos=${POSITION}:tgt=${TARGET}:up=0,0,1 > ${FILE}.ht +stardis -V 3 -M "${MODEL}" -R spp="${SPP}":img="${WIDTH}"x"${HEIGHT}":fov=30:pos="${POSITION}":tgt="${TARGET}":up=0,0,1 > "${FILE}".ht #convert ht file in ppm file -htpp -f -o ${FILE}.ppm -v -m default:range=273,275 ${FILE}.ht +htpp -f -o "${FILE}".ppm -v -m default:range=273,275 "${FILE}".ht echo ">>> You can now watch the IR rendering by opening the file ${FILE}.ppm" diff --git a/cube/run_dump_path.sh b/cube/run_dump_path.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh -e # Copyright (C) 2021, 2022 |Meso|Star> # # This program is free software: you can redistribute it and/or modify @@ -26,11 +26,10 @@ TIME=inf ### END USER PARAMETERS SECTION #erase previous files if exist -rm -f $GEOM_FILE ${PATH_FILE_PREFIX}* +rm -f "${GEOM_FILE} ${PATH_FILE_PREFIX}*" #check stardis installation -if !(command -v stardis > /dev/null) -then +if ! command -v stardis > /dev/null ; then echo ">>> stardis command not found !" echo ">>> To register stardis in the current shell you must type :" echo ">>> source ~/Stardis-XXX-GNU-Linux64/etc/stardis.profile" @@ -39,12 +38,12 @@ then fi #launch Stardis to dump geometry in vtk format -stardis -V 3 -M model.txt -d > $GEOM_FILE +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 +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 ">>> 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 @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh -e # Copyright (C) 2021, 2022 |Meso|Star> # # This program is free software: you can redistribute it and/or modify @@ -21,13 +21,12 @@ 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 +GREEN_FILE="probe_X${X}-Y${Y}-Z${Z}_N${NREAL}.green" SETTINGS_FILE=settings.txt ### END USER PARAMETERS SECTION #check stardis installation -if !(command -v stardis > /dev/null) -then +if ! command -v stardis > /dev/null ; then echo ">>> stardis command not found !" echo ">>> To register stardis in the current shell you must type :" echo ">>> source ~/Stardis-XXX-GNU-Linux64/etc/stardis.profile" @@ -35,27 +34,27 @@ then exit 1 fi -if [ -f "$GREEN_FILE" ]; then +if [ -f "${GREEN_FILE}" ]; then echo " " - echo ">>> $GREEN_FILE exists." + 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 "${SOURCES_AND_BOUNDARIES}" > "${SETTINGS_FILE}" + sgreen -g "${GREEN_FILE}" -a "${SETTINGS_FILE}" -e echo " " else echo " " - echo ">>> $GREEN_FILE does not exist." + 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 + 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 "${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 " " diff --git a/cube/run_probe_computation.sh b/cube/run_probe_computation.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh -e # Copyright (C) 2021, 2022 |Meso|Star> # # This program is free software: you can redistribute it and/or modify @@ -17,17 +17,16 @@ ### USER PARAMETERS SECTION NREAL=10000 -TIME=("10" "50" "100" "200" "300" "400") -FILE=stardis_result_N$NREAL.txt +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 +rm -f "${FILE}" #check stardis installation -if !(command -v stardis > /dev/null) -then +if ! command -v stardis > /dev/null ; then echo ">>> stardis command not found !" echo ">>> To register stardis in the current shell you must type :" echo ">>> source ~/Stardis-XXX-GNU-Linux64/etc/stardis.profile" @@ -36,25 +35,25 @@ then fi #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 +echo "#time Temperature errorbar N_failures N_Realizations" >> "${FILE}" +for i in ${TIME}; do +printf '%s ' "${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" +printf '>>> Results are writte in %s \n' "${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 + { + echo "plot 'analytical_T.txt' w l title 'Analytical'" + echo "replot '${FILE}' u 1:2:3 w yerrorbar title 'Stardis'" + 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." diff --git a/heatsink/model.txt b/heatsink/model.txt @@ -1,7 +1,9 @@ +TRAD 300 300 + SOLID AL 237 2700 890 0.2 300 UNKNOWN 0 FRONT S_heatsink.stl SOLID SI 147 2330 700 0.1 300 UNKNOWN 0 FRONT S_tim.stl SOLID SIPw 148 2330 700 0.1 300 UNKNOWN 2e8 FRONT S_chip.stl -H_BOUNDARY_FOR_SOLID CL 0.9 0.3 50 300 Boundary.stl +H_BOUNDARY_FOR_SOLID CL 300 0.9 0.3 50 300 Boundary.stl SCALE 0.001 # model is in mm diff --git a/heatsink/model_multiple.txt b/heatsink/model_multiple.txt @@ -1,7 +1,9 @@ +TRAD 300 300 + SOLID AL 237 2700 890 0.2 300 UNKNOWN 0 FRONT S_heatsink_multiple.stl SOLID SI 148 2330 700 0.1 300 UNKNOWN 0 FRONT S_tim_multiple.stl SOLID SIPw 148 2330 700 0.1 300 UNKNOWN 2e8 FRONT S_chip_multiple.stl -H_BOUNDARY_FOR_SOLID CL 0.9 0.5 50 300 Boundary_multiple.stl +H_BOUNDARY_FOR_SOLID CL 300 0.9 0.5 50 300 Boundary_multiple.stl SCALE 0.001 # model is in mm diff --git a/heatsink/run_medium_computation.sh b/heatsink/run_medium_computation.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh -e # Copyright (C) 2021, 2022 |Meso|Star> # # This program is free software: you can redistribute it and/or modify @@ -21,11 +21,10 @@ GEOM_FILE=chip.vtk ### END USER PARAMETERS SECTION #erase previous files if exist -rm -f $GEOM_FILE +rm -f "${GEOM_FILE}" #check stardis installation -if !(command -v stardis > /dev/null) -then +if ! command -v stardis > /dev/null ; then echo ">>> stardis command not found !" echo ">>> To register stardis in the current shell you must type :" echo ">>> source ~/Stardis-XXX-GNU-Linux64/etc/stardis.profile" @@ -34,7 +33,7 @@ then fi #launch Stardis to dump geometry in vtk format -stardis -V 3 -M model.txt -d > $GEOM_FILE +stardis -V 3 -M model.txt -d > "${GEOM_FILE}" #launch Stardis to compute mean temperature in the chip (named SIPw in model.txt) -stardis -V 3 -M model.txt -m SIPw,INF -n $NREAL -e +stardis -V 3 -M model.txt -m SIPw,INF -n "${NREAL}" -e diff --git a/heatsink/run_medium_computation_multiple.sh b/heatsink/run_medium_computation_multiple.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh -e # Copyright (C) 2021, 2022 |Meso|Star> # # This program is free software: you can redistribute it and/or modify @@ -21,11 +21,10 @@ GEOM_FILE=chip_multiple.vtk ### END USER PARAMETERS SECTION #erase previous files if exist -rm -f $GEOM_FILE +rm -f "${GEOM_FILE}" #check stardis installation -if !(command -v stardis > /dev/null) -then +if ! command -v stardis > /dev/null ; then echo ">>> stardis command not found !" echo ">>> To register stardis in the current shell you must type :" echo ">>> source ~/Stardis-XXX-GNU-Linux64/etc/stardis.profile" @@ -34,7 +33,7 @@ then fi #launch Stardis to dump geometry in vtk format -stardis -V 3 -M model_multiple.txt -d > $GEOM_FILE +stardis -V 3 -M model_multiple.txt -d > "${GEOM_FILE}" #launch Stardis -stardis -V 3 -M model_multiple.txt -m SIPw,INF -n $NREAL -e +stardis -V 3 -M model_multiple.txt -m SIPw,INF -n "${NREAL}" -e diff --git a/porous/porous.txt b/porous/porous.txt @@ -1,7 +1,9 @@ +TRAD 680 800 + SOLID FOAM 237 2700 890 0.0002 800 UNKNOWN 0 FRONT S_porous.stl SOLID PLATE 1 2700 890 AUTO 700 700 0 FRONT plate.stl -H_BOUNDARY_FOR_SOLID LAT 0.9 0.5 0 300 B_lateral.stl -T_BOUNDARY_FOR_SOLID T0 750 B_T0.stl -T_BOUNDARY_FOR_SOLID T1 850 B_T1.stl -H_BOUNDARY_FOR_SOLID HPLATE 0.8 0.8 0 300 plate.stl +H_BOUNDARY_FOR_SOLID LAT 300 0.9 0.5 0 300 B_lateral.stl +T_BOUNDARY_FOR_SOLID T0 750 B_T0.stl +T_BOUNDARY_FOR_SOLID T1 850 B_T1.stl +H_BOUNDARY_FOR_SOLID HPLATE 300 0.8 0.8 0 300 plate.stl diff --git a/porous/run_IR_rendering.sh b/porous/run_IR_rendering.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh -e # Copyright (C) 2021, 2022 |Meso|Star> # # This program is free software: you can redistribute it and/or modify @@ -21,16 +21,15 @@ WIDTH=320 HEIGHT=320 POSITION="0.05,0.01,0" #camera position TARGET="0,0,0" #position targeted -FILE=IR_rendering_${WIDTH}x${HEIGHT}x${SPP} +FILE="IR_rendering_${WIDTH}x${HEIGHT}x${SPP}" ### END USER PARAMETERS SECTION #erase FILE result if exists -rm -f ${FILE}.ht ${FILE}.ppm +rm -f "${FILE}.ht ${FILE}.ppm" #check stardis installation -if !(command -v stardis > /dev/null) -then +if ! command -v stardis > /dev/null ; then echo ">>> stardis command not found !" echo ">>> To register stardis in the current shell you must type :" echo ">>> source ~/Stardis-XXX-GNU-Linux64/etc/stardis.profile" @@ -39,9 +38,9 @@ then fi #launch Stardis -stardis -V 3 -a 680 -r 800 -M porous.txt -R spp=${SPP}:img=${WIDTH}x${HEIGHT}:fov=30:pos=${POSITION}:tgt=${TARGET}:up=0,0,1 > ${FILE}.ht +stardis -V 3 -M porous.txt -R spp="${SPP}":img="${WIDTH}"x"${HEIGHT}":fov=30:pos="${POSITION}":tgt="${TARGET}":up=0,0,1 > "${FILE}".ht #convert ht file in ppm file -htpp -f -o ${FILE}.ppm -v -m default:range=650,850 ${FILE}.ht +htpp -f -o "${FILE}.ppm" -v -m default:range=650,850 "${FILE}.ht" echo ">>> You can now watch the IR rendering by opening the file ${FILE}.ppm"