From 4af4fb946c6afa2b4d6d7632b4b601df39167409 Mon Sep 17 00:00:00 2001 From: Dmitri Naumov Date: Fri, 8 Dec 2023 15:27:57 +0100 Subject: [PATCH 1/2] [web] Correct setting of the end time Fixing the xpath and the end time with time increments --- Tests/Data/Parabolic/T/BHE_1P/pipe_flow_ebhe.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Tests/Data/Parabolic/T/BHE_1P/pipe_flow_ebhe.md b/Tests/Data/Parabolic/T/BHE_1P/pipe_flow_ebhe.md index 2d8fba495c4..d36f2ab09aa 100644 --- a/Tests/Data/Parabolic/T/BHE_1P/pipe_flow_ebhe.md +++ b/Tests/Data/Parabolic/T/BHE_1P/pipe_flow_ebhe.md @@ -267,9 +267,10 @@ from ogs6py.ogs import OGS # Pass the project file and set an output file path model=OGS(INPUT_FILE="BHE_1P.prj", PROJECT_FILE=f"{out_dir}/BHE_1P.prj") -# set end time to 30 days (in seconds) -model.replace_text(30 * 24 * 60 * 60, xpath="./time_stepping/t_end/value") - +# set end time (in seconds) and the time increments +model.replace_text(5 * 24 * 60 * 60, xpath="./time_loop/processes/process/time_stepping/t_end") +model.replace_text(30, xpath="./time_loop/processes/process/time_stepping/timesteps/pair/repeat") +model.replace_text(4 * 60 * 60, xpath="./time_loop/processes/process/time_stepping/timesteps/pair/delta_t") # Write to the output file model.write_input() From 1915dae515e26b8d8ba6b7622d90ae1aa9a1aeba Mon Sep 17 00:00:00 2001 From: Dmitri Naumov Date: Fri, 8 Dec 2023 16:00:18 +0100 Subject: [PATCH 2/2] [web/BHE1P] Test for maximum error Also remove scaling of the right error axis to see the full scale. --- Tests/Data/Parabolic/T/BHE_1P/pipe_flow_ebhe.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Tests/Data/Parabolic/T/BHE_1P/pipe_flow_ebhe.md b/Tests/Data/Parabolic/T/BHE_1P/pipe_flow_ebhe.md index d36f2ab09aa..d442bd3a7b0 100644 --- a/Tests/Data/Parabolic/T/BHE_1P/pipe_flow_ebhe.md +++ b/Tests/Data/Parabolic/T/BHE_1P/pipe_flow_ebhe.md @@ -396,7 +396,6 @@ ax2 = ax1.twinx() ax2.set_ylabel('Absolute error (°C)', color=color, fontsize = 20) ax2.plot(np.linspace(0,30,101), temp[:,0]-df.iloc[:, -1], linewidth = 2, color=color, label = 'Absolute error') ax2.tick_params(axis='y', labelcolor=color) -ax2.set_ylim(0,0.04) ax2.spines['right'].set_color('blue') ax2.spines['right'].set_linewidth(2) ax2.tick_params(axis='y', labelsize=16) @@ -405,6 +404,9 @@ fig.tight_layout() plt.figlegend(fontsize=18, loc = (0.4, 0.1), frameon=False) plt.show() +max_error = 0.08 +if np.max(np.abs(temp[:,0]-df.iloc[:, -1])) > max_error: + raise RuntimeError(f'The maximum temperature error is over {max_error} °C, which is higher than expected') ``` Figure 3: Distributed temperature of fluid and absolute error.