Skip to content

Commit

Permalink
Merged issue290_tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
mwetter committed Oct 10, 2014
2 parents 82e4105 + 309f45d commit 6047f7b
Show file tree
Hide file tree
Showing 29 changed files with 660 additions and 333 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function AverageResistance
input Modelica.SIunits.ThermalConductivity k
"pipe level construction element thermal conductivity";
input
Buildings.Fluid.HeatExchangers.RadiantSlabs.BaseClasses.Types.SystemType
Buildings.Fluid.HeatExchangers.RadiantSlabs.Types.SystemType
sysTyp "Type of radiant system";
input Modelica.SIunits.ThermalConductivity kIns
"floor slab insulation thermal conductivity";
Expand All @@ -22,7 +22,7 @@ protected
Real fac "Factor used for systems in wall or ceiling, or for capillary tubes";
algorithm

if sysTyp == Buildings.Fluid.HeatExchangers.RadiantSlabs.BaseClasses.Types.SystemType.Floor then
if sysTyp == Buildings.Fluid.HeatExchangers.RadiantSlabs.Types.SystemType.Floor then
alpha := kIns/dIns;
if alpha >= 1.212 then
Modelica.Utilities.Streams.print("Warning: In RadiantAverageResistance, require alpha = kIns/dIns >= 1.212 W/(m2.K).\n" +
Expand All @@ -37,14 +37,14 @@ algorithm
Rx := disPip*(Modelica.Math.log(disPip/Modelica.Constants.pi/dPipOut) + infSum)
/(2*Modelica.Constants.pi*k);
fac := 0; // not needed.
elseif sysTyp == Buildings.Fluid.HeatExchangers.RadiantSlabs.BaseClasses.Types.SystemType.Ceiling_Wall_or_Capillary then
elseif sysTyp == Buildings.Fluid.HeatExchangers.RadiantSlabs.Types.SystemType.Ceiling_Wall_or_Capillary then
// Branch for radiant ceilings, radiant walls, and systems with capillary heat exchangers
cri := disPip/dPipOut;
fac := if (cri >= 5.8) then Modelica.Math.log(cri/Modelica.Constants.pi) else (cri/Modelica.Constants.pi/3);
Rx := disPip/2/Modelica.Constants.pi/k * fac;
else
assert(sysTyp == Buildings.Fluid.HeatExchangers.RadiantSlabs.BaseClasses.Types.SystemType.Floor or
sysTyp == Buildings.Fluid.HeatExchangers.RadiantSlabs.BaseClasses.Types.SystemType.Ceiling_Wall_or_Capillary,
assert(sysTyp == Buildings.Fluid.HeatExchangers.RadiantSlabs.Types.SystemType.Floor or
sysTyp == Buildings.Fluid.HeatExchangers.RadiantSlabs.Types.SystemType.Ceiling_Wall_or_Capillary,
"Invalid value for sysTyp in \"Buildings.Fluid.HeatExchangers.RadiantSlabs.BaseClasses.Functions.AverageResistance\"
Check parameters of the radiant slab model.");
cri := 0;
Expand All @@ -62,16 +62,16 @@ Different equations are used for
<ul>
<li>
floor heating systems (if
<code>sysTyp == Buildings.Fluid.HeatExchangers.RadiantSlabs.BaseClasses.Types.SystemType.Floor</code>),
<code>sysTyp == Buildings.Fluid.HeatExchangers.RadiantSlabs.Types.SystemType.Floor</code>),
</li>
<li>
radiant heating or cooling systems in ceilings and walls (if
<code>sysTyp == Buildings.Fluid.HeatExchangers.RadiantSlabs.BaseClasses.Types.SystemType.Ceiling_Wall_or_Capillary</code>
<code>sysTyp == Buildings.Fluid.HeatExchangers.RadiantSlabs.Types.SystemType.Ceiling_Wall_or_Capillary</code>
and <code>disPip/dPipOut &ge; 5.8</code>), and
</li>
<li>
capillary tube systems (if
<code>sysTyp == Buildings.Fluid.HeatExchangers.RadiantSlabs.BaseClasses.Types.SystemType.Ceiling_Wall_or_Capillary</code>
<code>sysTyp == Buildings.Fluid.HeatExchangers.RadiantSlabs.Types.SystemType.Ceiling_Wall_or_Capillary</code>
and <code>disPip/dPipOut &lt; 5.8</code>).
</li>
</ul>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,21 @@
within Buildings.Fluid.HeatExchangers.RadiantSlabs.BaseClasses;
model InternalFlowConvection "Convective heat transfer in pipes"
model PipeToSlabConductance
"Convective heat transfer in pipes and fictitious resistance to average slab temperature"
replaceable package Medium =
Modelica.Media.Interfaces.PartialMedium "Medium in the component"
annotation (choicesAllMatching = true);
Modelica.SIunits.HeatFlowRate Q_flow "Heat flow rate from solid -> fluid";
Modelica.SIunits.TemperatureDifference dT "= solid.T - fluid.T";
Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a solid
"Heat port at solid interface"
annotation (
Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=0),
iconTransformation(extent={{-114,-10},{-94,10}})));
Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_b fluid
"Heat port at fluid interface"
annotation (
Placement(transformation(extent={{90,-10},{110,10}}, rotation=0),
iconTransformation(extent={{86,-10},{106,10}})));
parameter Modelica.SIunits.Area A "Pipe inside surface area";

