-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue2510 main91x pipe autosize dh start (#3173)
* Copy changes from PR3163 * Add Documentation annotation to new Validation package Co-authored-by: Michael Wetter <[email protected]>
- Loading branch information
Showing
11 changed files
with
185 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
96 changes: 96 additions & 0 deletions
96
Buildings/Experimental/DHC/Networks/Combined/BaseClasses/Validation/Pipe.mo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
within Buildings.Experimental.DHC.Networks.Combined.BaseClasses.Validation; | ||
model Pipe "Validates the PipeAutosize model initialization" | ||
extends Modelica.Icons.Example; | ||
package Medium = Buildings.Media.Water "Medium model"; | ||
parameter Real dp1_length_nominal(final unit="Pa/m")=1000 "Pressure drop per unit length 1"; | ||
parameter Real dp2_length_nominal(final unit="Pa/m")=0.1 "Pressure drop per unit length 2"; | ||
parameter Modelica.Units.SI.MassFlowRate m1_flow_nominal=0.01 "Nominal mass flow rate 1"; | ||
parameter Modelica.Units.SI.MassFlowRate m2_flow_nominal=1000 "Nominal mass flow rate 2"; | ||
Buildings.Fluid.Sources.Boundary_pT sin(redeclare final package Medium = | ||
Medium, nPorts=4) "Sink for water flow" annotation (Placement( | ||
transformation( | ||
extent={{-10,-10},{10,10}}, | ||
rotation=180, | ||
origin={50,0}))); | ||
Buildings.Experimental.DHC.Networks.Combined.BaseClasses.PipeStandard pipSta1( | ||
redeclare final package Medium = Medium, | ||
m_flow_nominal=m1_flow_nominal, | ||
dh=0.00548, | ||
length=100) "Pipe 1 with standard hydraulic diameter" | ||
annotation (Placement(transformation(extent={{-10,-30},{10,-10}}))); | ||
Buildings.Fluid.Sources.MassFlowSource_T souSta1( | ||
redeclare final package Medium = Medium, | ||
m_flow=m1_flow_nominal, | ||
nPorts=1) "Source of water flow for standard pipe 1" | ||
annotation (Placement(transformation(extent={{-60,-30},{-40,-10}}))); | ||
Buildings.Fluid.Sources.MassFlowSource_T souAut2( | ||
redeclare final package Medium = Medium, | ||
m_flow=m2_flow_nominal, | ||
nPorts=1) "Source of water flow for autosized pipe 2" | ||
annotation (Placement(transformation(extent={{-60,10},{-40,30}}))); | ||
Buildings.Experimental.DHC.Networks.Combined.BaseClasses.PipeAutosize pipAut2( | ||
redeclare final package Medium = Medium, | ||
m_flow_nominal=m2_flow_nominal, | ||
dp_length_nominal=dp2_length_nominal, | ||
length=100) "Pipe 2 with autosized hydraulic diameter" | ||
annotation (Placement(transformation(extent={{-10,10},{10,30}}))); | ||
Fluid.Sources.MassFlowSource_T souAut1( | ||
redeclare final package Medium = Medium, | ||
m_flow=m1_flow_nominal, | ||
nPorts=1) "Source of water flow for autosized pipe 1" | ||
annotation (Placement(transformation(extent={{-60,50},{-40,70}}))); | ||
PipeAutosize pipAut1( | ||
redeclare final package Medium = Medium, | ||
m_flow_nominal=m1_flow_nominal, | ||
dp_length_nominal=dp1_length_nominal, | ||
length=100) "Pipe 1 with autosized hydraulic diameter" | ||
annotation (Placement(transformation(extent={{-10,50},{10,70}}))); | ||
PipeStandard pipSta2( | ||
redeclare final package Medium = Medium, | ||
m_flow_nominal=m2_flow_nominal, | ||
dh=2.943, | ||
length=100) "Pipe 2 with standard hydraulic diameter" | ||
annotation (Placement(transformation(extent={{-10,-70},{10,-50}}))); | ||
Fluid.Sources.MassFlowSource_T souSta2( | ||
redeclare final package Medium = Medium, | ||
m_flow=m2_flow_nominal, | ||
nPorts=1) "Source of water flow for standard pipe 2" | ||
annotation (Placement(transformation(extent={{-60,-70},{-40,-50}}))); | ||
equation | ||
connect(souSta1.ports[1], pipSta1.port_a) | ||
annotation (Line(points={{-40,-20},{-10,-20}}, color={0,127,255})); | ||
connect(souAut2.ports[1], pipAut2.port_a) | ||
annotation (Line(points={{-40,20},{-10,20}}, color={0,127,255})); | ||
connect(souAut1.ports[1], pipAut1.port_a) | ||
annotation (Line(points={{-40,60},{-10,60}}, color={0,127,255})); | ||
connect(souSta2.ports[1], pipSta2.port_a) | ||
annotation (Line(points={{-40,-60},{-10,-60}}, color={0,127,255})); | ||
connect(pipAut1.port_b, sin.ports[1]) | ||
annotation (Line(points={{10,60},{40,60},{40,1.5}}, color={0,127,255})); | ||
connect(pipAut2.port_b, sin.ports[2]) annotation (Line(points={{10,20},{20,20}, | ||
{20,0.5},{40,0.5}}, color={0,127,255})); | ||
connect(pipSta1.port_b, sin.ports[3]) annotation (Line(points={{10,-20},{20,-20}, | ||
{20,-0.5},{40,-0.5}}, color={0,127,255})); | ||
connect(pipSta2.port_b, sin.ports[4]) | ||
annotation (Line(points={{10,-60},{40,-60},{40,-1.5}}, color={0,127,255})); | ||
annotation (Documentation(info="<html> | ||
<p> | ||
Validation model for <a href=\"modelica://Buildings.Experimental.DHC.Networks.Combined.BaseClasses.PipeAutosize\"> | ||
Buildings.Experimental.DHC.Networks.Combined.BaseClasses.PipeAutosize</a> | ||
for range of flow rates and pressure drops per unit length. | ||
</p> | ||
</html>", revisions="<html> | ||
<ul> | ||
<li> | ||
November 18, 2022 by David Blum:<br/> | ||
First implementation.<br/> | ||
This is for <a href=\"https://github.com/lbl-srg/modelica-buildings/issues/2510\">issue 2510</a>. | ||
</li> | ||
</ul> | ||
</html>"), | ||
__Dymola_Commands(file="modelica://Buildings/Resources/Scripts/Dymola/Experimental/DHC/Networks/Combined/BaseClasses/Validation/Pipe.mos" | ||
"Simulate and plot"), | ||
experiment( | ||
StopTime=1, | ||
Tolerance=1e-06)); | ||
end Pipe; |
12 changes: 12 additions & 0 deletions
12
Buildings/Experimental/DHC/Networks/Combined/BaseClasses/Validation/package.mo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
within Buildings.Experimental.DHC.Networks.Combined.BaseClasses; | ||
package Validation "Validation models for BaseClasses" | ||
extends Modelica.Icons.ExamplesPackage; | ||
|
||
annotation (preferredView="info", Documentation(info="<html> | ||
<p> | ||
This package contains validation cases for the BaseClasses found in | ||
<a href=\"modelica://Buildings.Experimental.DHC.Networks.Combined.BaseClasses\"> | ||
Buildings.Experimental.DHC.Networks.Combined.BaseClasses</a>. | ||
</p> | ||
</html>")); | ||
end Validation; |
1 change: 1 addition & 0 deletions
1
Buildings/Experimental/DHC/Networks/Combined/BaseClasses/Validation/package.order
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Pipe |
1 change: 1 addition & 0 deletions
1
Buildings/Experimental/DHC/Networks/Combined/BaseClasses/package.mo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ ConnectionSeriesAutosize | |
ConnectionSeriesStandard | ||
PipeAutosize | ||
PipeStandard | ||
Validation |
21 changes: 21 additions & 0 deletions
21
...sults/Dymola/Buildings_Experimental_DHC_Networks_Combined_BaseClasses_Validation_Pipe.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
last-generated=2022-11-18 | ||
statistics-initialization= | ||
{ | ||
"nonlinear": "0, 1, 0, 1", | ||
"numerical Jacobians": "0" | ||
} | ||
statistics-simulation= | ||
{ | ||
"linear": " ", | ||
"nonlinear": " ", | ||
"numerical Jacobians": "0" | ||
} | ||
time=[0e+00, 1e+00] | ||
pipSta1.dh=[5.47999981790781e-03, 5.47999981790781e-03] | ||
pipAut1.dh=[5.476676858961582e-03, 5.476676858961582e-03] | ||
pipSta2.dh=[2.943000078201294e+00, 2.943000078201294e+00] | ||
pipAut2.dh=[2.94313907623291e+00, 2.94313907623291e+00] | ||
pipSta1.dp=[1.053362734375e+05, 1.053362734375e+05] | ||
pipAut1.dp=[1.05657125e+05, 1.05657125e+05] | ||
pipSta2.dp=[1.000228691101074e+01, 1.000228691101074e+01] | ||
pipAut2.dp=[1e+01, 1e+01] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
...sources/Scripts/Dymola/Experimental/DHC/Networks/Combined/BaseClasses/Validation/Pipe.mos
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Simulate | ||
simulateModel("Buildings.Experimental.DHC.Networks.Combined.BaseClasses.Validation.Pipe", | ||
stopTime=1, | ||
method="Cvode", | ||
tolerance=1e-06, | ||
resultFile="Pipe"); | ||
// Plot commands | ||
removePlots(false); | ||
createPlot(id=1, position={527, 3, 592, 648}, y={"pipSta1.dh", "pipAut1.dh"}, range={0.0, 1.0, 0.005476000000000001, 0.005482000000000001}, grid=true, subPlot=101, colors={{28,108,200}, {238,46,47}}, timeUnit="s", displayUnits={"m", "m"}); | ||
createPlot(id=1, position={527, 3, 592, 648}, y={"pipSta2.dh", "pipAut2.dh"}, range={0.0, 1.0, 2.9429, 2.9432}, grid=true, subPlot=102, colors={{28,108,200}, {238,46,47}}, timeUnit="s", displayUnits={"m", "m"}); | ||
createPlot(id=1, position={527, 3, 592, 648}, y={"pipSta1.dp", "pipAut1.dp"}, range={0.0, 1.0, 105200.0, 105800.0}, grid=true, subPlot=103, colors={{28,108,200}, {238,46,47}}, timeUnit="s", displayUnits={"Pa", "Pa"}); | ||
createPlot(id=1, position={527, 3, 592, 648}, y={"pipSta2.dp", "pipAut2.dp"}, range={0.0, 1.0, 9.998, 10.004}, grid=true, subPlot=104, colors={{28,108,200}, {238,46,47}}, timeUnit="s", displayUnits={"Pa", "Pa"}); |
11 changes: 11 additions & 0 deletions
11
.../compareVars/Buildings.Experimental.DHC.Networks.Combined.BaseClasses.Validation.Pipe.mos
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
compareVars := | ||
{ | ||
"pipSta1.dh", | ||
"pipAut1.dh", | ||
"pipSta2.dh", | ||
"pipAut2.dh", | ||
"pipSta1.dp", | ||
"pipAut1.dp", | ||
"pipSta2.dp", | ||
"pipAut2.dp" | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters