Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ported SolarCollectors from Buildings library #1884

Merged
merged 3 commits into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
209 changes: 209 additions & 0 deletions IBPSA/Fluid/SolarCollectors/ASHRAE93.mo
Original file line number Diff line number Diff line change
@@ -0,0 +1,209 @@
within IBPSA.Fluid.SolarCollectors;
model ASHRAE93 "Model of a solar thermal collector according to the ASHRAE Standard 93"
extends IBPSA.Fluid.SolarCollectors.BaseClasses.PartialSolarCollector(
redeclare IBPSA.Fluid.SolarCollectors.Data.GenericASHRAE93 per);

BaseClasses.ASHRAESolarGain solGai(
redeclare package Medium = Medium,
final nSeg=nSeg,
final til=til,
final incAngDat=per.incAngDat,
final incAngModDat=per.incAngModDat,
final y_intercept=per.y_intercept,
final use_shaCoe_in=use_shaCoe_in,
final shaCoe=shaCoe,
final A_c=ATot_internal)
"Identifies heat gained from the sun using the ASHRAE Standard 93 calculations"
annotation (Placement(transformation(extent={{-20,40},{0,60}})));

BaseClasses.ASHRAEHeatLoss heaLos(
redeclare package Medium = Medium,
final nSeg=nSeg,
final slope=per.slope,
final A_c=ATot_internal)
"Calculates the heat lost to the surroundings using the ASHRAE Standard 93 calculations"
annotation (Placement(transformation(extent={{-20,10},{0,30}})));

equation
// Make sure the model is only used with the ASHRAE ratings data, and slope < 0
assert(per.slope < 0,
"In " + getInstanceName() + ": The heat loss coefficient from the ASHRAE ratings data must be strictly negative. Obtained slope = " + String(per.slope));