parameter Buildings.Fluid.HeatExchangers.RadiantSlabs.Types.HeatTransfer
heatTransfer=
Buildings.Fluid.HeatExchangers.RadiantSlabs.Types.HeatTransfer.EpsilonNTU
"Model for heat transfer between fluid and slab";
parameter Modelica.SIunits.Area APip "Pipe inside surface area";

parameter
Modelica.Fluid.Dissipation.HeatTransfer.StraightPipe.kc_overall_IN_con
kc_IN_con "Parameters for convective heat transfer calculation"
annotation (Placement(transformation(extent={{-90,84},{-78,96}})));

Modelica.Fluid.Dissipation.HeatTransfer.StraightPipe.kc_overall_IN_var
kc_IN_var(
cp=Medium.specificHeatCapacityCp(fluSta),
Expand All @@ -28,38 +24,89 @@ model InternalFlowConvection "Convective heat transfer in pipes"
rho=Medium.density(fluSta),
m_flow=m_flow) "Variables for convective heat transfer calculation"
annotation (Placement(transformation(extent={{-90,68},{-78,80}})));

parameter Modelica.SIunits.ThermalResistance RFic
"Average fictitious thermal resistance between pipe surface and plane that contains pipe";
parameter Modelica.SIunits.ThermalResistance RWal
"Thermal resistance through the pipe wall";

parameter Modelica.SIunits.MassFlowRate m_flow_nominal
"Nominal mass flow rate";

Modelica.Blocks.Interfaces.RealInput m_flow(unit="kg/s")
"Fluid mass flow rate"
annotation (Placement(transformation(extent={{-118,46},{-100,64}})));
"Fluid mass flow rate from port_a to port_b"
annotation (Placement(transformation(extent={{-118,32},{-100,50}}),
iconTransformation(extent={{-120,30},{-100,50}})));
Modelica.Blocks.Interfaces.RealInput T_a(unit="K")
"Temperature at fluid port_a"
annotation (Placement(transformation(extent={{-118,92},{-100,110}}),
iconTransformation(extent={{-120,90},{-100,110}})));
Modelica.Blocks.Interfaces.RealInput T_b(unit="K")
"Temperature at fluid port_b"
annotation (Placement(transformation(extent={{-118,62},{-100,80}}),
iconTransformation(extent={{-120,60},{-100,80}})));

Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a solid
"Heat port at solid interface"
annotation (
Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=0),
iconTransformation(extent={{-114,-10},{-94,10}})));
Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_b fluid
"Heat port at fluid interface"
annotation (
Placement(transformation(extent={{90,-10},{110,10}}, rotation=0),
iconTransformation(extent={{86,-10},{106,10}})));

Modelica.SIunits.TemperatureDifference dT "= solid.T - fluid.T";

Modelica.SIunits.CoefficientOfHeatTransfer hCon
"Convective heat transfer coefficient";
Modelica.SIunits.ThermalResistance RTot
"Thermal resistance between the fluid and the fictious plane of heat transfer";

Modelica.SIunits.HeatFlowRate Q_flow "Heat flow rate from solid -> fluid";

protected
Medium.ThermodynamicState fluSta = Medium.setState_pTX(p=Medium.p_default, T=fluid.T, X=Medium.X_default)
"State of the medium";
Modelica.SIunits.SpecificHeatCapacity c_p = Medium.specificHeatCapacityCp(fluSta)
"Specific heat capacity of the fluid";
equation
hCon = Modelica.Fluid.Dissipation.HeatTransfer.StraightPipe.kc_overall_KC(
IN_con=kc_IN_con, IN_var=kc_IN_var);
RTot = 1/hCon/APip + RFic + RWal;

if heatTransfer == Buildings.Fluid.HeatExchangers.RadiantSlabs.Types.HeatTransfer.EpsilonNTU then
Q_flow = Functions.heatFlowRate(T_a=T_a,
T_b=T_b,
T_s=solid.T,
T_f=fluid.T,
c_p=c_p,
UA=1/RTot,
m_flow=m_flow,
m_flow_nominal=m_flow_nominal);
else
Q_flow = dT/RTot;
end if;

