commit 0d9e5189f9db793884b53f93e4fa0c3a3f287dfb
parent 1938baf3d6679bb4f307a351d2ea51ab84ad086b
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Mon, 18 Aug 2025 15:08:31 +0200
stardis: draft of a cross-comparison test
Stardis is used to calculate the unsteady temperature at the ground
surface, which will be compared to the surface temperature provided in
the smeteo file.
The test is currently a simple shell script that configures the system
and runs Stardis. Cross-comparison is still not performed because, a
priori, the input smeteo file and the Stardis systems do not match. It
will be activated once the data has been validated.
Diffstat:
3 files changed, 142 insertions(+), 0 deletions(-)
diff --git a/.gitignore b/.gitignore
@@ -10,3 +10,5 @@ test*
!test*.[ch]
test.txt
smeteo
+*.stl
+stardis_model.txt
diff --git a/Makefile b/Makefile
@@ -180,6 +180,7 @@ clean: clean_test
rm -f $(DEP) $(OBJ) $(LIBNAME)
rm -f $(UTIL_DEP) $(UTIL_OBJ) smeteo
rm -f $(PLUGIN_DEP) $(PLUGIN_OBJ) libstardis_smeteo.so
+ rm -f *.stl stardis_model.txt
rm -f .config .config_plugin libsmeteo.o smeteo.pc smeteo-local.pc
################################################################################
diff --git a/src/test_stardis_smeteo_ground_temperature.sh b/src/test_stardis_smeteo_ground_temperature.sh
@@ -0,0 +1,139 @@
+#!/bin/sh
+
+# Copyright (C) 2025 |Méso|Star> (contact@meso-star.com)
+#
+# This program is free software: you can redismeteobute 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 dismeteobuted 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/>.
+
+set -e
+
+########################################################################
+# Ground geometry
+########################################################################
+bound=50000 # [m]
+depth=30 # [m]
+
+x="-${bound}"; y="-${bound}"; z="-${depth}"
+X="+${bound}"; Y="+${bound}"; Z="0"
+
+vertices="\
+ ${x} ${y} ${z}
+ ${X} ${y} ${z}
+ ${X} ${Y} ${z}
+ ${x} ${Y} ${z}
+ ${x} ${y} ${Z}
+ ${X} ${y} ${Z}
+ ${X} ${Y} ${Z}
+ ${x} ${Y} ${Z}"
+
+indices="\
+ 1 4 2
+ 2 4 3
+ 8 5 6
+ 8 6 7
+ 1 2 5
+ 5 2 6
+ 6 2 3
+ 6 3 7
+ 7 3 8
+ 8 3 4
+ 8 4 5
+ 5 4 1"
+
+########################################################################
+# Helper functions
+########################################################################
+facet() # "index0 index1 index2"
+{
+ printf '\tfacet normal 0 0 1\n'
+ printf '\t\touter loop\n'
+
+ printf '%s\n' "$1" \
+ | sed -e 's/^[[:space:]]\{1,\}//g' \
+ -e 's/[[:space:]]\{1,\}$//g' \
+ -e 's/[[:space:]]\{1,\}/\n/g' \
+ | while read -r i; do
+ printf '\t\t\tvertex '
+ printf '%s\n' "${vertices}" | sed -n "${i}p"
+ done
+
+ printf '\t\tendloop\n'
+ printf '\tendfacet\n'
+}
+
+ground()
+{
+
+ if [ $# -eq 0 ]; then
+ facets='1,$p'
+ else
+ facets="$(printf '%s ' "$@" | sed \
+ -e 's/^[[:space:]]\{1,\}//g' \
+ -e 's/[[:space:]]\{1,\}$/p/g' \
+ -e 's/[[:space:]]\{1,\}/p;/g')"
+ fi
+
+ printf 'solid ground\n'
+
+ printf '%s\n' "${indices}" \
+ | sed -n "${facets}" \
+ | while read -r facet; do
+ facet "${facet}"
+ done
+
+ printf 'endsolid\n'
+}
+
+stardis_input()
+{
+ # The plugin
+ echo 'PROGRAM Meteo libstardis_smeteo.so samples/star-meteo_input.txt'
+ echo ''
+
+ # Media
+ echo 'SOLID ground 1 1500 1500 AUTO 281.85 UNKNOWN 0 FRONT ground.stl'
+ echo ''
+
+ # Limit condition
+ echo 'H_BOUNDARY_FOR_SOLID adiabatic 0 0 0 0 0 ground_xXyY.stl'
+ echo 'T_BOUNDARY_FOR_SOLID underground 293.0 ground_z.stl'
+ echo 'HF_BOUNDARY_FOR_SOLID_PROG atmosphere Meteo ground_Z.stl'
+}
+
+########################################################################
+# The test
+########################################################################
+# Generate geometry
+ground > ground.stl
+ground 1 2 > ground_z.stl
+ground 3 4 > ground_Z.stl
+ground 5 6 7 8 9 10 11 12 > ground_xXyY.stl
+
+# Generate the Stardis input file
+stardis_input > stardis_model.txt
+
+# Used Stardis to Calculate the ground temperature on January 10, 1850
+# at 01:30:
+# 783000 = (9 [day] * 24 [h] + 1 [h]) * 3600 [s] + 30 [m] * 60 [s]
+time="783000" # [s]
+stardis -V3 -M stardis_model.txt -s ground_Z.stl,${time}
+
+# TODO: check the Stardis result against a reference, most likely the
+# surface temperature provided by the Meteorological file at the time of
+# observation. The test has not yet been performed because the system
+# parameters may not correspond to the system used to generate the input
+# meteorlogical data. For example, the depth of the underground is
+# arbitrarily set at 30 meters with a fixed temperature of 293 K.
+# Similarly, the thermophysical properties of the ground still need to
+# be verified to ensure that they match those used to calculate the
+# surface temperature in the smeteo file.