partial model EffectivenessNTUMassFlow
package Medium1 =
Buildings.Media.Water ;
package Medium2 =
Buildings.Media.Air ;
parameter Modelica.SIunits.Temperature T_a1_nominal=5 + 273.15 ;
parameter Modelica.SIunits.Temperature T_b1_nominal=10 + 273.15 ;
parameter Modelica.SIunits.Temperature T_a2_nominal=30 + 273.15 ;
parameter Modelica.SIunits.Temperature T_b2_nominal=15 + 273.15 ;
parameter Modelica.SIunits.HeatFlowRate Q_flow_nominal = m1_flow_nominal*4200*(T_a1_nominal-T_b1_nominal) ;
parameter Modelica.SIunits.MassFlowRate m1_flow_nominal=0.1 ;
parameter Modelica.SIunits.MassFlowRate m2_flow_nominal=m1_flow_nominal*4200/
1000*(T_a1_nominal - T_b1_nominal)/(T_b2_nominal - T_a2_nominal) ;
Sources.MassFlowSource_T sin_2(
redeclare package Medium = Medium2,
T=T_a2_nominal,
use_m_flow_in=true) ;
Sources.Boundary_pT sou_2(
redeclare package Medium = Medium2,
T=T_a2_nominal,
X={0.02,1 - 0.02},
use_T_in=true,
use_X_in=true) ;
Sources.MassFlowSource_T sin_1(
redeclare package Medium = Medium1,
T=T_a1_nominal,
use_m_flow_in=true) ;
Sources.Boundary_pT sou_1(
redeclare package Medium = Medium1,
use_T_in=false,
T=T_a1_nominal) ;
Modelica.Blocks.Sources.Constant relHum(k=0.8) ;
Buildings.Utilities.Psychrometrics.X_pTphi x_pTphi(use_p_in=false);
Modelica.Blocks.Sources.Constant temSou_2(k=T_a2_nominal) ;
Modelica.Blocks.Math.Gain mWat_flow(k=-m1_flow_nominal) ;
Modelica.Blocks.Sources.TimeTable mWatGai(
table=[0,1; 3600*0.1,1; 3600*0.2,0.01; 3600*0.3,0.01]) ;
Modelica.Blocks.Sources.TimeTable mAirGai(
table=[0,1; 3600*0.5,1; 3600*0.6,-1; 3600*0.7,0; 3600*1,0]) ;
Modelica.Blocks.Math.Gain mAir_flow(k=-m2_flow_nominal) ;
equation
connect(x_pTphi.X, sou_2.X_in);
connect(relHum.y, x_pTphi.phi);
connect(temSou_2.y, x_pTphi.T);
connect(temSou_2.y, sou_2.T_in);
connect(mWatGai.y, mWat_flow.u);
connect(mWat_flow.y, sin_1.m_flow_in);
connect(mAirGai.y, mAir_flow.u);
connect(mAir_flow.y, sin_2.m_flow_in);
end EffectivenessNTUMassFlow;
partial model Heater
replaceable package Medium =
Modelica.Media.Interfaces.PartialMedium ;
parameter Modelica.SIunits.Volume V = 6*6*2.7 ;
parameter Modelica.SIunits.MassFlowRate m_flow_nominal = V*1.2*6/3600 ;
parameter Modelica.SIunits.HeatFlowRate Q_flow_nominal = 30*6*6 ;
Buildings.Fluid.MixingVolumes.MixingVolume vol(
redeclare package Medium =
Medium,
V=V,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
m_flow_nominal=m_flow_nominal,
mSenFac=2,
nPorts=3);
Modelica.Thermal.HeatTransfer.Components.ThermalConductor theCon(
G=Q_flow_nominal/20) ;
Buildings.HeatTransfer.Sources.PrescribedTemperature TBou ;
Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor TVol ;
Buildings.Fluid.Movers.FlowControlled_m_flow mov(
redeclare package Medium =
Medium,
m_flow_nominal=m_flow_nominal,
addPowerToMedium=false,
energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState) ;
Modelica.Blocks.Sources.RealExpression TOut(y=273.15 + 16 - 5*
cos(time/86400*
2*Modelica.Constants.pi)) ;
Modelica.Blocks.Sources.Pulse TSet(
amplitude=4,
period=86400,
offset=273.15 + 16,
startTime=7*3600) ;
Controls.Continuous.LimPID conPI(
controllerType=Modelica.Blocks.Types.SimpleController.PI,
k=1,
yMax=1,
yMin=0,
Ti=120) ;
Modelica.Blocks.Sources.Constant mFan_flow(k=m_flow_nominal) ;
Sources.FixedBoundary bou(
redeclare package Medium =
Medium, nPorts=1) ;
Sensors.TemperatureTwoPort THeaOut(
redeclare package Medium =
Medium,
m_flow_nominal=m_flow_nominal) ;
FixedResistances.FixedResistanceDpM res(
redeclare package Medium =
Medium,
m_flow_nominal=m_flow_nominal,
dp_nominal=100,
linearized=true) ;
equation
connect(theCon.port_a, TBou.port);
connect(vol.heatPort, theCon.port_b);
connect(vol.heatPort, TVol.port);
connect(TOut.y, TBou.T);
connect(TVol.T, conPI.u_m);
connect(TSet.y, conPI.u_s);
connect(mFan_flow.y,mov. m_flow_in);
connect(THeaOut.port_b, vol.ports[1]);
connect(vol.ports[2],mov. port_a);
connect(res.port_b, bou.ports[1]);
connect(res.port_a, vol.ports[3]);
end Heater;
This is the base model that is used to test the initialization of the coil model.
There are three instances of the coil model, each having different settings
for the initial conditions.
partial model WetCoilDiscretized
package Medium1 =
Buildings.Media.Water ;
replaceable package Medium2 =
Modelica.Media.Interfaces.PartialMedium ;
parameter Modelica.SIunits.Temperature T_a1_nominal = 5+273.15 ;
parameter Modelica.SIunits.Temperature T_b1_nominal = 10+273.15 ;
parameter Modelica.SIunits.Temperature T_a2_nominal = 30+273.15 ;
parameter Modelica.SIunits.Temperature T_b2_nominal = 10+273.15 ;
parameter Modelica.SIunits.MassFlowRate m1_flow_nominal = 5 ;
parameter Modelica.SIunits.MassFlowRate m2_flow_nominal=
m1_flow_nominal*4200/1000*(T_a1_nominal-T_b1_nominal)/(T_b2_nominal-T_a2_nominal) ;
Buildings.Fluid.HeatExchangers.WetCoilDiscretized hexFixIni(
redeclare package Medium1 = Medium1,
redeclare package Medium2 =
Medium2,
m1_flow_nominal=m1_flow_nominal,
m2_flow_nominal=m2_flow_nominal,
dp2_nominal(displayUnit="Pa") = 200,
nPipPar=1,
nPipSeg=3,
nReg=2,
dp1_nominal(displayUnit="Pa") = 5000,
UA_nominal=m1_flow_nominal*4200*(T_a1_nominal - T_b1_nominal)/
Buildings.Fluid.HeatExchangers.BaseClasses.lmtd(
T_a1_nominal,
T_b1_nominal,
T_a2_nominal,
T_b2_nominal),
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
show_T=true) ;
Sources.MassFlowSource_T sin_2(
redeclare package Medium =
Medium2,
nPorts=1,
use_m_flow_in=true,
T=303.15);
Buildings.Fluid.Sources.Boundary_pT sou_2(
redeclare package Medium =
Medium2,
nPorts=1,
T=293.15);
Modelica.Blocks.Sources.Ramp TWat(
duration=60,
height=15,
offset=273.15 + 5,
startTime=0) ;
Sources.MassFlowSource_T sin_1(
redeclare package Medium = Medium1,
nPorts=1,
use_m_flow_in=true,
T=293.15);
Buildings.Fluid.Sources.Boundary_pT sou_1(
redeclare package Medium = Medium1,
p=300000 + 5000,
use_T_in=true,
T=293.15,
nPorts=1);
Buildings.Fluid.HeatExchangers.WetCoilDiscretized hexSteStaIni(
redeclare package Medium1 = Medium1,
redeclare package Medium2 =
Medium2,
m1_flow_nominal=m1_flow_nominal,
m2_flow_nominal=m2_flow_nominal,
dp2_nominal(displayUnit="Pa") = 200,
nPipPar=1,
nPipSeg=3,
nReg=2,
dp1_nominal(displayUnit="Pa") = 5000,
UA_nominal=m1_flow_nominal*4200*(T_a1_nominal - T_b1_nominal)/
Buildings.Fluid.HeatExchangers.BaseClasses.lmtd(
T_a1_nominal,
T_b1_nominal,
T_a2_nominal,
T_b2_nominal),
energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyStateInitial,
show_T=true) ;
Sources.MassFlowSource_T sin_3(
redeclare package Medium =
Medium2,
nPorts=1,
use_m_flow_in=true,
T=303.15);
Buildings.Fluid.Sources.Boundary_pT sou_3(
redeclare package Medium =
Medium2,
nPorts=1,
T=293.15);
Sources.MassFlowSource_T sin_4(
redeclare package Medium = Medium1,
nPorts=1,
use_m_flow_in=true,
T=293.15);
Buildings.Fluid.Sources.Boundary_pT sou_4(
redeclare package Medium = Medium1,
p=300000 + 5000,
use_T_in=true,
T=293.15,
nPorts=1);
Buildings.Fluid.HeatExchangers.WetCoilDiscretized hexSteSta(
redeclare package Medium1 = Medium1,
redeclare package Medium2 =
Medium2,
m1_flow_nominal=m1_flow_nominal,
m2_flow_nominal=m2_flow_nominal,
dp2_nominal(displayUnit="Pa") = 200,
nPipPar=1,
nPipSeg=3,
nReg=2,
dp1_nominal(displayUnit="Pa") = 5000,
UA_nominal=m1_flow_nominal*4200*(T_a1_nominal - T_b1_nominal)/
Buildings.Fluid.HeatExchangers.BaseClasses.lmtd(
T_a1_nominal,
T_b1_nominal,
T_a2_nominal,
T_b2_nominal),
energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState,
show_T=true) ;
Sources.MassFlowSource_T sin_5(
redeclare package Medium =
Medium2,
nPorts=1,
use_m_flow_in=true,
T=303.15);
Buildings.Fluid.Sources.Boundary_pT sou_5(
redeclare package Medium =
Medium2,
nPorts=1,
T=293.15);
Sources.MassFlowSource_T sin_6(
redeclare package Medium = Medium1,
nPorts=1,
use_m_flow_in=true,
T=293.15);
Buildings.Fluid.Sources.Boundary_pT sou_6(
redeclare package Medium = Medium1,
p=300000 + 5000,
use_T_in=true,
T=293.15,
nPorts=1);
Modelica.Blocks.Sources.Ramp m2_flow(
duration=60,
startTime=60,
height=1.1*m2_flow_nominal,
offset=-m2_flow_nominal) ;
Modelica.Blocks.Sources.Ramp m1_flow(
duration=60,
startTime=180,
height=1.1*m1_flow_nominal,
offset=-m1_flow_nominal) ;
Modelica.Blocks.Sources.Ramp m1_flow1(
duration=60,
startTime=180,
height=1.1*m1_flow_nominal,
offset=-m1_flow_nominal) ;
Modelica.Blocks.Sources.Ramp m1_flow2(
duration=60,
startTime=180,
height=1.1*m1_flow_nominal,
offset=-m1_flow_nominal) ;
equation
connect(TWat.y, sou_1.T_in);
connect(sou_1.ports[1], hexFixIni.port_a1);
connect(sou_2.ports[1], hexFixIni.port_a2);
connect(hexFixIni.port_b1, sin_1.ports[1]);
connect(hexFixIni.port_b2, sin_2.ports[1]);
connect(TWat.y,sou_4. T_in);
connect(sou_4.ports[1], hexSteStaIni.port_a1);
connect(sou_3.ports[1], hexSteStaIni.port_a2);
connect(hexSteStaIni.port_b1, sin_4.ports[1]);
connect(TWat.y,sou_6. T_in);
connect(sou_6.ports[1], hexSteSta.port_a1);
connect(sou_5.ports[1], hexSteSta.port_a2);
connect(hexSteSta.port_b1, sin_6.ports[1]);
connect(hexSteSta.port_b2, sin_5.ports[1]);
connect(hexSteStaIni.port_b2, sin_3.ports[1]);
connect(m2_flow.y, sin_2.m_flow_in);
connect(m2_flow.y, sin_3.m_flow_in);
connect(m2_flow.y, sin_5.m_flow_in);
connect(m1_flow.y, sin_1.m_flow_in);
connect(m1_flow1.y, sin_4.m_flow_in);
connect(m1_flow2.y, sin_6.m_flow_in);
end WetCoilDiscretized;