From 0fda8c87ced2773cd1438d5f64772040bafd6000 Mon Sep 17 00:00:00 2001 From: Dietmar Winkler Date: Wed, 25 Sep 2019 09:27:06 +0200 Subject: [PATCH] Removing superfluous test models and removing experiment annotation --- OpenHPL/Tests/package.order | 1 - OpenHPL/Tests/var_plot.mo | 6 -- OpenHPL/Waterway/RunOff.mo | 104 ------------------------- OpenHPL/Waterway/RunOff_SI.mo | 71 ----------------- OpenHPL/Waterway/RunOff_zones.mo | 1 - OpenHPL/Waterway/RunOff_zones_input.mo | 1 - OpenHPL/Waterway/package.order | 4 - OpenHPL/Waterway/test.mo | 43 ---------- OpenHPL/Waterway/testtemp.mo | 56 ------------- OpenHPL/package.mo | 4 +- OpenHPL/package.order | 2 +- 11 files changed, 3 insertions(+), 290 deletions(-) delete mode 100644 OpenHPL/Tests/var_plot.mo delete mode 100644 OpenHPL/Waterway/RunOff.mo delete mode 100644 OpenHPL/Waterway/RunOff_SI.mo delete mode 100644 OpenHPL/Waterway/test.mo delete mode 100644 OpenHPL/Waterway/testtemp.mo diff --git a/OpenHPL/Tests/package.order b/OpenHPL/Tests/package.order index fededb8..d04f72e 100644 --- a/OpenHPL/Tests/package.order +++ b/OpenHPL/Tests/package.order @@ -54,7 +54,6 @@ HydroCordModelKP2 HydroCordModel2 HydroCordModelKPFran HydroCordModelKPFran2 -var_plot HydroCordModelDraftTube HydroCordModelDraftTube2 HydroCordModelKPDraftTube diff --git a/OpenHPL/Tests/var_plot.mo b/OpenHPL/Tests/var_plot.mo deleted file mode 100644 index 61830e5..0000000 --- a/OpenHPL/Tests/var_plot.mo +++ /dev/null @@ -1,6 +0,0 @@ -within OpenHPL.Tests; -model var_plot - Modelica.Blocks.Sources.CombiTimeTable turbine_pressure1(columns = {2}, fileName = "C:/Users/liubomyr/OneDrive/Documents/PhD/HydroCord/Pressure_in.txt", tableName = "pressure", tableOnFile = true); - Modelica.Blocks.Sources.CombiTimeTable turbine_pressure2(columns = {2}, fileName = "C:/Users/liubomyr/OneDrive/Documents/PhD/HydroCord/Pressure_out.txt", tableName = "pressure", tableOnFile = true); - Modelica.Blocks.Sources.CombiTimeTable turbine_flow(columns = {2}, fileName = "C:/Users/liubomyr/OneDrive/Documents/PhD/HydroCord/Turbine_flow.txt", tableName = "flow", tableOnFile = true); -end var_plot; diff --git a/OpenHPL/Waterway/RunOff.mo b/OpenHPL/Waterway/RunOff.mo deleted file mode 100644 index a0d8434..0000000 --- a/OpenHPL/Waterway/RunOff.mo +++ /dev/null @@ -1,104 +0,0 @@ -within OpenHPL.Waterway; -model RunOff "Run off model (10 height zones only for snow rutine)" - extends Modelica.Icons.UnderConstruction; - parameter Integer N = 10 "# of height zones" annotation ( - Dialog(group = "Geometry")); - parameter Modelica.SIunits.Conversions.NonSIunits.Temperature_degC T_t = 1 "Threshold temperature" annotation ( - Dialog(group = "Physically-based parameters")); - parameter Modelica.SIunits.Area A[N] = ones(N) * 41.3e6 "Catchment area" annotation ( - Dialog(group = "Geometry")); - parameter Real s_T = 20e-3 "Soil zone saturation threshold, m" annotation ( - Dialog(group = "Empirical parameters")), a_1 = 0.547 / 86400 "Discharge frequency for surface runoff, 1/sec" annotation ( - Dialog(group = "Empirical parameters")), a_2 = 0.489 / 86400 "Discharge frequency for fast runoff, 1/sec" annotation ( - Dialog(group = "Empirical parameters")), a_3 = 0.0462 / 86400 "Discharge frequency for base runoff, 1/sec" annotation ( - Dialog(group = "Empirical parameters")), a_L[N] = {15.43, 3.97, 1.79, 0.81, 1.27, 1.44, 1.03, 2.32, 1.31, 0.57} .* 1e6 ./ A "Fractional area covered by lakes, -" annotation ( - Dialog(group = "Geometry")), g_T = 150e-3 "Ground saturation threshold, m" annotation ( - Dialog(group = "Physically-based parameters")), PERC = 0.6e-3 / 86400 "preccolation from soil zone to base zone, m/sec" annotation ( - Dialog(group = "Empirical parameters")), beta = 2 "Ground zone shape coefficient, -" annotation ( - Dialog(group = "Empirical parameters")), k_m = 4e-3 / 86400 "Melting factor, m/deg/sec" annotation ( - Dialog(group = "Physically-based parameters")), PCORR = 1.05 "Precipitation correction - Rainfall, -" annotation ( - Dialog(group = "Empirical parameters")), SCORR = 1.2 "Precipitation correction - Snowfall, -" annotation ( - Dialog(group = "Empirical parameters")), CE = 0.04 "Model parameter for adjusted evapotranspiration, 1/deg" annotation ( - Dialog(group = "Empirical parameters")); - //a_w = 0.03 "Saturation coeficieant, -" annotation (Dialog(group="Empirical parameters")), - //a = 0.001 "Snow surface fraction, -" annotation (Dialog(group="Empirical parameters")), - parameter String fileName_temp = Modelica.Utilities.Files.loadResource("modelica://OpenHPL/Resources/Tables/Temp_var.txt") "File with temperature variations in different height zones" annotation ( - Dialog(tab = "Temperature")); - parameter String tableName_temp = "zones_temp" "Table with temperature variations in different height zones" annotation ( - Dialog(tab = "Temperature")), fileName_prec = Modelica.Utilities.Files.loadResource("modelica://OpenHPL/Resources/Tables/Prec_var.txt") "File with precipitation variations in different height zones" annotation ( - Dialog(tab = "Precipitation")), tableName_prec = "zones_prec" "Table with precipitation variations in different height zones" annotation ( - Dialog(tab = "Precipitation")), fileName_evap = Modelica.Utilities.Files.loadResource("modelica://OpenHPL/Resources/Tables/Evap_var.txt") "File with evapotranspiration variations during the year" annotation ( - Dialog(tab = "Evapotranspiration")), tableName_evap = "evap" "Table with evapotranspiration variations during the year" annotation ( - Dialog(tab = "Evapotranspiration")), fileName_month_temp = Modelica.Utilities.Files.loadResource("modelica://OpenHPL/Resources/Tables/Month_av_temp.txt") "File with monthly average temperature for evapotranspiration calculation" annotation ( - Dialog(tab = "Evapotranspiration")), tableName_month_temp = "month_temp" "Table with monthly average temperature" annotation ( - Dialog(tab = "Evapotranspiration")), fileName_flow = "C:/Users/liubomyr/OneDrive/Documents/PhD/HydroPowerLib/Resources/Tables/Flow_var_d.txt" "File with real observed run off" annotation ( - Dialog(tab = "Real run off")), tableName_flow = "flow" "Table with real observed run off" annotation ( - Dialog(tab = "Real run off")); - parameter Integer columns_temp[:] = 2:N + 1 "Columns with temperature variations for different height zones" annotation ( - Dialog(tab = "Temperature")), columns_prec[:] = 2:N + 1 "Columns with precipitation variations for different height zones" annotation ( - Dialog(tab = "Precipitation")), columns_evap[:] = {2} "Column with evapotranspiration variations during the year" annotation ( - Dialog(tab = "Evapotranspiration")), columns_month_temp[:] = 2:N + 1 "Columns with monthly average temperature variations for different height zones" annotation ( - Dialog(tab = "Evapotranspiration")), columns_flow[:] = {2} "Column with real observed run off" annotation ( - Dialog(tab = "Real run off")); - Modelica.SIunits.Height V_s_w "Water content in soil zone", V_b_w "Water content in base zone", V_g_w "Water content in ground zone", V_s_d[N] "Dry snow"; - //V_s_s[N] "Soggy snow"; - Modelica.SIunits.VolumeFlowRate V_doT_tot "Total runoff"; - Modelica.SIunits.Velocity V_dot_s2b "Runoff rate from soil zone to base zone", V_dot_pl "Precipitation in lake", V_dot_b2br "Runoff rate from base zone t obase runoff", V_dot_l_e "Rate of evapotranspiration from lake", V_dot_g2s "Runoff rate from ground zone to soil zone", V_dot_s2sr "Runoff rate from soil zone to surface runoff", V_dot_s2fr "Runoff rate from soil zone to fast runoff", V_dot_s2g[N] "Runoff rate from snow zone to ground zone", V_dot_g_e "Evapotranspiration rate from ground zone", V_dot_p_r[N] "Precipitation in mainland in the form of snow", V_dot_d2w[N] "Melting rate from dry snow form to water snow form", V_dot_p_s[N] "Precipitation in mainland in the form of snow", V_dot_epot[N] "Evapotranspiration"; - //V_dot_w2d[N] "Freezing rate from water snow form to dry snow form"; - Modelica.SIunits.Conversions.NonSIunits.Temperature_degC T[N] "Ambient temperature"; - Modelica.SIunits.Velocity V_dot_p[N] "Precipitation"; - Real a_e[N], a_sw, F_o, F_e, R2, err = 0.5e-3 "Smal error, m"; - Modelica.Blocks.Sources.CombiTimeTable temp_var(tableOnFile = true, columns = columns_temp, tableName = tableName_temp, fileName = fileName_temp); - Modelica.Blocks.Sources.CombiTimeTable prec_var(tableOnFile = true, fileName = fileName_prec, columns = columns_prec, tableName = tableName_prec); - Modelica.Blocks.Sources.CombiTimeTable evap_var(tableOnFile = true, fileName = fileName_evap, columns = columns_evap, tableName = tableName_evap); - Modelica.Blocks.Sources.CombiTimeTable month_temp(tableOnFile = true, fileName = fileName_month_temp, columns = columns_month_temp, tableName = tableName_month_temp); - Modelica.Blocks.Sources.CombiTimeTable flow_var(tableOnFile = true, fileName = fileName_flow, columns = columns_flow, tableName = tableName_flow); -initial equation - //V_s_s = zeros(N); - V_s_d = zeros(N); - V_g_w = 0; - V_s_w = 0; - V_b_w = 0; -equation - ///// Total runoff - //der(V_doT_tot) = if V_s_w > s_T then (a_1*(V_s_w-s_T)+a_2*V_s_w)*(1-sum(a_L)/N)*sum(A) + sum(A)*a_3*V_b_w else a_2*V_s_w*(1-sum(a_L)/N)*sum(A) + sum(A)*a_3*V_b_w; - V_doT_tot = V_dot_b2br + V_dot_s2sr + V_dot_s2fr; - for i in 1:N loop - ///// Snow zone (Snow rourine) - T[i] = temp_var.y[i]; - V_dot_p[i] = prec_var.y[i] * 1e-3 / 86400; - der(V_s_d[i]) = V_dot_p_s[i] - V_dot_d2w[i]; - // + V_dot_w2d[i]; - //der(V_s_s[i]) = V_dot_p_r[i] - V_dot_w2d[i] + V_dot_d2w[i] - V_dot_s2g[i]; - V_dot_p_s[i] = if T[i] <= T_t then V_dot_p[i] * PCORR * SCORR * (1 - a_L[i]) else 0; - V_dot_p_r[i] = if T[i] > T_t then V_dot_p[i] * PCORR * (1 - a_L[i]) else 0; - V_dot_d2w[i] = if T[i] > T_t and V_s_d[i] >= err * 1e-2 then k_m * (T[i] - T_t) * (1 - a_L[i]) else 0; - //V_dot_w2d[i] = if T[i]<=T_t and V_s_s[i]>=0 then k_m*(T_t-T[i]) else 0; - //V_dot_s2g[i] = if T[i]>T_t and V_s_s[i]=err and V_s_d[i]>=err then (1+a_w)*V_dot_d2w[i]+V_dot_p_r[i] else 0; - V_dot_s2g[i] = V_dot_p_r[i] + V_dot_d2w[i]; - ///// Ground zone (Soil moisure) - //der(V_g_w[i]) = V_dot_s2g[i] - V_dot_g2s[i] - (1-a)*V_dot_g_e[i]; - V_dot_epot[i] = a_e[i] * evap_var.y[1] * 1e-3 / 86400 * (1 + CE * (T[i] - month_temp.y[i])); - a_e[i] = if V_s_d[i] < err then 1 else 0; - end for; - der(V_g_w) = sum(V_dot_s2g .* A) - V_dot_g2s - V_dot_g_e; - V_dot_g2s = if V_g_w >= 0 and V_g_w < g_T * sum(A) then (V_g_w / g_T / sum(A)) ^ beta * sum(V_dot_s2g .* A) else sum(V_dot_s2g .* A); - V_dot_g_e = if V_g_w < g_T * sum(A) then V_g_w / g_T / sum(A) * sum(V_dot_epot .* A) else sum(V_dot_epot .* A); - ///// Soil zone (Upprec zone) - der(V_s_w) = V_dot_g2s - a_sw * V_dot_s2b - V_dot_s2sr - V_dot_s2fr; - V_dot_s2b = sum((ones(N) - a_L) .* PERC .* A); - V_dot_s2sr = if V_s_w > s_T * sum(A) then a_1 * (V_s_w - s_T * sum(A)) else 0; - V_dot_s2fr = a_2 * V_s_w; - a_sw = if V_dot_g2s < V_dot_s2b then 0 else 1; - ///// Basement zone (Lower zone) - der(V_b_w) = V_dot_s2b + V_dot_pl - V_dot_b2br - V_dot_l_e; - V_dot_pl = sum(a_L .* V_dot_p .* A); - V_dot_b2br = a_3 * V_b_w; - V_dot_l_e = sum(a_L .* V_dot_epot .* A); - ///// Error - F_o = (flow_var.y[1] - 17.230144) ^ 2; - F_e = (flow_var.y[1] - V_doT_tot) ^ 2; - R2 = 1 - F_e / F_o; - annotation ( - experiment(StopTime = 315360000, Interval = 86400)); -end RunOff; diff --git a/OpenHPL/Waterway/RunOff_SI.mo b/OpenHPL/Waterway/RunOff_SI.mo deleted file mode 100644 index 79820b4..0000000 --- a/OpenHPL/Waterway/RunOff_SI.mo +++ /dev/null @@ -1,71 +0,0 @@ -within OpenHPL.Waterway; -model RunOff_SI - extends Modelica.Icons.UnderConstruction; - parameter Integer N = 10 "# of height zones"; - parameter Modelica.SIunits.Conversions.NonSIunits.Temperature_degC T_T = 1 "Threshold temperature"; - //, T[N] "Ambient temperature"; - parameter Modelica.SIunits.Area A[N] = ones(N) * 41.3e6 "Catchment area"; - parameter Real s_T = 20e-3 "Soil zone saturation threshold, m", a_1 = 0.547 / 86400 "Discharge frequency for surface runoff, 1/sec", a_2 = 0.489 / 86400 "Discharge frequency for fast runoff, 1/sec", a_3 = 0.0462 / 86400 "Discharge frequency for base runoff, 1/sec", a_L[N] = {15.43, 3.97, 1.79, 0.81, 1.27, 1.44, 1.03, 2.32, 1.31, 0.57} .* 1e6 ./ A "Fractional area covered by lakes, -", g_T = 150e-3 "Ground saturation threshold, m", PERC = 0.6e-3 / 86400 "Percolation from soil zone to base zone, m/sec", beta = 2 "Ground zone shape coefficient, -", k_m = 4e-3 / 86400 "Melting factor, m/deg/sec", a_w = 0.0 "Saturation coeficieant, -", a = 0.001 "Snow surface fraction, -", PCORR = 1.05 "Precipitation correction - Rainfall, -", SCORR = 1.2 "Precipitation correction - Snowfall, -", err = 0.5e-3 "Smal error, m", CE = 0.04 "Model parameter for adjusted evapotranspiration, 1/deg"; - Modelica.SIunits.Volume V_s_w[N] "Water content in soil zone", V_b_w[N] "Water content in base zone", V_g_w[N] "Water content in ground zone", V_s_d[N] "Dry snow"; - //V_s_s[N] "Soggy snow"; - Modelica.SIunits.VolumeFlowRate V_dot_tot "Total runoff", V_dot_s2b[N] "Runoff rate from soil zone to base zone", V_dot_pl[N] "Precipitation in lake", V_dot_b2br[N] "Runoff rate from base zone t obase runoff", V_dot_l_e[N] "Rate of evapotranspiration from lake", V_dot_g2s[N] "Runoff rate from ground zone to soil zone", V_dot_s2sr[N] "Runoff rate from soil zone to surface runoff", V_dot_s2fr[N] "Runoff rate from soil zone to fast runoff", V_dot_s2g[N] "Runoff rate from snow zone to ground zone", V_dot_g_e[N] "Evapotranspiration rate from ground zone", V_dot_p_r[N] "Precipitation in mainland in the form of snow", V_dot_d2w[N] "Melting rate from dry snow form to water snow form", V_dot_p_s[N] "Precipitation in mainland in the form of snow", V_dot_epot[N] "Evapotranspiration"; - //V_dot_w2d[N] "Freezing rate from water snow form to dry snow form"; - Modelica.SIunits.Conversions.NonSIunits.Temperature_degC T[N] "Ambient temperature"; - Modelica.SIunits.Velocity V_dot_p[N] "Precipitation"; - Real a_e[N], F_o, F_e, R2; - Modelica.Blocks.Sources.CombiTimeTable temp_var(tableOnFile = true, columns = 2:11, tableName = "zones_temp", fileName = Modelica.Utilities.Files.loadResource("modelica://OpenHPL/Resources/Tables/Temp_var.txt")); - Modelica.Blocks.Sources.CombiTimeTable prec_var(tableOnFile = true, fileName = Modelica.Utilities.Files.loadResource("modelica://OpenHPL/Resources/Tables/Prec_var.txt"), columns = 2:11, tableName = "zones_prec"); - Modelica.Blocks.Sources.CombiTimeTable evap_var(tableOnFile = true, fileName = Modelica.Utilities.Files.loadResource("modelica://OpenHPL/Resources/Tables/Evap_var.txt"), columns = {2}, tableName = "evap"); - Modelica.Blocks.Sources.CombiTimeTable month_temp(tableOnFile = true, fileName = Modelica.Utilities.Files.loadResource("modelica://OpenHPL/Resources/Tables/Month_av_temp.txt"), columns = 2:11, tableName = "month_temp"); - Modelica.Blocks.Sources.CombiTimeTable flow_var(tableOnFile = true, fileName = Modelica.Utilities.Files.loadResource("modelica://OpenHPL/Resources/Tables/Flow_var_d.txt"), tableName = "flow"); -initial equation - //V_s_s = zeros(N); - V_s_d = zeros(N); - V_g_w = zeros(N); - V_s_w = zeros(N); - V_b_w = zeros(N); -equation - ///// Total runoff - //der(V_dot_tot) = if V_s_w > s_T then (a_1*(V_s_w-s_T)+a_2*V_s_w)*(1-sum(a_L)/N)*sum(A) + sum(A)*a_3*V_b_w else a_2*V_s_w*(1-sum(a_L)/N)*sum(A) + sum(A)*a_3*V_b_w; - V_dot_tot = sum(V_dot_b2br + V_dot_s2sr + V_dot_s2fr); - for i in 1:N loop - ///// Snow zone (Snow rourine) - T[i] = temp_var.y[i]; - V_dot_p[i] = prec_var.y[i] * 1e-3 / 86400; - der(V_s_d[i]) = V_dot_p_s[i] - V_dot_d2w[i]; - // + V_dot_w2d[i]; - //der(V_s_s[i]) = V_dot_p_r[i] - V_dot_w2d[i] + V_dot_d2w[i] - V_dot_s2g[i]; - V_dot_p_s[i] = if T[i] <= T_T then V_dot_p[i] * PCORR * SCORR * (1 - a_L[i]) * A[i] else 0; - V_dot_p_r[i] = if T[i] > T_T then V_dot_p[i] * PCORR * (1 - a_L[i]) * A[i] else 0; - V_dot_d2w[i] = if T[i] > T_T and V_s_d[i] > 0 then k_m * (T[i] - T_T) * (1 - a_L[i]) * A[i] else 0; - //V_dot_w2d[i] = if T[i]<=T_T and V_s_s[i]>=0 then k_m*(T_T-T[i])*A[i] else 0; - //V_dot_s2g[i] = if T[i]>T_T and V_s_s[i]==0 and V_s_d[i]==0 then V_dot_p_r[i] elseif V_s_s[i]<>0 and V_s_d[i]<>0 then (1-a_w)*V_dot_d2w[i]+V_dot_p_r[i] else 0; - V_dot_s2g[i] = V_dot_p_r[i] + V_dot_d2w[i]; - ///// Ground zone (Soil moisure) - //der(V_g_w[i]) = V_dot_s2g[i] - V_dot_g2s[i] - (1-a)*V_dot_g_e[i]; - der(V_g_w[i]) = V_dot_s2g[i] - V_dot_g2s[i] - a_e[i] .* V_dot_g_e[i]; - V_dot_g2s[i] = if V_g_w[i] >= 0 and V_g_w[i] / ((1 - a_L[i]) * A[i]) < g_T then (V_g_w[i] / g_T / ((1 - a_L[i]) * A[i])) ^ beta * V_dot_s2g[i] else V_dot_s2g[i]; - //V_dot_g_e[i] = if V_g_w[i] (1 - a_L[i]) * A[i] * PERC then (1 - a_L[i]) * A[i] * PERC else 0; - V_dot_s2sr[i] = if V_s_w[i] / ((1 - a_L[i]) * A[i]) > s_T then a_1 * (V_s_w[i] - s_T * (1 - a_L[i]) * A[i]) else 0; - V_dot_s2fr[i] = a_2 * V_s_w[i]; - ///// Basement zone (Lower zone) - der(V_b_w[i]) = V_dot_s2b[i] + V_dot_pl[i] - V_dot_b2br[i] - V_dot_l_e[i]; - V_dot_pl[i] = a_L[i] * A[i] * V_dot_p[i]; - V_dot_b2br[i] = a_3 * V_b_w[i]; - V_dot_l_e[i] = a_L[i] * A[i] * V_dot_epot[i]; - end for; - ///// Evaporation - //V_dot_epot = evap_var.y[1]*1e-3/86400;//V_dot_epot_month[1]*1e-3/86400;//if time<=30 then V_dot_epot_month[1] else V_dot_epot_month[2]; - ///// - F_o = (flow_var.y[1] - 17.230144) ^ 2; - F_e = (flow_var.y[1] - V_dot_tot) ^ 2; - R2 = (F_o - F_e) / F_o; - annotation ( - experiment(StopTime = 31536000, Interval = 86400)); -end RunOff_SI; diff --git a/OpenHPL/Waterway/RunOff_zones.mo b/OpenHPL/Waterway/RunOff_zones.mo index 322d2db..c8e86f8 100644 --- a/OpenHPL/Waterway/RunOff_zones.mo +++ b/OpenHPL/Waterway/RunOff_zones.mo @@ -109,6 +109,5 @@ equation R2 = 1 - F_e / F_o; V_dot_runoff = V_doT_tot; annotation ( - experiment(StopTime = 315360000, Interval = 86400), Documentation(info = "This is the hydrology model that is based on the HBV hydrological model. This model can be used to define the inflow (runoff) to the reservoir.

