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

Wrong calculation of nominal mass flow rate in PartialSolarCollector #1960

Merged
merged 9 commits into from
Feb 11, 2025
26 changes: 15 additions & 11 deletions IBPSA/Fluid/SolarCollectors/BaseClasses/PartialSolarCollector.mo
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ partial model PartialSolarCollector "Partial model for solar collectors"
IBPSA.Fluid.SolarCollectors.Types.SystemConfiguration.Series
"Selection of system configuration"
annotation(Dialog(group="Configuration declarations"));
parameter Integer nPanelsSer=0 "Number of array panels in series"
annotation(Dialog(group="Configuration declarations", enable= (sysConfig == IBPSA.Fluid.SolarCollectors.Types.SystemConfiguration.Array)));
parameter Integer nPanelsPar=0 "Number of array panels in parallel"
annotation(Dialog(group="Configuration declarations", enable= (sysConfig == IBPSA.Fluid.SolarCollectors.Types.SystemConfiguration.Array)));

Expand Down Expand Up @@ -158,14 +156,14 @@ protected
totalArea/per.A "Number of panels used in the simulation";
parameter Real nPanelsSer_internal=
if sysConfig == IBPSA.Fluid.SolarCollectors.Types.SystemConfiguration.Series then
nPanels
nPanels_internal
else if sysConfig == IBPSA.Fluid.SolarCollectors.Types.SystemConfiguration.Parallel then
1
else
nPanelsSer "Number of panels in series";
nPanels_internal/nPanelsPar_internal "Number of panels in series";
parameter Real nPanelsPar_internal=
if sysConfig == IBPSA.Fluid.SolarCollectors.Types.SystemConfiguration.Parallel then
nPanels
nPanels_internal
else if sysConfig == IBPSA.Fluid.SolarCollectors.Types.SystemConfiguration.Series then
1
else
Expand All @@ -186,12 +184,10 @@ initial equation
": The constant homotopyInitialization has been modified from its default value. This constant will be removed in future releases.",
level = AssertionLevel.warning);

if sysConfig==IBPSA.Fluid.SolarCollectors.Types.SystemConfiguration.Array then
assert(abs(nPanelsPar_internal*nPanelsSer_internal-nPanels_internal) < 1E-6,
"In " + getInstanceName() +
": The product of the number of panels in series and parallel is not equal to the total number of panels in the array.",
level = AssertionLevel.error);
end if;
assert(mod(ATot_internal,per.A)/per.A <= 0.01,
"In " + getInstanceName() +
": The total collector area is not an exact multitude of a single collector's area.",
level = AssertionLevel.warning);

equation
connect(shaCoe_internal,shaCoe_in);
Expand Down Expand Up @@ -258,6 +254,14 @@ EnergyPlus 23.2.0 Engineering Reference</a>
</html>", revisions="<html>
<ul>
<li>
February 4, 2025, by Jelger Jansen:<br/>
Use <code>nPanels_internal</code> when calculating <code>nPanelsPar_internal</code> and <code>nPanelsSer_internal</code>.
Only request <code>nPanelsPar</code> as an input for an array of collectors and
add assert to check if the total collector area is an exact multitude of a single collector's area.
This is for
<a href=\"https://github.com/ibpsa/modelica-ibpsa/issues/1956\">IBPSA, #1956</a>.
</li>
<li>
February 27, 2024, by Jelger Jansen:<br/>
Refactor model.<br/>
This is for
Expand Down
7 changes: 6 additions & 1 deletion IBPSA/Fluid/SolarCollectors/Examples/FlatPlate.mo
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ model FlatPlate "Test model for FlatPlate"
rho=0.2,
nColType=IBPSA.Fluid.SolarCollectors.Types.NumberSelection.Number,
sysConfig=IBPSA.Fluid.SolarCollectors.Types.SystemConfiguration.Array,
nPanelsSer=5,
nPanelsPar=5,
per=IBPSA.Fluid.SolarCollectors.Data.GlazedFlatPlate.FP_GuangdongFSPTY95(),
nPanels=25,
Expand Down Expand Up @@ -86,6 +85,12 @@ for a variable fluid flow rate and weather data from San Francisco, CA, USA.
revisions="<html>
<ul>
<li>
February 4, 2025, by Jelger Jansen:<br/>
Remove <code>nPanelsSer</code> as a model parameter.
This is for
<a href=\"https://github.com/ibpsa/modelica-ibpsa/issues/1956\">IBPSA, #1956</a>.
</li>
<li>
February 15, 2024, by Jelger Jansen:<br/>
Refactor model.<br/>
This is for
Expand Down
10 changes: 5 additions & 5 deletions IBPSA/Fluid/SolarCollectors/UsersGuide.mo
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,11 @@ the collector field has a mass flow rate equal to
</li>
<li>
<code>Array</code>: If <code>Array</code> is selected it is assumed that the
panels are mounted as a rectangular array with <code>nPanelsPar</code> rows,
each having <code>nPanelsSer</code> panels in series. As a result there is a
pressure drop corresponding to <code>dp_nominal</code> for each panel per row
and the effective <code>dp_nominal</code> for the system is
<code>dp_nominal</code> * <code>nPanelsSer</code>.
panels are mounted as a rectangular array with <code>nPanelsPar</code> rows in parallel.
As a result, the pressure drop is calculated using <code>dp_nominal = nSer * per.dp_nominal</code>,
where <code>nSer</code> is the number of panels in series, which is internally computed,
and <code>per.dp_nominal</code> is the pressure drop of a panel as obtained from the performance
record <code>per</code> at the respective nominal mass flow rate.
</li>
</ul>
</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ clear

convertClear();

// Conversion for https://github.com/ibpsa/modelica-ibpsa/issues/1956
convertModifiers("IBPSA.Fluid.SolarCollectors.ASHRAE93",
{"nPanelsSer"}, fill("",0), true);
convertModifiers("IBPSA.Fluid.SolarCollectors.EN12975",
{"nPanelsSer"}, fill("",0), true);

// Conversion for https://github.com/ibpsa/modelica-ibpsa/issues/1926
convertModifiers("IBPSA.Fluid.Movers.FlowControlled_dp",
{"use_inputFilter"}, {"use_riseTime"}, true);
Expand Down