From fb6148816a6ccab2a6a2b64399f191aaf915295b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andra=C5=BE=20Ko=C5=A1ir?= <91137908+akosira@users.noreply.github.com> Date: Mon, 26 Feb 2024 14:24:27 +0100 Subject: [PATCH] modified default yaml file --- examples/snowing_example.py | 43 ++++++++++++++++++++ src/ethz_snow/config/snowConfig_default.yaml | 2 +- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 examples/snowing_example.py diff --git a/examples/snowing_example.py b/examples/snowing_example.py new file mode 100644 index 0000000..32a6d88 --- /dev/null +++ b/examples/snowing_example.py @@ -0,0 +1,43 @@ +# import modules: Snowing and OperatingConditions +from ethz_snow.snowing import Snowing +from ethz_snow.operatingConditions import OperatingConditions + +# define the heat transfer parameters dictionary +d = {"int": 0, "ext": 0, "s0": 50, "s_sigma_rel": 0} + +# define the cooling rate profile and holding steps +c = {"rate": 0.5 / 60, "start": 20, "end": -50} +h = [] + +# create an instance of the operating conditions class +op = OperatingConditions(t_tot=4 * 3600, cooling=c, holding=h) + + +# run a single spatial simulation +S_1 = Snowing(k=d, opcond=op, Nrep=1) +S_1.run() + +# show results +S_1.results + +# plot evolutions of temperature and ice mass fraction +S_1.plot_evolution(what="temperature") +S_1.plot_evolution(what="ice_mass_fraction") + +# get individual arrays +time = S_1.time +shelf = S_1.shelfTemp +temp = S_1.temp +ice = S_1.iceMassFraction + + +# multiple simulations are run if Nrep > 1 +S = Snowing(k=d, opcond=op, Nrep=50) +S.run() +S.results + +# plot +S.plot_cdf(what="T_nuc") +S.plot_cdf(what="t_nuc") +S.plot_cdf(what="t_sol") +S.plot_cdf(what="t_fr") diff --git a/src/ethz_snow/config/snowConfig_default.yaml b/src/ethz_snow/config/snowConfig_default.yaml index 79322b2..248f93e 100644 --- a/src/ethz_snow/config/snowConfig_default.yaml +++ b/src/ethz_snow/config/snowConfig_default.yaml @@ -1,5 +1,5 @@ # model dimensionality/temperature resolution within vial (homogeneous, spatial_1D, spatial_2D) -dimensionality: homogeneous +dimensionality: spatial_1D # freezing configuration to be simulated (shelf, VISF, jacket) configuration: shelf