Buildings.Fluid.CHPs.OrganicRankine

Package for the rankine cycle

Information

Package with a model of an organic Rankine cycle.

Extends from Modelica.Icons.VariantsPackage (Icon for package containing variants).

Package Content

Name Description
Buildings.Fluid.CHPs.OrganicRankine.ConstantEvaporation ConstantEvaporation Organic Rankine cycle as a bottoming cycle
Buildings.Fluid.CHPs.OrganicRankine.Cycle Cycle Organic Rankine cycle as a bottoming cycle
Buildings.Fluid.CHPs.OrganicRankine.Data Data Package with working fluid data
Buildings.Fluid.CHPs.OrganicRankine.Examples Examples Package containing example models
Buildings.Fluid.CHPs.OrganicRankine.Validation Validation Collection of validation models
Buildings.Fluid.CHPs.OrganicRankine.BaseClasses BaseClasses Package with base classes

Buildings.Fluid.CHPs.OrganicRankine.ConstantEvaporation Buildings.Fluid.CHPs.OrganicRankine.ConstantEvaporation

Organic Rankine cycle as a bottoming cycle

Buildings.Fluid.CHPs.OrganicRankine.ConstantEvaporation

Information

Model of an organic Rankine cycle (ORC) as a bottoming cycle.

The thermodynamic cycle is steady-state while the evaporator and the condenser can be configured to have first order dynamics. The fluid stream 1 (using Medium1, port_a1, etc.) is the evaporator hot fluid, e.g., waste heat, and the stream 2 is the condenser cold fluid. The working fluid of the cycle is not based on a typical Modelica medium model. See the Thermodynamic Properties section of this document for the rational.

Cycle Architecture and Governing Equations

The implemented ORC is modeled based on the simplified cycle shown in the figure below. The cycle has two variants depending on the shape of the saturation lines of the working fluid and ηexp. For any given working fluid, the cycle is fully determined by providing the working fluid evaporating temperature Tw,eva, the working fluid condensing temperature Tw,con, the expander efficiency ηexp, and the pump efficiency ηpum. The superheating temperature difference ΔTsup is minimized, meaning it is zero whenever possible; otherwise it assumes the smallest value not to cause the expander outlet state to fall under the two-phase region, i.e. the "dome". Subcooling after the condenser is not considered. The Thermodynamic Properties section of this document details how these state points are found.

An important assumption is that all heat is dissipated, i.e., the cycle is not controlled by thermal load.

CycleArchitecture

The cycle processes the heat at a fixed Tw,eva provided by the user. The evaporator heat exchange is governed by

eva = ṁh cp,h (Th,out - Th,in),
eva = ṁw (hpum,out - hexp,in),

where the subscripts are eva for evaporator, exp for expander, h for hot fluid of the evaporator, i.e. the fluid carrying heat, pum for pump, and w for working fluid.

The cycle accommodates the variable flow rate and temperature of the waste heat stream by changing the working fluid mass flow rate w to maintain a constant pinch point (PP) temperature difference at the evaporator ΔTpin,eva. This difference is found from

(Tpin,eva - Th,out) (hexp,in - hpum,out) = (Th,in - Th,out) (heva,pin - hpum,out),
ΔTpin,eva = Tpin,eva - Tw,eva.

The condenser side uses the same equations with the evaporator variables replaced by their condenser counterparts where appropriate. Hence,

con = ṁc cp,c (Tc,out - Tc,in),
con = ṁw (hpum,in - hexp,out),
(Tc,pin - Tc,in) (hexp,out - hpum,in) = (Tc,out - Tc,in) (hcon,pin - hpum,in),
ΔTcon,pin = Tw,con - Tc,pin,

where the subscripts are con for condenser, and c for cold fluid in the condenser.

The electric power output of the expander is

Pexp = ṁw (hexp,in - hexp,out).

The electric power consumption of the pump is

Ppum = ṁw (hpum,out - hpum,in).

The pump work is

Ppum = ṁw  (peva - pcon) / (ρpum,in ηpum).

This takes advantage of the negligible density change of the liquid to avoid a property search in the subcooled liquid region.

In summary, the model has the following information flow:

User-specified parameters Inputs Outputs
Tw,eva - Working fluid evaporating temperature,
ΔTpin,eva - Evaporator pinch point temperature difference,
ΔTpin,con - Condenser pinch point temperature difference,
ηexp - Expander efficiency,
ηpum - Pump efficiency.
Th,in - Evaporator hot fluid incoming temperature,
h - Evaporator hot fluid flow rate,
Tc,in - Condenser cold fluid incoming temperature,
c - Condenser cold fluid flow rate.
w - Working fluid flow rate,
Tw,con - Working fluid condensing temperature,
Th,out - Evaporator hot fluid outgoing temperature,
Tc,out - Condenser cold fluid outgoing temperature,
eva - Evaporator heat flow rate,
con - Condenser heat flow rate,
Pexp - Expander power output,
Ppum - Pump power consumption.