Here, the input data are used for the model and this data is in: Resources/Tables/...

More info about model: Resources/Report/Hydrology_model.pdf
")); end RunOff_zones; diff --git a/OpenHPL/Waterway/RunOff_zones_input.mo b/OpenHPL/Waterway/RunOff_zones_input.mo index 966359a..ca1ae24 100644 --- a/OpenHPL/Waterway/RunOff_zones_input.mo +++ b/OpenHPL/Waterway/RunOff_zones_input.mo @@ -81,6 +81,5 @@ equation R2 = 1 - F_e / F_o; V_dot_runoff = V_doT_tot; annotation ( - experiment(StopTime = 315360000, Interval = 86400), Documentation(info = "This is the same hydrology model that is based on the HBV hydrological model. This model can be used to define the inflow (runoff) to the reservoir.

Here the input data are not specified. 

")); end RunOff_zones_input; diff --git a/OpenHPL/Waterway/package.order b/OpenHPL/Waterway/package.order index 1119989..a01879a 100644 --- a/OpenHPL/Waterway/package.order +++ b/OpenHPL/Waterway/package.order @@ -9,7 +9,3 @@ OpenChannel ReservoirChannel RunOff_zones RunOff_zones_input -RunOff -RunOff_SI -test -testtemp diff --git a/OpenHPL/Waterway/test.mo b/OpenHPL/Waterway/test.mo deleted file mode 100644 index 9d63395..0000000 --- a/OpenHPL/Waterway/test.mo +++ /dev/null @@ -1,43 +0,0 @@ -within OpenHPL.Waterway; -model test - extends Modelica.Icons.UnderConstruction; - outer Constants Const; - import Modelica.Constants.pi; - parameter Modelica.SIunits.Height H = 25 "Height over which water fall in the pipe"; - parameter Modelica.SIunits.Length L = 6600 "Length of the pipe"; - parameter Modelica.SIunits.Diameter D = 5.8 "Diametr from the input side of the pipe"; - parameter Modelica.SIunits.VolumeFlowRate V_dot0 = 10 "Initial flow rate in the pipe"; - parameter Modelica.SIunits.Temperature T_i = 273 + 5 "initial temperature"; - parameter Modelica.SIunits.SpecificHeatCapacity c_p = 4200; - Modelica.SIunits.Mass m; - Modelica.SIunits.Area A = D ^ 2 * pi / 4; - Real cos_theta = H / L; - Modelica.SIunits.Velocity v; - Modelica.SIunits.Momentum M; - parameter Modelica.SIunits.Pressure p_1 = 11e5; - //, p_2 = p_1 + Const.rho * Const.g * H; - Modelica.SIunits.VolumeFlowRate V_dot; - Modelica.SIunits.Temperature T; - Real F_f, W_f, W_e, p_2, dp, C_v = 3, u_t; - //, W_v; -initial equation - der(V_dot) = 0; - der(T) = 0; -equation - u_t = if time < 20 then 2 else 1; - // Water velocity - v = V_dot / A; - // Momentum and mass of water - M = Const.rho * L * V_dot; - m = Const.rho * A * L; - // Friction force - F_f = Functions.DarcyFriction.Friction(v, D, L, Const.rho, Const.mu, Const.eps); - // momentum balance - der(M) = (p_1 - p_2) * A - F_f + m * Const.g * cos_theta; - dp = V_dot ^ 2 * Const.p_a / (C_v * u_t) ^ 2; - dp = p_2 - Const.p_a; - W_f = -F_f * v; - W_e = V_dot * (p_1 - p_2); - //// - c_p * m * der(T) = V_dot * Const.rho * c_p * (T_i - T) + W_e - W_f; -end test; diff --git a/OpenHPL/Waterway/testtemp.mo b/OpenHPL/Waterway/testtemp.mo deleted file mode 100644 index 4395ca3..0000000 --- a/OpenHPL/Waterway/testtemp.mo +++ /dev/null @@ -1,56 +0,0 @@ -within OpenHPL.Waterway; -model testtemp - extends Modelica.Icons.UnderConstruction; - outer Constants Const; - import Modelica.Constants.pi; - parameter Modelica.SIunits.Height H = 25 "Height over which water fall in the pipe"; - parameter Modelica.SIunits.Length L = 6600 "Length of the pipe"; - parameter Modelica.SIunits.Diameter D = 5.8 "Diametr from the input side of the pipe"; - parameter Modelica.SIunits.VolumeFlowRate V_dot0 = 10 "Initial flow rate in the pipe"; - parameter Modelica.SIunits.Temperature T_i = 273 + 5 "initial temperature"; - parameter Real c_p = 4200; - Modelica.SIunits.Mass m; - Modelica.SIunits.Area A = D ^ 2 * pi / 4; - Real cos_theta = H / L; - Modelica.SIunits.Velocity v; - Modelica.SIunits.Momentum M; - parameter Modelica.SIunits.Pressure p_1 = 11e5; - //, p_2 = p_1 + Const.rho * Const.g * H; - Modelica.SIunits.VolumeFlowRate V_dot; - Modelica.SIunits.Temperature T; - Real F_f, W_f, p_2, dp, C_v = 3, u_t = 2; - Real H_, H_i, H_o, U, p; - //, W_e - //, W_v; -initial equation - der(V_dot) = 0; - //V_dot0; - T = T_i; -equation - // Water velocity - v = V_dot / A; - // Momentum and mass of water - M = Const.rho * L * V_dot; - m = Const.rho * A * L; - // Friction force - F_f = Functions.DarcyFriction.Friction(v, D, L, Const.rho, Const.mu, Const.eps); - // momentum balance - der(M) = (p_1 - p_2) * A - F_f + m * Const.g * cos_theta; - dp = V_dot ^ 2 * Const.p_a / (C_v * u_t) ^ 2; - dp = p_2 - Const.p_a; - /////// - der(U) = H_i - H_o + W_f; - // - U = H_ - p * A * L; - // - H_ = m * (c_p * (T - T_i) + 1 / Const.rho * (p - Const.p_a)); - H_i = V_dot * Const.rho * (c_p * (T_i - T_i) + 1 / Const.rho * (p_1 - Const.p_a)); - H_o = V_dot * Const.rho * (c_p * (T - T_i) + 1 / Const.rho * (p_2 - Const.p_a)); - // - p = 0.5 * (p_1 + p_2); - // - W_f = -F_f * v; - //W_e = V_dot * (p_2 - p_1); - //// - //c_p * m * der(T) = - W_f + W_e; //V_dot* Const.rho*c_p*(T_i - T) -end testtemp; diff --git a/OpenHPL/package.mo b/OpenHPL/package.mo index fb69a98..bc41ece 100644 --- a/OpenHPL/package.mo +++ b/OpenHPL/package.mo @@ -3,8 +3,8 @@ package OpenHPL import C = Modelica.Constants; annotation ( - version="1.0.1", - versionDate="2019-09-06", + version="1.0.2", + versionDate="2019-09-25", Protection(access = Access.packageDuplicate), uses(OpenIPSL(version="2.0.0-dev"), Modelica(version="3.2.3")), Documentation(info=" diff --git a/OpenHPL/package.order b/OpenHPL/package.order index e238ed2..bd92446 100644 --- a/OpenHPL/package.order +++ b/OpenHPL/package.order @@ -5,7 +5,7 @@ Examples Waterway ElectroMech Controllers -Tests Interfaces Functions Icons +Tests