Extends from Modelica_Fluid.Icons.BaseClassLibrary (Icon for library).
Name | Description |
---|---|
FlowModels | Flow models for pressure drop calculations |
PartialResistance | Partial model for a hydraulic resistance |
PartialThreeWayResistance | Flow splitter with partial resistance model at each port |
Partial model for a flow resistance, possible with variable flow coefficient. The pressure drop is computed by an instance of Buildings.Fluids.BaseClasses.FlowModels.BasicFlowModel, i.e., using a regularized implementation of the equation
m_flow = sign(dp) * k * sqrt(|dp|).Extends from Modelica_Fluid.Interfaces.PartialTwoPortTransport (Partial element transporting fluid between two ports without storage of mass or energy).
Type | Name | Default | Description |
---|---|---|---|
replaceable package Medium | PartialMedium | Medium in the component | |
Nominal condition | |||
MassFlowRate | m_flow_nominal | Nominal mass flow rate [kg/s] | |
Pressure | dp_nominal | Pressure [Pa] | |
Assumptions | |||
Boolean | allowFlowReversal | system.allowFlowReversal | = true to allow flow reversal, false restricts to design direction (port_a -> port_b) |
Advanced | |||
AbsolutePressure | dp_start | 0.01*system.p_start | Guess value of dp = port_a.p - port_b.p [Pa] |
MassFlowRate | m_flow_start | system.m_flow_start | Guess value of m_flow = port_a.m_flow [kg/s] |
MassFlowRate | m_flow_small | 1E-4*m_flow_nominal | Small mass flow rate for regularization of zero flow [kg/s] |
Boolean | from_dp | true | = true, use m_flow = f(dp) else dp = f(m_flow) |
Boolean | linearized | false | = true, use linear relation between m_flow and dp for any flow rate |
Diagnostics | |||
Boolean | show_T | true | = true, if temperatures at port_a and port_b are computed |
Boolean | show_V_flow | true | = true, if volume flow rate at inflowing port is computed |
Type | Name | Description |
---|---|---|
FluidPort_a | port_a | Fluid connector a (positive design flow direction is from port_a to port_b) |
FluidPort_b | port_b | Fluid connector b (positive design flow direction is from port_a to port_b) |
partial model PartialResistance "Partial model for a hydraulic resistance" extends Modelica_Fluid.Interfaces.PartialTwoPortTransport(m_flow_small = 1E-4*m_flow_nominal, m_flow(nominal=m_flow_nominal), dp(nominal=dp_nominal, displayUnit="Pa")); parameter Boolean from_dp = true "= true, use m_flow = f(dp) else dp = f(m_flow)"; parameter Medium.MassFlowRate m_flow_nominal(min=0) "Nominal mass flow rate"; parameter Modelica.SIunits.Pressure dp_nominal(min=0, displayUnit="Pa") "Pressure"; parameter Boolean linearized = false "= true, use linear relation between m_flow and dp for any flow rate"; Real k(unit="") "Flow coefficient, k=m_flow/sqrt(dp), with unit=(kg.m)^(1/2)"; Medium.MassFlowRate m_flow_turbulent "Turbulent flow if |m_flow| >= m_flow_turbulent, not a parameter because k can be a function of time"; // Modelica.SIunits.Pressure dp_turbulent // "Turbulent flow if |dp| >= dp_small, not a parameter because k can be a function of time"; protected parameter Medium.ThermodynamicState sta0= Medium.setState_pTX(T=Medium.T_default, p=Medium.p_default, X=Medium.X_default); parameter Modelica.SIunits.DynamicViscosity eta_nominal=Medium.dynamicViscosity(sta0) "Dynamic viscosity, used to compute transition to turbulent flow regime"; parameter Modelica.SIunits.SpecificEnthalpy h0=Medium.h_default "Initial value for solver for specific enthalpy"; //specificEnthalpy(sta0) constant Real conv(unit="m.s2/kg") = 1 "Factor, needed to satisfy unit check"; constant Real conv2 = sqrt(conv) "Factor, needed to satisfy unit check"; equation // Pressure drop calculation if from_dp then m_flow=FlowModels.basicFlowFunction_dp(dp=dp, k=k, m_flow_turbulent=m_flow_turbulent, linearized=linearized); else dp=FlowModels.basicFlowFunction_m_flow(m_flow=m_flow, k=k, m_flow_turbulent=m_flow_turbulent, linearized=linearized); end if; // Isenthalpic state transformation (no storage and no loss of energy) port_a.h_outflow = inStream(port_b.h_outflow); port_b.h_outflow = inStream(port_a.h_outflow); end PartialResistance;
Partial model for flow resistances with three ports such as a flow mixer/splitter or a three way valve.
Type | Name | Default | Description |
---|---|---|---|
PartialTwoPortTransport | res1 | redeclare Modelica_Fluid.Int... | Partial model, to be replaced with a fluid component |
PartialTwoPortTransport | res2 | redeclare Modelica_Fluid.Int... | Partial model, to be replaced with a fluid component |
PartialTwoPortTransport | res3 | redeclare Modelica_Fluid.Int... | Partial model, to be replaced with a fluid component |
Advanced | |||
Boolean | from_dp | true | = true, use m_flow = f(dp) else dp = f(m_flow) |
Type | Name | Description |
---|---|---|
FluidPort_a | port_1 | |
FluidPort_b | port_2 | |
FluidPort_a | port_3 |
partial model PartialThreeWayResistance "Flow splitter with partial resistance model at each port" replaceable package Medium = Modelica.Media.Interfaces.PartialMedium "Fluid medium model"; Modelica_Fluid.Interfaces.FluidPort_a port_1(redeclare package Medium = Medium, m_flow(min=if (portFlowDirection_1 == Modelica_Fluid.Types.PortFlowDirection.Entering) then 0.0 else -Modelica.Constants.inf, max=if (portFlowDirection_1 == Modelica_Fluid.Types.PortFlowDirection.Leaving) then 0.0 else Modelica.Constants.inf)); Modelica_Fluid.Interfaces.FluidPort_b port_2(redeclare package Medium = Medium, m_flow(min=if (portFlowDirection_2 == Modelica_Fluid.Types.PortFlowDirection.Entering) then 0.0 else -Modelica.Constants.inf, max=if (portFlowDirection_2 == Modelica_Fluid.Types.PortFlowDirection.Leaving) then 0.0 else Modelica.Constants.inf)); Modelica_Fluid.Interfaces.FluidPort_a port_3( redeclare package Medium=Medium, m_flow(min=if (portFlowDirection_3==Modelica_Fluid.Types.PortFlowDirection.Entering) then 0.0 else -Modelica.Constants.inf, max=if (portFlowDirection_3==Modelica_Fluid.Types.PortFlowDirection.Leaving) then 0.0 else Modelica.Constants.inf)); parameter Boolean from_dp = true "= true, use m_flow = f(dp) else dp = f(m_flow)"; replaceable Modelica_Fluid.Interfaces.PartialTwoPortTransport res1(redeclare package Medium = Medium) "Partial model, to be replaced with a fluid component"; replaceable Modelica_Fluid.Interfaces.PartialTwoPortTransport res2(redeclare package Medium = Medium) "Partial model, to be replaced with a fluid component"; replaceable Modelica_Fluid.Interfaces.PartialTwoPortTransport res3(redeclare package Medium = Medium) "Partial model, to be replaced with a fluid component"; protected parameter Modelica_Fluid.Types.PortFlowDirection portFlowDirection_1=Modelica_Fluid.Types.PortFlowDirection.Bidirectional "Flow direction for port_1"; parameter Modelica_Fluid.Types.PortFlowDirection portFlowDirection_2=Modelica_Fluid.Types.PortFlowDirection.Bidirectional "Flow direction for port_2"; parameter Modelica_Fluid.Types.PortFlowDirection portFlowDirection_3=Modelica_Fluid.Types.PortFlowDirection.Bidirectional "Flow direction for port_3"; equation connect(port_1, res1.port_a); connect(res2.port_b, port_2); connect(res3.port_a, port_3); connect(res1.port_b, res2.port_a); connect(res1.port_b, res3.port_b); end PartialThreeWayResistance;