Constraints

The ORC system controls w to maintain the prescribed evaporator PP temperature difference set point. Although the model does not implement this as a control loop, an upper limit and a lower limit are imposed on w to reflect the capacity constraints of a sized cycle.

How these constraints affect the cycle's behavior reacting to a variable waste heat fluid stream is demonstrated in Buildings.Fluid.CHPs.OrganicRankine.Validation.VariableSource.

Thermodynamic Properties

The thermodynamic properties of the working fluid are not computed by a typical Modelica medium model, but by interpolating data records in Buildings.Fluid.CHPs.OrganicRankine.Data. Specific enthalpy and specific entropy values are provided as support points on the saturated liquid line, the saturated vapor line, and a superheated vapor line (called the reference line). The values of these support points were obtained using CoolProp (https://www.coolprop.org; Bell et al., 2014) through its Python wrapper and stored as Modelica records. An example Python file is provided in Buildings/Resources/Python-Sources/MakeORCFluidRecord.py, but note that this file is not maintained. The records included in this library have ten data points for each line. It is recommended to have at least four points to take full advantage of the cubit Hermite spline interpolation that is set up in this model.

Thermodynamic state points in the cycle are determined by various schemes of interpolation and extrapolation.

SupportCurves

The cycle can be completely defined by providing the following quantities: evaporating temperature Teva or pressure peva, condensing temperature Tcon or pressure pcon, expander efficiency ηexp, and pump efficiency ηpum. Most of the important state points can be found via the interpolation schemes described above. The only exceptions are the expander inlet, expander outlet, and the pump outlet.

ComputationPaths

Implementation

The user can parameterise the evaporating condition by providing either the evaporating temperature TWorEva or the evaporating pressure pWorEva. To support this, a default parameter assignment is provided to both. Otherwise there would be unassigned parameters even though they are not needed.

References

Bell IH, Wronski J, Quoilin S, Lemort V. Pure and pseudo-pure fluid thermophysical property evaluation and the open-source thermophysical property library CoolProp. Industrial & engineering chemistry research. 2014 Feb 12;53(6):2498-508. https://doi.org/10.1021/ie4033999

Extends from Buildings.Fluid.Interfaces.FourPortHeatMassExchanger (Model transporting two fluid streams between four ports with storing mass or energy).

Parameters

TypeNameDefaultDescription
replaceable package Medium1PartialMediumMedium 1 in the component
replaceable package Medium2PartialMediumMedium 2 in the component
Nominal condition
MassFlowRatem1_flow_nominalmHot_flow_nominalNominal mass flow rate [kg/s]
MassFlowRatem2_flow_nominalmCol_flow_nominalNominal mass flow rate [kg/s]
PressureDifferencedp1_nominaldpHot_nominalPressure difference [Pa]
PressureDifferencedp2_nominaldpCol_nominalPressure difference [Pa]
Cycle
Genericproredeclare parameter Building...Property records of the working fluid
MassFlowRatemWor_flow_max Upper bound of working fluid flow rate [kg/s]
MassFlowRatemWor_flow_min Lower bound of working fluid flow rate [kg/s]
MassFlowRatemWor_flow_hysteresismWor_flow_min + (mWor_flow_m...Hysteresis for turning off the cycle when flow too low [kg/s]
EfficiencyetaExp Expander efficiency [1]
EfficiencyetaPum Pump efficiency [1]
Evaporator
MassFlowRatemHot_flow_nominal Nominal mass flow rate of the evaporator fluid [kg/s]
PressureDifferencedpHot_nominal Nominal pressure drop of the hot fluid in evaporator [Pa]
TemperatureDifferencedTPinEva_set5Set evaporator pinch point temperature difference [K]
BooleanuseEvaporatingPressurefalseSet true to specify working fluid evaporating pressure instead of temperature
ThermodynamicTemperatureTWorEvamax(pro.T)*2/3 + min(pro.T)*...Evaporating temperature of the working fluid [K]
PressurepWorEvamax(pro.p)*2/3 + min(pro.p)*...Evaporating pressure of the working fluid [Pa]
Condenser
MassFlowRatemCol_flow_nominal Nominal mass flow rate of the condenser fluid [kg/s]
PressureDifferencedpCol_nominal Nominal pressure drop of the cold fluid in condenser [Pa]
TemperatureDifferencedTPinCon10Condenser pinch point temperature difference [K]
BooleanuseLowCondenserPressureWarningtrueIf true, issues warning if pCon < 101325 Pa
Assumptions
BooleanallowFlowReversal1true= false to simplify equations, assuming, but not enforcing, no flow reversal for medium 1
BooleanallowFlowReversal2true= false to simplify equations, assuming, but not enforcing, no flow reversal for medium 2
Advanced
MassFlowRatem1_flow_small1E-4*abs(m1_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
MassFlowRatem2_flow_small1E-4*abs(m2_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed
Flow resistance
Medium 1
Booleanfrom_dp1false= true, use m_flow = f(dp) else dp = f(m_flow)
BooleanlinearizeFlowResistance1false= true, use linear relation between m_flow and dp for any flow rate
RealdeltaM10.1Fraction of nominal flow rate where flow transitions to laminar
Medium 2
Booleanfrom_dp2false= true, use m_flow = f(dp) else dp = f(m_flow)
BooleanlinearizeFlowResistance2false= true, use linear relation between m_flow and dp for any flow rate
RealdeltaM20.1Fraction of nominal flow rate where flow transitions to laminar
Dynamics
Nominal condition
Timetau130Time constant at nominal flow [s]
Timetau230Time constant at nominal flow [s]
Conservation equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state
Initialization
Medium 1
AbsolutePressurep1_startMedium1.p_defaultStart value of pressure [Pa]
TemperatureT1_startmax(pro.T)*2/3 + min(pro.T)*...Start value of temperature [K]
MassFractionX1_start[Medium1.nX]Medium1.X_defaultStart value of mass fractions m_i/m [kg/kg]
ExtraPropertyC1_start[Medium1.nC]fill(0, Medium1.nC)Start value of trace substances
ExtraPropertyC1_nominal[Medium1.nC]fill(1E-2, Medium1.nC)Nominal value of trace substances. (Set to typical order of magnitude.)
Medium 2
AbsolutePressurep2_startMedium2.p_defaultStart value of pressure [Pa]
TemperatureT2_startmax(pro.T)*1/10 + min(pro.T)...Start value of temperature [K]
MassFractionX2_start[Medium2.nX]Medium2.X_defaultStart value of mass fractions m_i/m [kg/kg]
ExtraPropertyC2_start[Medium2.nC]fill(0, Medium2.nC)Start value of trace substances
ExtraPropertyC2_nominal[Medium2.nC]fill(1E-2, Medium2.nC)Nominal value of trace substances. (Set to typical order of magnitude.)

Connectors

TypeNameDescription
FluidPort_aport_a1Fluid connector a1 (positive design flow direction is from port_a1 to port_b1)
FluidPort_bport_b1Fluid connector b1 (positive design flow direction is from port_a1 to port_b1)
FluidPort_aport_a2Fluid connector a2 (positive design flow direction is from port_a2 to port_b2)
FluidPort_bport_b2Fluid connector b2 (positive design flow direction is from port_a2 to port_b2)
input BooleanInputenaEnable cycle; set false to force working fluid flow to zero
output RealOutputPExpExpander power generation [W]
output RealOutputQEva_flowEvaporator heat flow rate into the cycle [W]
output RealOutputQCon_flowCondenser heat flow rate out of the cycle [W]
output BooleanOutputon_actualActual on off status of the cycle
output RealOutputPPumElectrical power consumption of the pump [W]

Modelica definition

model ConstantEvaporation "Organic Rankine cycle as a bottoming cycle" extends Buildings.Fluid.Interfaces.FourPortHeatMassExchanger( final m1_flow_nominal = mHot_flow_nominal, final dp1_nominal = dpHot_nominal, final m2_flow_nominal = mCol_flow_nominal, final dp2_nominal = dpCol_nominal, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, T1_start = max(pro.T)*2/3 + min(pro.T)*1/3, T2_start = max(pro.T)*1/10 + min(pro.T)*9/10, redeclare final Buildings.Fluid.MixingVolumes.MixingVolume vol2( V=m2_flow_nominal*tau2/rho2_nominal, nPorts=2, final prescribedHeatFlowRate=true), final vol1( final prescribedHeatFlowRate=true)); replaceable parameter Buildings.Fluid.CHPs.OrganicRankine.Data.Generic pro constrainedby Buildings.Fluid.CHPs.OrganicRankine.Data.Generic "Property records of the working fluid"; parameter Modelica.Units.SI.MassFlowRate mHot_flow_nominal "Nominal mass flow rate of the evaporator fluid"; parameter Modelica.Units.SI.PressureDifference dpHot_nominal( displayUnit="Pa") "Nominal pressure drop of the hot fluid in evaporator"; parameter Modelica.Units.SI.TemperatureDifference dTPinEva_set( final min = 0) = 5 "Set evaporator pinch point temperature difference"; parameter Boolean useEvaporatingPressure = false "Set true to specify working fluid evaporating pressure instead of temperature"; parameter Modelica.Units.SI.ThermodynamicTemperature TWorEva = max(pro.T)*2/3 + min(pro.T)*1/3 "Evaporating temperature of the working fluid"; parameter Modelica.Units.SI.Pressure pWorEva(displayUnit="kPa") = max(pro.p)*2/3 + min(pro.p)*1/3 "Evaporating pressure of the working fluid"; parameter Modelica.Units.SI.MassFlowRate mCol_flow_nominal "Nominal mass flow rate of the condenser fluid"; parameter Modelica.Units.SI.PressureDifference dpCol_nominal( displayUnit="Pa") "Nominal pressure drop of the cold fluid in condenser"; parameter Modelica.Units.SI.TemperatureDifference dTPinCon( final min = 0) = 10 "Condenser pinch point temperature difference"; parameter Boolean useLowCondenserPressureWarning = true "If true, issues warning if pCon < 101325 Pa"; parameter Modelica.Units.SI.MassFlowRate mWor_flow_max( final min = 0) "Upper bound of working fluid flow rate"; parameter Modelica.Units.SI.MassFlowRate mWor_flow_min( final min = 0) "Lower bound of working fluid flow rate"; parameter Modelica.Units.SI.MassFlowRate mWor_flow_hysteresis = mWor_flow_min + (mWor_flow_max - mWor_flow_min) * 0.1 "Hysteresis for turning off the cycle when flow too low"; parameter Modelica.Units.SI.Efficiency etaExp "Expander efficiency"; parameter Modelica.Units.SI.Efficiency etaPum "Pump efficiency"; Modelica.Blocks.Interfaces.BooleanInput ena "Enable cycle; set false to force working fluid flow to zero"; Modelica.Blocks.Interfaces.RealOutput PExp( final quantity="Power", final unit="W") "Expander power generation"; Modelica.Blocks.Interfaces.RealOutput QEva_flow( final quantity="HeatFlowRate", final unit="W") "Evaporator heat flow rate into the cycle"; Modelica.Blocks.Interfaces.RealOutput QCon_flow( final quantity="HeatFlowRate", final unit="W") "Condenser heat flow rate out of the cycle"; Modelica.Blocks.Interfaces.BooleanOutput on_actual(start = false) "Actual on off status of the cycle"; Modelica.Blocks.Interfaces.RealOutput PPum( final quantity="Power", final unit="W") "Electrical power consumption of the pump"; Buildings.Fluid.CHPs.OrganicRankine.BaseClasses.FixedEvaporating cyc( final pro=pro, final mWor_flow_max=mWor_flow_max, final mWor_flow_min=mWor_flow_min, final mWor_flow_hysteresis=mWor_flow_hysteresis, final TWorEva = if useEvaporatingPressure then Buildings.Utilities.Math.Functions.smoothInterpolation( x = pWorEva, xSup = pro.p, ySup = pro.T) else TWorEva, final dTPinEva_set=dTPinEva_set, final dTPinCon=dTPinCon, final cpHot=Medium1.specificHeatCapacityCp(sta1_nominal), final cpCol=Medium2.specificHeatCapacityCp(sta2_nominal), final etaExp=etaExp, final etaPum=etaPum, final useLowCondenserPressureWarning=useLowCondenserPressureWarning) "Thermodynamic computations of the organic Rankine cycle"; protected Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow preHeaFloEva "Prescribed heat flow rate"; Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow preHeaFloCon "Prescribed heat flow rate"; Modelica.Blocks.Sources.RealExpression expTHotIn(y=Medium1.temperature( state=Medium1.setState_phX( p=port_a1.p, h=inStream(port_a1.h_outflow), X=inStream(port_a1.Xi_outflow)))) "Expression for evaporator hot fluid incoming temperature"; Modelica.Blocks.Sources.RealExpression expMHot_flow(y=m1_flow) "Expression for evaporator hot fluid flow rate"; Modelica.Blocks.Sources.RealExpression expTColIn(y=Medium2.temperature( state=Medium2.setState_phX( p=port_a2.p, h=inStream(port_a2.h_outflow), X=inStream(port_a2.Xi_outflow)))) "Expression for condenser cold fluid incoming temperature"; Modelica.Blocks.Sources.RealExpression expMCol_flow(y=m2_flow) "Expression for condenser cold fluid flow rate"; equation connect(preHeaFloEva.port, vol1.heatPort); connect(preHeaFloCon.port, vol2.heatPort); connect(expTHotIn.y, cyc.THotIn); connect(expMHot_flow.y, cyc.mHot_flow); connect(expTColIn.y, cyc.TColIn); connect(expMCol_flow.y, cyc.mCol_flow); connect(cyc.PExp,PExp); connect(ena, cyc.ena); connect(cyc.QEva_flow, QEva_flow); connect(cyc.QCon_flow, QCon_flow); connect(cyc.on_actual, on_actual); connect(cyc.PPum, PPum); connect(cyc.QEva_flow, preHeaFloEva.Q_flow); connect(cyc.QCon_flow, preHeaFloCon.Q_flow); end ConstantEvaporation;

Buildings.Fluid.CHPs.OrganicRankine.Cycle Buildings.Fluid.CHPs.OrganicRankine.Cycle

Organic Rankine cycle as a bottoming cycle

Buildings.Fluid.CHPs.OrganicRankine.Cycle

Information

Model of an organic Rankine cycle (ORC) as a bottoming cycle.

The thermodynamic cycle is steady-state while the evaporator and the condenser can be configured to have first order dynamics. The fluid stream 1 (using Medium1, port_a1, etc.) is the evaporator hot fluid carrying waste heat and the stream 2 is the condenser cold fluid carrying the cooling fluid. The working fluid of the cycle is not based on a typical Modelica medium model. See the Thermodynamic Properties section of this document for the rational.

Cycle Architecture and Governing Equations

The implemented ORC is modeled based on the simplified cycle shown in the figure below. The cycle has two variants depending on the shape of the saturation lines of the working fluid and ηexp. For any given working fluid, the cycle is fully determined by providing the working fluid evaporating temperature Tw,eva, the working fluid condensing temperature Tw,con, the expander efficiency ηexp, and the pump efficiency ηpum. The superheating temperature difference ΔTsup is minimized, meaning it is zero whenever possible; otherwise it assumes the smallest value not to cause the expander outlet state to fall under the dome. Subcooling after the condenser is not considered. The Thermodynamic Properties section of this document details how these state points are found.

An important assumption is that all heat is dissipated, i.e., the cycle is not controlled thermal load.

CycleArchitecture

The cycle processes the heat at a fixed Tw,eva provided by the user. The evaporator heat exchange is governed by

eva = ṁh cp,h (Th,out - Th,in),
eva = ṁw (hpum,out - hexp,in),

where the subscripts are eva for evaporator, exp for expander, h for hot fluid of the evaporator, i.e. the fluid carrying heat, pum for pump, and w for working fluid.

The cycle accommodates the variable flow rate and temperature of the waste heat stream by changing the working fluid mass flow rate w to maintain a constant pinch point (PP) temperature difference at the evaporator ΔTpin,eva. This difference is found from

(Tpin,eva - Th,out) (hexp,in - hpum,out) = (Th,in - Th,out) (heva,pin - hpum,out),
ΔTpin,eva = Tpin,eva - Tw,eva.

The condenser side uses the same equations with the evaporator variables replaced by their condenser counterparts where appropriate. Hence,

con = ṁc cp,c (Tc,out - Tc,in),
con = ṁw (hpum,in - hexp,out),
(Tc,pin - Tc,in) (hexp,out - hpum,in) = (Tc,out - Tc,in) (hcon,pin - hpum,in),
ΔTcon,pin = Tw,con - Tc,pin,

where the subscripts are con for condenser, and c for cold fluid in the condenser.

The electric power output of the expander is

Pexp = ṁw (hexp,in - hexp,out).

The electric power consumption of the pump is

Ppum = ṁw (hpum,out - hpum,in).

The pump work is

Ppum = ṁw  (peva - pcon) / (ρpum,in ηpum).

This takes advantage of the negligible density change of the liquid to avoid a property search in the subcooled liquid region.

In summary, the model has the following information flow:

User-specified parameters Inputs Outputs
Tw,eva - Working fluid evaporating temperature,
ΔTpin,eva - Evaporator pinch point temperature difference,
ΔTpin,con - Condenser pinch point temperature difference,
ηexp - Expander efficiency,
ηpum - Pump efficiency.
Th,in - Evaporator hot fluid incoming temperature,
h - Evaporator hot fluid flow rate,
Tc,in - Condenser cold fluid incoming temperature,
c - Condenser cold fluid flow rate.
w - Working fluid flow rate,
Tw,con - Working fluid condensing temperature,
Th,out - Evaporator hot fluid outgoing temperature,
Tc,out - Condenser cold fluid outgoing temperature,
eva - Evaporator heat flow rate,
con - Condenser heat flow rate,
Pexp - Expander power output,
Ppum - Pump power consumption.

Constraints

The ORC system controls w to maintain the prescribed evaporator PP temperature difference set point. Although the model does not implement this as a control loop, an upper limit and a lower limit are imposed on w to reflect the characteristics of a sized cycle.

How these constraints affect the cycle's behavior reacting to a variable waste heat fluid stream is demonstrated in Buildings.Fluid.CHPs.OrganicRankine.Validation.VariableSource.

Thermodynamic Properties

The thermodynamic properties of the working fluid are not computed by a typical Modelica medium model, but by interpolating data records in Buildings.Fluid.CHPs.OrganicRankine.Data. Specific enthalpy and specific entropy values are provided as support points on the saturated liquid line, the saturated vapor line, and a superheated vapor line (called the reference line). The values of these support points were obtained using CoolProp (https://www.coolprop.org; Bell et al., 2014) through its Python wrapper and stored as Modelica records. The records included in this library have ten data points for each line. It is recommended to have at least four points to take full advantage of the cubit Hermite spline interpolation that is set up in this model.

Thermodynamic state points in the cycle are determined by various schemes of interpolation and extrapolation.

SupportCurves

The cycle can be completely defined by providing the following quantities: evaporating temperature Teva or pressure peva, condensing temperature Tcon or pressure pcon, expander efficiency ηexp, and pump efficiency ηpum. Most of the important state points can be found via the interpolation schemes described above. The only exceptions are the expander inlet, expander outlet, and the pump outlet.

ComputationPaths

References

Bell IH, Wronski J, Quoilin S, Lemort V. Pure and pseudo-pure fluid thermophysical property evaluation and the open-source thermophysical property library CoolProp. Industrial & engineering chemistry research. 2014 Feb 12;53(6):2498-508. https://doi.org/10.1021/ie4033999

Extends from Buildings.Fluid.Interfaces.FourPortHeatMassExchanger (Model transporting two fluid streams between four ports with storing mass or energy).

Parameters

TypeNameDefaultDescription
replaceable package Medium1PartialMediumMedium 1 in the component
replaceable package Medium2PartialMediumMedium 2 in the component
Nominal condition
MassFlowRatem1_flow_nominalmHot_flow_nominalNominal mass flow rate [kg/s]
MassFlowRatem2_flow_nominalmCol_flow_nominalNominal mass flow rate [kg/s]
PressureDifferencedp1_nominaldpHot_nominalPressure difference [Pa]
PressureDifferencedp2_nominaldpCol_nominalPressure difference [Pa]
Cycle
Genericproredeclare parameter Building...Property records of the working fluid
MassFlowRatemWor_flow_max Upper bound of working fluid flow rate [kg/s]
MassFlowRatemWor_flow_min Lower bound of working fluid flow rate [kg/s]
MassFlowRatemWor_flow_hysteresismWor_flow_min + (mWor_flow_m...Hysteresis for turning off the cycle when flow too low [kg/s]
EfficiencyetaExp Expander efficiency [1]
EfficiencyetaPum Pump efficiency [1]
Evaporator
MassFlowRatemHot_flow_nominal Nominal mass flow rate of the evaporator fluid [kg/s]
PressureDifferencedpHot_nominal Nominal pressure drop of the hot fluid in evaporator [Pa]
TemperatureDifferencedTPinEva_set5Set evaporator pinch point temperature difference [K]
BooleanuseEvaporatingPressurefalseSet true to specify working fluid evaporating pressure instead of temperature
ThermodynamicTemperatureTWorEvamax(pro.T)*2/3 + min(pro.T)*...Evaporating temperature of the working fluid [K]
PressurepWorEvamax(pro.p)*2/3 + min(pro.p)*...Evaporating pressure of the working fluid [Pa]
Condenser
MassFlowRatemCol_flow_nominal Nominal mass flow rate of the condenser fluid [kg/s]
PressureDifferencedpCol_nominal Nominal pressure drop of the cold fluid in condenser [Pa]
TemperatureDifferencedTPinCon10Condenser pinch point temperature difference [K]
BooleanuseLowCondenserPressureWarningtrueIf true, issues warning if pCon < 101325 Pa
Assumptions
BooleanallowFlowReversal1true= false to simplify equations, assuming, but not enforcing, no flow reversal for medium 1
BooleanallowFlowReversal2true= false to simplify equations, assuming, but not enforcing, no flow reversal for medium 2
Advanced
MassFlowRatem1_flow_small1E-4*abs(m1_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
MassFlowRatem2_flow_small1E-4*abs(m2_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed
Flow resistance
Medium 1
Booleanfrom_dp1false= true, use m_flow = f(dp) else dp = f(m_flow)
BooleanlinearizeFlowResistance1false= true, use linear relation between m_flow and dp for any flow rate
RealdeltaM10.1Fraction of nominal flow rate where flow transitions to laminar
Medium 2
Booleanfrom_dp2false= true, use m_flow = f(dp) else dp = f(m_flow)
BooleanlinearizeFlowResistance2false= true, use linear relation between m_flow and dp for any flow rate
RealdeltaM20.1Fraction of nominal flow rate where flow transitions to laminar
Dynamics
Nominal condition
Timetau130Time constant at nominal flow [s]
Timetau230Time constant at nominal flow [s]
Conservation equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state
Initialization
Medium 1
AbsolutePressurep1_startMedium1.p_defaultStart value of pressure [Pa]
TemperatureT1_startmax(pro.T)*2/3 + min(pro.T)*...Start value of temperature [K]
MassFractionX1_start[Medium1.nX]Medium1.X_defaultStart value of mass fractions m_i/m [kg/kg]
ExtraPropertyC1_start[Medium1.nC]fill(0, Medium1.nC)Start value of trace substances
ExtraPropertyC1_nominal[Medium1.nC]fill(1E-2, Medium1.nC)Nominal value of trace substances. (Set to typical order of magnitude.)
Medium 2
AbsolutePressurep2_startMedium2.p_defaultStart value of pressure [Pa]
TemperatureT2_startmax(pro.T)*1/10 + min(pro.T)...Start value of temperature [K]
MassFractionX2_start[Medium2.nX]Medium2.X_defaultStart value of mass fractions m_i/m [kg/kg]
ExtraPropertyC2_start[Medium2.nC]fill(0, Medium2.nC)Start value of trace substances
ExtraPropertyC2_nominal[Medium2.nC]fill(1E-2, Medium2.nC)Nominal value of trace substances. (Set to typical order of magnitude.)

Connectors

TypeNameDescription
FluidPort_aport_a1Fluid connector a1 (positive design flow direction is from port_a1 to port_b1)
FluidPort_bport_b1Fluid connector b1 (positive design flow direction is from port_a1 to port_b1)
FluidPort_aport_a2Fluid connector a2 (positive design flow direction is from port_a2 to port_b2)
FluidPort_bport_b2Fluid connector b2 (positive design flow direction is from port_a2 to port_b2)
input BooleanInputenaEnable cycle; set false to force working fluid flow to zero
output RealOutputPExpExpander power generation [W]
output RealOutputQEva_flowEvaporator heat flow rate into the cycle [W]
output RealOutputQCon_flowCondenser heat flow rate out of the cycle [W]
output BooleanOutputon_actualActual on off status of the cycle
output RealOutputPPumElectrical power consumption of the pump [W]

Modelica definition

model Cycle "Organic Rankine cycle as a bottoming cycle" extends Buildings.Fluid.Interfaces.FourPortHeatMassExchanger( final m1_flow_nominal = mHot_flow_nominal, final dp1_nominal = dpHot_nominal, final m2_flow_nominal = mCol_flow_nominal, final dp2_nominal = dpCol_nominal, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, T1_start = max(pro.T)*2/3 + min(pro.T)*1/3, T2_start = max(pro.T)*1/10 + min(pro.T)*9/10, redeclare final Buildings.Fluid.MixingVolumes.MixingVolume vol2( V=m2_flow_nominal*tau2/rho2_nominal, nPorts=2, final prescribedHeatFlowRate=true), final vol1( final prescribedHeatFlowRate=true)); replaceable parameter Buildings.Fluid.CHPs.OrganicRankine.Data.Generic pro constrainedby Buildings.Fluid.CHPs.OrganicRankine.Data.Generic "Property records of the working fluid"; parameter Modelica.Units.SI.MassFlowRate mHot_flow_nominal "Nominal mass flow rate of the evaporator fluid"; parameter Modelica.Units.SI.PressureDifference dpHot_nominal( displayUnit="Pa") "Nominal pressure drop of the hot fluid in evaporator"; parameter Modelica.Units.SI.TemperatureDifference dTPinEva_set( final min = 0) = 5 "Set evaporator pinch point temperature difference"; parameter Boolean useEvaporatingPressure = false "Set true to specify working fluid evaporating pressure instead of temperature"; parameter Modelica.Units.SI.ThermodynamicTemperature TWorEva = max(pro.T)*2/3 + min(pro.T)*1/3 "Evaporating temperature of the working fluid"; parameter Modelica.Units.SI.Pressure pWorEva(displayUnit="kPa") = max(pro.p)*2/3 + min(pro.p)*1/3 "Evaporating pressure of the working fluid"; parameter Modelica.Units.SI.MassFlowRate mCol_flow_nominal "Nominal mass flow rate of the condenser fluid"; parameter Modelica.Units.SI.PressureDifference dpCol_nominal( displayUnit="Pa") "Nominal pressure drop of the cold fluid in condenser"; parameter Modelica.Units.SI.TemperatureDifference dTPinCon( final min = 0) = 10 "Condenser pinch point temperature difference"; parameter Boolean useLowCondenserPressureWarning = true "If true, issues warning if pCon < 101325 Pa"; parameter Modelica.Units.SI.MassFlowRate mWor_flow_max( final min = 0) "Upper bound of working fluid flow rate"; parameter Modelica.Units.SI.MassFlowRate mWor_flow_min( final min = 0) "Lower bound of working fluid flow rate"; parameter Modelica.Units.SI.MassFlowRate mWor_flow_hysteresis = mWor_flow_min + (mWor_flow_max - mWor_flow_min) * 0.1 "Hysteresis for turning off the cycle when flow too low"; parameter Modelica.Units.SI.Efficiency etaExp "Expander efficiency"; parameter Modelica.Units.SI.Efficiency etaPum "Pump efficiency"; Modelica.Blocks.Interfaces.BooleanInput ena "Enable cycle; set false to force working fluid flow to zero"; Modelica.Blocks.Interfaces.RealOutput PExp( final quantity="Power", final unit="W") "Expander power generation"; Modelica.Blocks.Interfaces.RealOutput QEva_flow( final quantity="HeatFlowRate", final unit="W") "Evaporator heat flow rate into the cycle"; Modelica.Blocks.Interfaces.RealOutput QCon_flow( final quantity="HeatFlowRate", final unit="W") "Condenser heat flow rate out of the cycle"; Modelica.Blocks.Interfaces.BooleanOutput on_actual "Actual on off status of the cycle"; Modelica.Blocks.Interfaces.RealOutput PPum( final quantity="Power", final unit="W") "Electrical power consumption of the pump"; Buildings.Fluid.CHPs.OrganicRankine.BaseClasses.FixedEvaporating cyc( final pro=pro, final mWor_flow_max=mWor_flow_max, final mWor_flow_min=mWor_flow_min, final mWor_flow_hysteresis=mWor_flow_hysteresis, final TWorEva = if useEvaporatingPressure then Buildings.Utilities.Math.Functions.smoothInterpolation( x = pWorEva, xSup = pro.p, ySup = pro.T) else TWorEva, final dTPinEva_set=dTPinEva_set, final dTPinCon=dTPinCon, final cpHot=Medium1.specificHeatCapacityCp(sta1_nominal), final cpCol=Medium2.specificHeatCapacityCp(sta2_nominal), final etaExp=etaExp, final etaPum=etaPum, final useLowCondenserPressureWarning=useLowCondenserPressureWarning) "Thermodynamic computations of the organic Rankine cycle"; protected Buildings.HeatTransfer.Sources.PrescribedHeatFlow preHeaFloEva "Prescribed heat flow rate"; Buildings.HeatTransfer.Sources.PrescribedHeatFlow preHeaFloCon "Prescribed heat flow rate"; Modelica.Blocks.Sources.RealExpression expTHotIn(y=Medium1.temperature( state=Medium1.setState_phX( p=port_a1.p, h=inStream(port_a1.h_outflow), X=inStream(port_a1.Xi_outflow)))) "Expression for evaporator hot fluid incoming temperature"; Modelica.Blocks.Sources.RealExpression expMHot_flow(y=m1_flow) "Expression for evaporator hot fluid flow rate"; Modelica.Blocks.Sources.RealExpression expTColIn(y=Medium2.temperature( state=Medium2.setState_phX( p=port_a2.p, h=inStream(port_a2.h_outflow), X=inStream(port_a2.Xi_outflow)))) "Expression for condenser cold fluid incoming temperature"; Modelica.Blocks.Sources.RealExpression expMCol_flow(y=m2_flow) "Expression for condenser cold fluid flow rate"; equation connect(preHeaFloEva.port, vol1.heatPort); connect(preHeaFloCon.port, vol2.heatPort); connect(expTHotIn.y, cyc.THotIn); connect(expMHot_flow.y, cyc.mHot_flow); connect(expTColIn.y, cyc.TColIn); connect(expMCol_flow.y, cyc.mCol_flow); connect(cyc.PExp,PExp); connect(ena, cyc.ena); connect(cyc.QEva_flow, QEva_flow); connect(cyc.QCon_flow, QCon_flow); connect(cyc.on_actual, on_actual); connect(cyc.PPum, PPum); connect(cyc.QEva_flow, preHeaFloEva.Q_flow); connect(cyc.QCon_flow, preHeaFloCon.Q_flow); end Cycle;