From 606eaeb3d4d4530925c38a0cfdf7b388e9ffb8e9 Mon Sep 17 00:00:00 2001
From: Felix MARSOLLIER <fm4b8dfn@dsp1027505>
Date: Tue, 16 Aug 2022 17:34:59 +0200
Subject: [PATCH] Removal of compensation of jet heigh via H_fluidStream
 because it has a low physical sense

---
 FluidDynamics/Components/Orifices/HorizontalOpening.mo | 3 +--
 FluidDynamics/Components/Orifices/Opening.mo           | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/FluidDynamics/Components/Orifices/HorizontalOpening.mo b/FluidDynamics/Components/Orifices/HorizontalOpening.mo
index 9f3fb6e..e4e33f0 100644
--- a/FluidDynamics/Components/Orifices/HorizontalOpening.mo
+++ b/FluidDynamics/Components/Orifices/HorizontalOpening.mo
@@ -38,7 +38,6 @@ model HorizontalOpening
     Placement(visible = true, transformation(origin = {38, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {0, 90}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
 
 protected
-  parameter Modelica.SIunits.Height H_fluidStream = Dh * Cd ^0.5 "Minimal height between top and bottom flow path";
   Modelica.SIunits.MassFlowRate mX_flow_i[N, Medium.nX] ;
   Modelica.SIunits.SpecificEnthalpy h_a "Specific enthalpy from port_a" ;
   Modelica.SIunits.SpecificEnthalpy h_b "Specific enthalpy from port_b" ;
@@ -74,7 +73,7 @@ In such a case, the HorizontalOpening is assumed behaves like a VerticalOpening
   buoyancy = if sum(port_a.d) < sum(port_b.d) then 1 else 0;
 //
   for i in 1:N loop
-    dp_i[i] = dp + buoyancy * Modelica.Constants.g_n * (H_fluidStream / 2 - H_fluidStream * (i - 1 / 2) / N) * (sum(port_a.d) - sum(port_b.d));
+    dp_i[i] = dp + Modelica.Constants.g_n * (Dh / 2 - Dh * (i - 1 / 2) / N) * min(sum(port_a.d) - sum(port_b.d), 0.0);
     d[i] = TAeZoSysPro.FluidDynamics.Utilities.regStep(x = Vel[i], x_small = 1e-10, y1 = sum(port_a.d), y2 = sum(port_b.d));
     if massDynamics == Dynamics.SteadyState then
       dp_i[i] - 1 / 2 * Modelica.Fluid.Utilities.regSquare2(x = Vel[i], x_small = Vel_small, k1 = sum(port_a.d), k2 = sum(port_b.d)) = 0.0;
diff --git a/FluidDynamics/Components/Orifices/Opening.mo b/FluidDynamics/Components/Orifices/Opening.mo
index 399269b..3d78f08 100644
--- a/FluidDynamics/Components/Orifices/Opening.mo
+++ b/FluidDynamics/Components/Orifices/Opening.mo
@@ -38,7 +38,6 @@ model Opening
     Placement(visible = true, transformation(origin = {38, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {90, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
 
 protected
-  parameter Modelica.SIunits.Height H_fluidStream = H * Cd ^0.5 "Minimal height between top and bottom flow path";
   Modelica.SIunits.MassFlowRate mX_flow_i[N, Medium.nX] ;
   Modelica.SIunits.SpecificEnthalpy h_a "Specific enthalpy from port_a" ;
   Modelica.SIunits.SpecificEnthalpy h_b "Specific enthalpy from port_b" ;
@@ -68,7 +67,7 @@ equation
   h_b = Medium.specificEnthalpy(state_b);
   
   for i in 1:N loop  
-    dp_i[i] = dp + Modelica.Constants.g_n * (H_fluidStream / 2 - H_fluidStream * (i - 1 / 2) / N) * (sum(port_a.d) - sum(port_b.d));
+    dp_i[i] = dp + Modelica.Constants.g_n * (H / 2 - H * (i - 1 / 2) / N) * (sum(port_a.d) - sum(port_b.d));
     d[i] = TAeZoSysPro.FluidDynamics.Utilities.regStep(x = Vel[i], x_small = 1e-10, y1 = sum(port_a.d), y2 = sum(port_b.d));
     if massDynamics == Dynamics.SteadyState then
       dp_i[i] - 1 / 2 * Modelica.Fluid.Utilities.regSquare2(x = Vel[i], x_small = Vel_small, k1 = sum(port_a.d), k2 = sum(port_b.d)) = 0.0;  
-- 
GitLab