connect(weaBus.TDryBul, heaLos.TEnv) annotation (Line(
points={{-99.95,80.05},{-90,80.05},{-90,26},{-22,26}},
color={255,204,51},
thickness=0.5,
smooth=Smooth.None), Text(
textString="%first",
index=-1,
extent={{-6,3},{-6,3}}));
connect(HDirTil.inc, solGai.incAng) annotation (Line(
points={{-59,46},{-50,46},{-50,48},{-22,48}},
color={0,0,127},
smooth=Smooth.None));
connect(HDirTil.H, solGai.HDirTil) annotation (Line(
points={{-59,50},{-50,50},{-50,52},{-22,52}},
color={0,0,127},
smooth=Smooth.None));
connect(HDifTilIso.HGroDifTil, solGai.HGroDifTil) annotation (Line(
points={{-59,74},{-40,74},{-40,55},{-22,55}},
color={0,0,127},
smooth=Smooth.None));
connect(HDifTilIso.HSkyDifTil, solGai.HSkyDifTil) annotation (Line(
points={{-59,86},{-30,86},{-30,58},{-22,58}},
color={0,0,127},
smooth=Smooth.None));
connect(shaCoe_in, solGai.shaCoe_in) annotation (Line(
points={{-120,40},{-40,40},{-40,45},{-22,45}},
color={0,0,127},
smooth=Smooth.None));
connect(solGai.QSol_flow, QGai.Q_flow) annotation (Line(
points={{1,50},{50,50}},
color={0,0,127},
smooth=Smooth.None));
connect(temSen.T, heaLos.TFlu) annotation (Line(
points={{-11,-20},{-30,-20},{-30,14},{-22,14}},
color={0,0,127},
smooth=Smooth.None));
connect(temSen.T, solGai.TFlu) annotation (Line(
points={{-11,-20},{-30,-20},{-30,42},{-22,42}},
color={0,0,127},
smooth=Smooth.None));
connect(heaLos.QLos_flow, QLos.Q_flow) annotation (Line(
points={{1,20},{50,20}},
color={0,0,127},
smooth=Smooth.None));
annotation (
Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,
100}}),
graphics={
Rectangle(
extent={{-84,100},{84,-100}},
lineColor={27,0,55},
fillColor={26,0,55},
fillPattern=FillPattern.Solid),
Line(
points={{-100,0},{-76,0},{-76,-90},{66,-90},{66,-60},{-64,-60},{-64,
-30},{66,-30},{66,0},{-64,0},{-64,28},{66,28},{66,60},{-64,60},{
-64,86},{78,86},{78,0},{98,0},{100,0}},
color={0,128,255},
thickness=1,
smooth=Smooth.None),
Ellipse(
extent={{-24,26},{28,-26}},
lineColor={255,255,0},
fillColor={255,255,0},
fillPattern=FillPattern.Solid),
Line(
points={{-6,-6},{8,8}},
color={255,255,0},
smooth=Smooth.None,
thickness=1,
origin={-24,30},
rotation=90),
Line(
points={{-50,0},{-30,0}},
color={255,255,0},
smooth=Smooth.None,
thickness=1),
Line(
points={{-36,-40},{-20,-24}},
color={255,255,0},
smooth=Smooth.None,
thickness=1),
Line(
points={{-10,0},{10,0}},
color={255,255,0},
smooth=Smooth.None,
thickness=1,
origin={2,-40},
rotation=90),
Line(
points={{-8,-8},{6,6}},
color={255,255,0},
smooth=Smooth.None,
thickness=1,
origin={30,-30},
rotation=90),
Line(
points={{32,0},{52,0}},
color={255,255,0},
smooth=Smooth.None,
thickness=1),
Line(
points={{-8,-8},{6,6}},
color={255,255,0},
smooth=Smooth.None,
thickness=1,
origin={28,32},
rotation=180),
Line(
points={{-10,0},{10,0}},
color={255,255,0},
smooth=Smooth.None,
thickness=1,
origin={0,40},
rotation=90)}),
defaultComponentName="solCol",
Documentation(info="<html>
<p>
This component models a solar thermal collector according to the ASHRAE93
test standard.
</p>

<h4>References</h4>
<p>
ASHRAE 93-2010 -- Methods of Testing to Determine the Thermal Performance of
Solar Collectors (ANSI approved).
</p>
<p>
<a href=\"https://energyplus.net/assets/nrel_custom/pdfs/pdfs_v23.2.0/EngineeringReference.pdf\">
EnergyPlus 23.2.0 Engineering Reference</a>.
</p>
</html>", revisions="<html>
<ul>
<li>
February 28, 2024, by Jelger Jansen:<br/>
Refactor model.<br/>
This is for
<a href=\"https://github.com/lbl-srg/modelica-buildings/issues/3604\">Buildings, #3604</a>.
</li>
<li>
December 11, 2023, by Michael Wetter:<br/>
Corrected implementation of pressure drop calculation for the situation where the collectors are in parallel,
e.g., if <code>sysConfig == IBPSA.Fluid.SolarCollectors.Types.SystemConfiguration.Parallel</code>.<br/>
Changed assignment of <code>computeFlowResistance</code> to <code>final</code> based on
<code>dp_nominal</code>.<br/>
This is for
<a href=\"https://github.com/lbl-srg/modelica-buildings/issues/3597\">Buildings, #3597</a>.
</li>
<li>
September 16, 2021, by Michael Wetter:<br/>
Changed <code>lat</code> from being a parameter to an input from weather bus.<br/>
This is for
<a href=\"https://github.com/ibpsa/modelica-ibpsa/issues/1477\">IBPSA, #1477</a>.
</li>
<li>
December 17, 2017, by Michael Wetter:<br/>
Revised computation of heat loss.<br/>
This is for
<a href=\"https://github.com/lbl-srg/modelica-buildings/issues/1100\">
issue 1100</a>.
</li>
<li>
November 21, 2017, by Michael Wetter:<br/>
Corrected error in heat loss calculations that did not scale correctly with <code>nPanels</code>.<br/>
This is for
<a href=\"https://github.com/lbl-srg/modelica-buildings/issues/1073\">issue 1073</a>.
</li>
<li>
October 18, 2013, by Michael Wetter:<br/>
Removed duplicate connection.
</li>
<li>
January 4, 2013, by Peter Grant:<br/>
First implementation.
</li>
</ul>
</html>"));
end ASHRAE93;
87 changes: 87 additions & 0 deletions IBPSA/Fluid/SolarCollectors/BaseClasses/ASHRAEHeatLoss.mo
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
within IBPSA.Fluid.SolarCollectors.BaseClasses;
block ASHRAEHeatLoss
"Calculate the heat loss of a solar collector per ASHRAE standard 93"
extends IBPSA.Fluid.SolarCollectors.BaseClasses.PartialHeatLoss(
QLos_internal = -slope * A_c/nSeg * {dT[i] for i in 1:nSeg});

parameter Modelica.Units.SI.CoefficientOfHeatTransfer slope(final max=0)
"Slope from ratings data";

annotation (
defaultComponentName="heaLos",
Documentation(info="<html>
<p>
This component computes the heat loss from the solar thermal collector to the
environment.
It is designed for use with ratings data collected in accordance with
ASHRAE Standard 93.
A negative heat loss indicates that heat is being lost to the environment.
</p>

<h4> Model description </h4>
<p>
This model calculates the heat loss to the ambient, for each segment
<i>i &isin; {1, ..., n<sub>seg</sub>}</i> where <i>n<sub>seg</sub></i> is
the number of segments, as
</p>
<p align=\"center\" style=\"font-style:italic;\">
Q<sub>los,i</sub> = -slope A<sub>c</sub> &frasl; n<sub>seg</sub>
(T<sub>env</sub>-T<sub>flu,i</sub>)
</p>
<p>
where
<i>slope &lt; 0</i> is the slope for the heat loss as specified in the ratings
data, <i>A<sub>c</sub></i> is the collector area, <i>T<sub>env</sub></i> is
the environment temperature, and <i>T<sub>flu,i</sub></i> is the
fluid temperature in segment <i>i &isin; {1, ..., n<sub>seg</sub>}</i>.
</p>
<p>
This model reduces the heat loss rate to <i>0</i> when the fluid temperature
is within <i>1</i> Kelvin of the minimum temperature of the medium model.
The calculation is performed using the
<a href=\"modelica://IBPSA.Utilities.Math.Functions.smoothHeaviside\">
IBPSA.Utilities.Math.Functions.smoothHeaviside</a> function.
</p>

<h4>Implementation</h4>
<p>
ASHRAE uses the collector fluid inlet temperature to compute the heat loss
(see Duffie and Beckmann, p. 293).
However, unless the environment temperature which was present during the
collector rating is known, which is not the case, one cannot compute a
log mean temperature difference that would improve the <i>UA</i> calculation.
Hence, this model is using the fluid temperature of each segment
to compute the heat loss to the environment.
</p>

<h4>References</h4>
<p>
ASHRAE 93-2010 -- Methods of Testing to Determine the Thermal Performance of Solar
Collectors (ANSI approved).
</p>
<p>
J.A. Duffie and W.A. Beckman 2006, Solar Engineering of Thermal Processes (3rd Edition),
John Wiley &amp; Sons, Inc.
</p>
</html>", revisions="<html>
<ul>
<li>
February 15, 2024, by Jelger Jansen:<br/>
Refactor model.<br/>
This is for
<a href=\"https://github.com/lbl-srg/modelica-buildings/issues/3604\">Buildings, #3604</a>.
</li>
<li>
December 17, 2017, by Michael Wetter:<br/>
Revised computation of heat loss.<br/>
This is for
<a href=\"https://github.com/lbl-srg/modelica-buildings/issues/1100\">
issue 1100</a>.
</li>
<li>
Jan 16, 2012, by Peter Grant:<br/>
First implementation
</li>
</ul>
</html>"));
end ASHRAEHeatLoss;
Loading
Loading