Skip to content
Snippets Groups Projects
Commit ed9fd472 authored by PASCAL BOREL's avatar PASCAL BOREL
Browse files

improve commissioning damper :

        + remove initial equation (initial purpose was to help
                initialization by provided inverse function of homotopy
        + enable user to set T/deltaP ref used to compute damper Kv
        + fix homotopy simplified expr (to compute mass flow based on
            Kv)
parent 455790cd
No related branches found
No related tags found
No related merge requests found
......@@ -4,14 +4,17 @@ model CommissioningDamper
replaceable package Medium = TAeZoSysPro.Media.MyMedia "Medium in the component";
// User defined parameters
parameter Medium.MassFlowRate m_flow_nominal "Nominal mass flow rate" annotation(Dialog(group="Nominal operating point")) ;
parameter Modelica.SIunits.Pressure dp_nominal "Nominal pressure drop" annotation(Dialog(group="Nominal operating point")) ;
parameter Modelica.SIunits.Pressure dp_small = 0.01 * dp_nominal "Regularisation of zero flow" annotation(Dialog(tab="Advanced"));
parameter Medium.MassFlowRate m_flow_nominal "Nominal mass flow rate targeted" annotation(Dialog(group="Nominal operating point")) ;
parameter Modelica.SIunits.Pressure dp_ref=1e5 "Reference pressure drop (Standard states 1e5 Pa )" annotation(Dialog(group="Nominal operating point")) ;
parameter Modelica.SIunits.Temperature T_ref=293.15 "reference temperature used for computed Kv"annotation(Dialog(group="Nominal operating point"));
parameter Modelica.SIunits.Density rho_ref=Medium.density_pTX(Medium.p_default, T_ref, Medium.X_default) annotation(Dialog(group="Nominal operating point"));
parameter Modelica.SIunits.Pressure dp_small = 1 "Regularisation of zero flow" annotation(Dialog(tab="Advanced"));
parameter Real Kv(fixed = false) "(Metric) flow coefficient";
parameter Real Fxt=0.5 "F_gamma*xt critical ratio";
// Internal variables
Modelica.SIunits.Pressure dp(start=dp_nominal) "Pressure difference between port_a and port_b (= port_a.p - port_b.p)" ;
Modelica.SIunits.Pressure dp(start=100) "Pressure difference between port_a and port_b (= port_a.p - port_b.p)" ;
Medium.MassFlowRate m_flow(start = m_flow_nominal) "Mass flow rate in design flow direction";
// Imported modules
......@@ -24,18 +27,23 @@ protected
Real xs "Saturated pressure drop ratio";
Real Y "Compressibility factor";
initial equation
/* initial equation block comment :
+ was initially intented to help homotopy function inversion
+ lead to error since version 1.18 of OpenModelica
*/
//initial equation
Kv = if m_flow_nominal >= 0.0 then
3600 * m_flow_nominal / (31.6 * Y * sqrt(dp*1e-5*Medium.density_phX(
p = port_a.p,
h = inStream(port_a.h_outflow),
X = cat(1, inStream(port_a.Xi_outflow), {1 - sum(inStream(port_a.Xi_outflow))}))))
else
3600 * m_flow_nominal / (31.6 * Y * sqrt(dp*1e-5*Medium.density_phX(
p = port_b.p,
h = inStream(port_b.h_outflow),
X = cat(1, inStream(port_b.Xi_outflow), {1 - sum(inStream(port_b.Xi_outflow))})))) ;
// Kv = if m_flow_nominal >= 0.0 then
// 3600 * m_flow_nominal / (31.6 * Y * sqrt(dp*1e-5*Medium.density_phX(
// p = port_a.p,
// h = inStream(port_a.h_outflow),
// X = cat(1, inStream(port_a.Xi_outflow), {1 - sum(inStream(port_a.Xi_outflow))}))))
// else
// 3600 * m_flow_nominal / (31.6 * Y * sqrt(dp*1e-5*Medium.density_phX(
// p = port_b.p,
// h = inStream(port_b.h_outflow),
// X = cat(1, inStream(port_b.Xi_outflow), {1 - sum(inStream(port_b.Xi_outflow))})))) ;
equation
//
......@@ -44,19 +52,19 @@ equation
Y = 1 - abs(xs)/(3*Fxt);
//
m_flow = homotopy(Kv/3600 * 31.6 * Y * sqrt(1e-5) * Modelica.Fluid.Utilities.regRoot2(
m_flow = homotopy(Kv/3600.0 * sqrt(rho_ref) * Y * sqrt(1.0/dp_ref) * Modelica.Fluid.Utilities.regRoot2(
x = dp,
x_small = dp_small,
k1 = Medium.density_phX(
k1 = 1.0/Medium.density_phX(
p = port_a.p,
h = inStream(port_a.h_outflow),
X = cat(1, inStream(port_a.Xi_outflow), {1 - sum(inStream(port_a.Xi_outflow))})) ,
k2 = Medium.density_phX(
k2 = 1.0/Medium.density_phX(
p = port_b.p,
h = inStream(port_b.h_outflow),
X = cat(1, inStream(port_b.Xi_outflow), {1 - sum(inStream(port_b.Xi_outflow))}))),
m_flow_nominal*dp/dp_nominal );
Kv/3600*dp/dp_ref );
// Port handover
port_a.m_flow = m_flow ;
......@@ -73,34 +81,27 @@ equation
annotation(
Documentation(info=
"<html>
<head>
"<html><head>
<title>CommissioningDamper</title>
</head>
<body>
<p>
This components computes the (Metric) flow coefficient <b>Kv</b> that insures the mass flow rate <b> m_flow_nominal </b> through the damper at the initialisation.
</p>
This components computes the (Metric) flow coefficient <b>Kv</b> that insures the mass flow rate <b> m_flow_nominal </b> through the damper at the initialisation if m_flow(fixed=true) enabled.</p>
<p>
The flow coefficient Kv derives from the ISA-75.01.01-2007 standard for a compressible valve sizing (see <a href=\"modelica://TAeZoSysPro.FluidDynamics.Components.Valves.BaseClasses.PartialDamper\">PartialDamper</a>).
</p>
</p><p>dp_ref is used to compute Kv. To be consistent with standard, it should be kept to 1e5 Pa but could be modified by user to have more meaningfull Kv for HVAC application (order of magnitude of pressure drop across damper is 100 Pa)&nbsp;</p><p>Reference temperature is used to compute reference density (for water 1000 kg/m3 reference density is used)</p>
<p>
The nominal conditions (mainly pressure drop <code>dp_nominal</code> and mass flow rate <code>m_flow_nominal</code>) must be specified.
</p>
<p>Pressure drop across the damper is generally computed at initialization and derived from boundary condition;&nbsp;</p>
<ul>
<li> To avoid numerical singularities, the flow characteristic is modified for pressure drops less than <code>dp_small</code>.
The default value for <code>dp_small</code> is 1% of the nominal pressure drop <code>dp_nominal</code>.
Increase <code>dp_small</code> if numerical problems occur in dampers with very low pressure drops</li>
<li> To be used a guess values. Moreover the homotopy operator used <code>dp_nominal</code> and <code>m_flow_nominal</code> to compute the flow with the 'simplified' solution.
</ul>
</p>
</body>
</html>"),
The default value is 1 Pa but should be adjusted if required</li></ul>
<p></p>
</body></html>"),
Icon(graphics = {Rectangle(extent = {{-80, 80}, {80, -80}}), Bitmap(extent = {{-60, 60}, {60, -60}}, fileName = "modelica://TAeZoSysPro/FluidDynamics/Components/Valves/setting.png")}),
Diagram);
end CommissioningDamper;
end CommissioningDamper;
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment