model BoilerPolynomial
extends Modelica.Icons.Example;
package Medium =
Buildings.Media.Water ;
parameter Modelica.SIunits.Power Q_flow_nominal = 3000 ;
parameter Modelica.SIunits.Temperature dT_nominal = 20 ;
parameter Modelica.SIunits.MassFlowRate m_flow_nominal = Q_flow_nominal/dT_nominal/4200 ;
parameter Modelica.SIunits.PressureDifference dp_nominal = 3000 ;
Buildings.Fluid.Sources.Boundary_pT sin(
redeclare package Medium = Medium,
nPorts=2,
p(displayUnit="Pa") = 300000,
T=333.15) ;
Buildings.Fluid.Sources.Boundary_pT sou(
nPorts=2,
redeclare package Medium = Medium,
p=300000 + dp_nominal,
T=303.15);
Modelica.Blocks.Sources.TimeTable y(table=[0,0; 1800,1; 1800,0; 2400,0; 2400,
1; 3600,1]);
Buildings.Fluid.Boilers.BoilerPolynomial boi1(
a={0.9},
effCur=Buildings.Fluid.Types.EfficiencyCurves.Constant,
Q_flow_nominal=Q_flow_nominal,
m_flow_nominal = m_flow_nominal,
redeclare package Medium = Medium,
dp_nominal=dp_nominal,
fue=
Buildings.Fluid.Data.Fuels.NaturalGasLowerHeatingValue(),
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
from_dp=true,
T_start=293.15) ;
Buildings.HeatTransfer.Sources.FixedTemperature TAmb1( T=288.15) ;
Buildings.Fluid.Boilers.BoilerPolynomial boi2(
a={0.9},
effCur=Buildings.Fluid.Types.EfficiencyCurves.Constant,
Q_flow_nominal=Q_flow_nominal,
m_flow_nominal = m_flow_nominal,
redeclare package Medium = Medium,
energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState,
massDynamics=Modelica.Fluid.Types.Dynamics.SteadyState,
dp_nominal=dp_nominal,
fue=
Buildings.Fluid.Data.Fuels.NaturalGasLowerHeatingValue(),
from_dp=true,
T_start=293.15) ;
Buildings.HeatTransfer.Sources.FixedTemperature TAmb2( T=288.15) ;
equation
connect(TAmb1.port, boi1.heatPort);
connect(TAmb2.port, boi2.heatPort);
connect(sou.ports[1], boi1.port_a);
connect(sou.ports[2], boi2.port_a);
connect(boi2.port_b, sin.ports[2]);
connect(boi1.port_b, sin.ports[1]);
connect(y.y, boi1.y);
connect(y.y, boi2.y);
end BoilerPolynomial;
This model illustrates how to use a boiler model
with closed loop control.
The controller modulates the boiler temperature between
60°C and 80°C.
A three-way valve mixes recirculated water with boiler water
to regulate the temperature of the volume at a constant temperature
of 40°C.
There is also a bypass in the boiler loop to ensure circulation when the
valve position is such that it only recirculates water from the load.
The bypass between valve and pump mixes recirculated water, thereby
allowing the valve to work over a larger operating range.
The expansion vessel near the boiler is used to set a reference pressure,
and it is used to accommodate for the thermal expansion of the water.
model BoilerPolynomialClosedLoop
extends Modelica.Icons.Example;
package Medium =
Buildings.Media.Water ;
parameter Modelica.SIunits.Power Q_flow_nominal = 20000 ;
parameter Modelica.SIunits.Temperature dT_nominal = 20 ;
parameter Modelica.SIunits.MassFlowRate m_flow_nominal = Q_flow_nominal/dT_nominal/4200 ;
Buildings.Fluid.Boilers.BoilerPolynomial boi(
a={0.9},
effCur=Buildings.Fluid.Types.EfficiencyCurves.Constant,
Q_flow_nominal=Q_flow_nominal,
redeclare package Medium = Medium,
dp_nominal=20000,
m_flow_nominal=m_flow_nominal,
fue=
Buildings.Fluid.Data.Fuels.HeatingOilLowerHeatingValue(),
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
T_start=293.15) ;
Modelica.Blocks.Logical.OnOffController onOffController(bandwidth=20);
Modelica.Blocks.Math.BooleanToReal booleanToReal;
Actuators.Valves.ThreeWayEqualPercentageLinear val(
redeclare package Medium = Medium,
l={0.01,0.01},
m_flow_nominal=m_flow_nominal,
dpValve_nominal=6000,
energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState);
Movers.FlowControlled_m_flow pumLoa(
redeclare package Medium = Medium,
m_flow_nominal=2*m_flow_nominal,
energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState) ;
Movers.FlowControlled_m_flow pumBoi(
redeclare package Medium = Medium,
m_flow_nominal=m_flow_nominal,
energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState) ;
Modelica.Blocks.Sources.Constant m_flow_pum(k=m_flow_nominal) ;
Modelica.Blocks.Sources.Constant TSetBoi(k=273.15 + 70) ;
Controls.Continuous.LimPID conPID(
Td=1,
k=0.5,
controllerType=Modelica.Blocks.Types.SimpleController.PI,
Ti=100);
Modelica.Blocks.Sources.Constant TSetHea(k=273.15 + 40) ;
FixedResistances.SplitterFixedResistanceDpM spl(
redeclare package Medium = Medium,
m_flow_nominal=m_flow_nominal*{1,2,1},
dp_nominal={0,0,200},
energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState) ;
FixedResistances.SplitterFixedResistanceDpM spl1(
redeclare package Medium = Medium,
m_flow_nominal=m_flow_nominal*{1,1,1},
dp_nominal={0,0,100},
energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState) ;
FixedResistances.SplitterFixedResistanceDpM spl2(
redeclare package Medium = Medium,
m_flow_nominal=m_flow_nominal*{1,1,1},
dp_nominal=0*{1,1,1},
energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState) ;
FixedResistances.SplitterFixedResistanceDpM spl3(
redeclare package Medium = Medium,
dp_nominal=0*{1,1,1},
m_flow_nominal=m_flow_nominal*{2,1,1},
energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState) ;
Storage.ExpansionVessel exp(
redeclare package Medium = Medium, V_start=1);
FixedResistances.SplitterFixedResistanceDpM spl4(
redeclare package Medium = Medium,
m_flow_nominal=m_flow_nominal*{1,1,1},
dp_nominal=0*{1,1,1},
energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState) ;
MixingVolumes.MixingVolume vol(
nPorts=2,
redeclare package Medium = Medium,
m_flow_nominal=2*m_flow_nominal,
V=1,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial);
Modelica.Thermal.HeatTransfer.Components.ThermalConductor thermalConductor(G=0.1
*Q_flow_nominal/(40 - 20));
Modelica.Thermal.HeatTransfer.Sources.FixedTemperature TBou(T=293.15) ;
Modelica.Blocks.Math.Gain gain(k=2) ;
Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor TVol ;
equation
connect(onOffController.y, booleanToReal.u);
connect(boi.port_b, pumBoi.port_a);
connect(boi.T, onOffController.u);
connect(conPID.y, val.y);
connect(TSetHea.y, conPID.u_s);
connect(TSetBoi.y, onOffController.reference);
connect(val.port_2, spl.port_1);
connect(spl.port_2, pumLoa.port_a);
connect(pumBoi.port_b, spl1.port_1);
connect(spl1.port_2, val.port_1);
connect(spl2.port_2, boi.port_a);
connect(boi.port_a, exp.port_a);
connect(spl3.port_2, spl4.port_1);
connect(spl4.port_2, spl2.port_1);
connect(spl4.port_3, val.port_3);
connect(booleanToReal.y, boi.y);
connect(m_flow_pum.y, pumBoi.m_flow_in);
connect(vol.ports[1], spl3.port_1);
connect(TBou.port, thermalConductor.port_a);
connect(thermalConductor.port_b, vol.heatPort);
connect(gain.y, pumLoa.m_flow_in);
connect(m_flow_pum.y, gain.u);
connect(TVol.port, vol.heatPort);
connect(TVol.T, conPID.u_m);
connect(pumLoa.port_b, vol.ports[2]);
connect(spl.port_3, spl3.port_3);
connect(spl1.port_3, spl2.port_3);
end BoilerPolynomialClosedLoop;