dT = solid.T - fluid.T;
solid.Q_flow = Q_flow;
fluid.Q_flow = -Q_flow;
Q_flow = hCon*A*dT;

annotation (Icon(graphics={
Rectangle(
extent={{-66,80},{94,-80}},
lineColor={255,255,255},
fillColor={255,255,255},
fillPattern=FillPattern.Solid),
Rectangle(
extent={{-94,80},{-64,-80}},
extent={{-88,80},{2,-82}},
lineColor={0,0,0},
fillColor={192,192,192},
fillPattern=FillPattern.Backward),
Line(points={{96,0},{96,0}}, color={0,127,255}),
Line(points={{-64,20},{72,20}}, color={191,0,0}),
Line(points={{-64,-20},{72,-20}}, color={191,0,0}),
Line(points={{-38,80},{-38,-80}}, color={0,127,255}),
Line(points={{2,80},{2,-80}}, color={0,127,255}),
Line(points={{36,80},{36,-80}}, color={0,127,255}),
Line(points={{72,80},{72,-80}}, color={0,127,255}),
Line(points={{52,-30},{72,-20}}, color={191,0,0}),
Expand All @@ -69,7 +116,7 @@ equation
Text(
extent={{-145,140},{155,100}},
lineColor={0,0,255},
textString="%name")}),
textString="%name")}),
Documentation(info="<html>
<p>
Model to compute the convective heat transfer inside a straight pipe.
Expand All @@ -92,4 +139,4 @@ First implementation.
</li>
</ul>
</html>"));
end InternalFlowConvection;
end PipeToSlabConductance;
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
within Buildings.Fluid.HeatExchangers.RadiantSlabs.BaseClasses;
partial model Slab "Base class for radiant slab"
parameter
Buildings.Fluid.HeatExchangers.RadiantSlabs.BaseClasses.Types.SystemType
Buildings.Fluid.HeatExchangers.RadiantSlabs.Types.SystemType
sysTyp "Radiant system type";

parameter Modelica.SIunits.Distance disPip "Pipe distance";
Expand Down
36 changes: 0 additions & 36 deletions Buildings/Fluid/HeatExchangers/RadiantSlabs/BaseClasses/Types.mo

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
InternalFlowConvection
HeatFlowRateMultiplier
MassFlowRateMultiplier
PipeToSlabConductance
Slab
Functions
Types

Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
within Buildings.Fluid.HeatExchangers.RadiantSlabs.Examples;
model SingleCircuitMultipleCircuit "Model that tests the radiant slab"
model SingleCircuitMultipleCircuitEpsilonNTU
"Model that tests the radiant slab with multiple parallel circuits and epsilon-NTU configuration"
extends Modelica.Icons.Example;
package Medium = Buildings.Media.ConstantPropertyLiquidWater;
inner Modelica.Fluid.System system
Expand All @@ -20,10 +21,9 @@ model SingleCircuitMultipleCircuit "Model that tests the radiant slab"
layers=layers,
iLayPip=1,
pipe=pipe,
sysTyp=Buildings.Fluid.HeatExchangers.RadiantSlabs.BaseClasses.Types.SystemType.Floor,
sysTyp=Buildings.Fluid.HeatExchangers.RadiantSlabs.Types.SystemType.Floor,
disPip=0.2,
A=A,
nSeg=nSeg,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial)
"Slabe with embedded pipes"
annotation (Placement(transformation(extent={{-14,10},{6,30}})));
Expand Down Expand Up @@ -71,10 +71,9 @@ model SingleCircuitMultipleCircuit "Model that tests the radiant slab"
layers=layers,
iLayPip=1,
pipe=pipe,
sysTyp=Buildings.Fluid.HeatExchangers.RadiantSlabs.BaseClasses.Types.SystemType.Floor,
sysTyp=Buildings.Fluid.HeatExchangers.RadiantSlabs.Types.SystemType.Floor,
disPip=0.2,
A=A,
nSeg=nSeg,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial)
"Slabe with embedded pipes"
annotation (Placement(transformation(extent={{10,-30},{30,-10}})));
Expand All @@ -90,9 +89,8 @@ model SingleCircuitMultipleCircuit "Model that tests the radiant slab"
layers=layers,
iLayPip=1,
pipe=pipe,
sysTyp=Buildings.Fluid.HeatExchangers.RadiantSlabs.BaseClasses.Types.SystemType.Floor,
sysTyp=Buildings.Fluid.HeatExchangers.RadiantSlabs.Types.SystemType.Floor,
disPip=0.2,
nSeg=nSeg,
nCir=nCir,
A=nCir*A,
m_flow_nominal=nCir*m_flow_nominal,
Expand All @@ -112,7 +110,6 @@ model SingleCircuitMultipleCircuit "Model that tests the radiant slab"
Sensors.TemperatureTwoPort senTem3(redeclare package Medium = Medium,
m_flow_nominal=nCir*m_flow_nominal) "Temperature sensor"
annotation (Placement(transformation(extent={{70,-70},{90,-50}})));
parameter Integer nSeg=3 "Number of volume segments";
Sources.Boundary_pT sou(
redeclare package Medium = Medium,
nPorts=3,
Expand Down Expand Up @@ -216,34 +213,30 @@ equation
points={{-50,-22.6667},{-40,-22.6667},{-40,-60},{30,-60}},
color={0,127,255},
smooth=Smooth.None));
annotation(__Dymola_Commands(file="modelica://Buildings/Resources/Scripts/Dymola/Fluid/HeatExchangers/RadiantSlabs/Examples/SingleCircuitMultipleCircuit.mos"

annotation(__Dymola_Commands(file="modelica://Buildings/Resources/Scripts/Dymola/Fluid/HeatExchangers/RadiantSlabs/Examples/SingleCircuitMultipleCircuitEpsilonNTU.mos"
"Simulate and plot"),
Diagram(coordinateSystem(preserveAspectRatio=true, extent={{-140,-160},
Diagram(coordinateSystem(preserveAspectRatio=true, extent={{-140,-160},
{160,160}})),
Documentation(info="<html>
<p>
This example compares the results of two models of a single circuit that are arranged in
parallel, versus a model that directly implements two parallel circuits.
Both configurations have the same mass flow rate and temperatures.
For simplicity, a combined convective and radiative resistance
which is independent of the temperature difference has been used.
The model is exposed to a step change in pressure, which causes forward and reverse
flow.
This model is identical to
<a href=\"modelica://Buildings.Fluid.HeatExchangers.RadiantSlabs.Examples.SingleCircuitMultipleCircuit\">
Buildings.Fluid.HeatExchangers.RadiantSlabs.Examples.SingleCircuitMultipleCircuit</a>
except that the number of segments in the slab is set to <i>1</i>
and the heat transfer between the fluid and the slab is computed using
an epsilon-NTU model.
</p>
</html>",
revisions="<html>
<ul>
<li>
October 11, 2013, by Michael Wetter:<br/>
Added missing <code>parameter</code> keyword in the declaration of the data record.
</li>
<li>
June 27, 2012, by Michael Wetter:<br/>
October 7, 2014, by Michael Wetter:<br/>
First implementation.
</li>
</ul>
</html>"),
experiment(
StopTime=86400,
Tolerance=1e-05));
end SingleCircuitMultipleCircuit;
end SingleCircuitMultipleCircuitEpsilonNTU;
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
within Buildings.Fluid.HeatExchangers.RadiantSlabs.Examples;
model SingleCircuitMultipleCircuitFiniteDifference
"Model that tests the radiant slab with multiple parallel circuits"
extends
Buildings.Fluid.HeatExchangers.RadiantSlabs.Examples.SingleCircuitMultipleCircuitEpsilonNTU(
sla1(heatTransfer=Buildings.Fluid.HeatExchangers.RadiantSlabs.Types.HeatTransfer.FiniteDifference),
sla2(heatTransfer=Buildings.Fluid.HeatExchangers.RadiantSlabs.Types.HeatTransfer.FiniteDifference),
sla3(heatTransfer=Buildings.Fluid.HeatExchangers.RadiantSlabs.Types.HeatTransfer.FiniteDifference));

annotation(__Dymola_Commands(file="modelica://Buildings/Resources/Scripts/Dymola/Fluid/HeatExchangers/RadiantSlabs/Examples/SingleCircuitMultipleCircuitFiniteDifference.mos"
"Simulate and plot"),
Diagram(coordinateSystem(preserveAspectRatio=true, extent={{-140,-160},
{160,160}})),
Documentation(info="<html>
<p>
This example compares the results of two models of a single circuit that are arranged in
parallel, versus a model that directly implements two parallel circuits.
Both configurations have the same mass flow rate and temperatures.
For simplicity, a combined convective and radiative resistance
which is independent of the temperature difference has been used.
The model is exposed to a step change in pressure, which causes forward and reverse
flow.
</p>
</html>",
revisions="<html>
<ul>
<li>
October 11, 2013, by Michael Wetter:<br/>
Added missing <code>parameter</code> keyword in the declaration of the data record.
</li>
<li>
June 27, 2012, by Michael Wetter:<br/>
First implementation.
</li>
</ul>
</html>"),
experiment(
StopTime=86400,
Tolerance=1e-05));
end SingleCircuitMultipleCircuitFiniteDifference;

0 comments on commit 6047f7b

Please sign in to comment.