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

Open Modelica PR #1378

Merged
merged 68 commits into from
Feb 9, 2023
Merged
Show file tree
Hide file tree
Changes from 59 commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
bc5735d
[skip-ci] Add default value for structural parameter 'n'
martinkremer Oct 13, 2022
da443b7
[skip-ci] Redeclare constants as protected
martinkremer Oct 13, 2022
bd61f1c
[skip-ci] Add connection for pumpOn-boolean in pump bus
martinkremer Oct 13, 2022
c3ea513
[skip-ci] Add boolean input for onSet in pump-bus
martinkremer Oct 13, 2022
0d77b24
[skip-ci] Add boolean input for 'onSet' in pump-bus
martinkremer Oct 13, 2022
f3fab0d
Fix compatibility bug with Open Modelica [scip-ci]
larissakuehn Oct 13, 2022
2c18c8a
Add Modelica standard icon to model for open modelica
larissakuehn Oct 13, 2022
71f5915
[skip-ci] Fix bug in not working simulation for ´AixLib.Systems.Hydra…
martinkremer Oct 13, 2022
bf02035
OpenModelica compatibility for ExergyMeter
tosch4 Oct 13, 2022
52b265f
[skip-ci] Add boolean input for pump-bus in ´AixLib.Systems.Hydraulic…
martinkremer Oct 13, 2022
6d0dfa7
Merge pull request #1362 from RWTH-EBC/1361-dpcontrolledmovers-fail-i…
larissakuehn Oct 13, 2022
070fa5b
Merge pull request #1366 from RWTH-EBC/issue1340_OpenModelica_compati…
tosch4 Oct 13, 2022
6ddb4c9
Merge pull request #1357 from RWTH-EBC/issue1351_MembraneBasedEnthalp…
HannahRomberg Oct 13, 2022
6811858
Add each, change Units to Reals for non-physical VDI equations [skip-ci]
hannah-kruetzfeldt Oct 13, 2022
463c3f1
[skip-ci] Change extrapolation in look-up table to 'Hold last point';…
martinkremer Oct 13, 2022
7c59efc
Start smaller fixes #1349
Oct 13, 2022
fa581ae
Merge branch 'development' into openModelicaProject
Oct 13, 2022
5b05860
#1372 heatingRod OpenModelica
tosch4 Oct 13, 2022
0afd613
Merge pull request #1373 from RWTH-EBC/issue1372_heatingrod_fails_in_…
tosch4 Oct 13, 2022
1ecabae
[skip-ci] Delete StateGraphs as they lead to problems with OpenModelica.
martinkremer Oct 13, 2022
7939886
add each and fix units for Window examples in ROM [skip-ci]
hannah-kruetzfeldt Oct 13, 2022
3e4e74b
Fix errors in OM by following the IBPSA changes and removing multipor…
Oct 13, 2022
11262a8
Add each for OM compatibility in ROM [skip-ci]
hannah-kruetzfeldt Oct 13, 2022
b604e6e
Merge remote-tracking branch 'origin/Issue1349_reducedorder_fails_in_…
hannah-kruetzfeldt Oct 13, 2022
3d102ed
add each [skip-ci]
hannah-kruetzfeldt Oct 13, 2022
ef42919
Merge branch 'openModelicaProject' into issue1368_PumpPolynomialBasedOM
KremerMartin Oct 13, 2022
103434f
Merge pull request #1374 from RWTH-EBC/issue1368_PumpPolynomialBasedOM
KremerMartin Oct 13, 2022
b04a4bf
Merge branch 'openModelicaProject' into issue1346_HydraulicModulesOM
KremerMartin Oct 13, 2022
da7782b
Add review changes, increase version number
Oct 13, 2022
279f41d
git commit -m "ci_update_ref
martinkremer Oct 13, 2022
3f4a36b
Merge branch 'openModelicaProject' into issue1352_DHC
DaJansenGit Oct 13, 2022
6f4e241
Merge pull request #1376 from RWTH-EBC/issue1352_DHC
FWuellhorst Oct 13, 2022
4f47965
revert AHU changes [skip-ci]
hannah-kruetzfeldt Oct 13, 2022
9b15d83
Delete Citavi invasion [skip-ci]
hannah-kruetzfeldt Oct 13, 2022
5822534
Merge pull request #1377 from RWTH-EBC/Issue1349_reducedorder_fails_i…
hannah-kruetzfeldt Oct 13, 2022
625ecd8
Merge branch 'development' into openModelicaProject
FWuellhorst Oct 13, 2022
77d3013
Merge branch 'development' into openModelicaProject
LauraMaier Oct 13, 2022
87e32cb
Automatic push of CI with updated or new regression reference files.P…
Oct 13, 2022
9eb42ba
pretty-indent and ci_update_ref
Oct 14, 2022
17142b2
Automatic push of CI with updated or new regression reference files.P…
Oct 14, 2022
736ec14
really update ref: ci_update_ref
Oct 14, 2022
30ea1a9
Merge branch 'issue1346_HydraulicModulesOM' of https://github.com/RWT…
Oct 14, 2022
aa1d0a1
Merge branch 'openModelicaProject' into issue1346_HydraulicModulesOM
KremerMartin Oct 14, 2022
7167b4d
Merge pull request #1359 from RWTH-EBC/issue1346_HydraulicModulesOM
KremerMartin Oct 14, 2022
bf89f56
Apply review from lma ci_update_ref
Oct 14, 2022
4d0f339
Merge branch 'openModelicaProject' of https://github.com/RWTH-EBC/Aix…
Oct 14, 2022
4d0fa51
Automatic push of CI with new regression reference files.Please pull …
Oct 14, 2022
2dd878b
Revert IBPSA changes
Oct 14, 2022
0094380
Merge branch 'openModelicaProject' of https://github.com/RWTH-EBC/Aix…
Oct 14, 2022
1c986a7
[skip-ci] Change Init for mass dynamics to steady state to fit to ene…
martinkremer Oct 14, 2022
33c1dac
[skip-ci] Add ´Tsteam_intern´ interface to avoid warning with usage o…
martinkremer Oct 14, 2022
02869b0
[skip-ci] Change ´gain´-block to ´product´-Block with ´realExpression…
martinkremer Oct 14, 2022
7119209
[skip-ci] Changes initilization of massDynamics to steady-state
martinkremer Oct 14, 2022
8ef7d67
[skip-ci] Add boolean input for ´onSet´ in pump-bus to avoid mismatch…
martinkremer Oct 14, 2022
bbe22c8
Delete unneccessary constant definition, directly using existing cons…
martinkremer Oct 24, 2022
9af25ff
Revert changes causing the regression test to fail. Only apply scalar…
Nov 11, 2022
0514300
only apply scalars for real
Nov 11, 2022
25f0270
Merge branch 'development' into openModelicaProject
FWuellhorst Nov 11, 2022
88a4f83
Merge pull request #1379 from RWTH-EBC/issue1345_ModularAHUOpenModelica
KremerMartin Nov 14, 2022
a311c79
chore: review from lma
Dec 6, 2022
3959215
fix path and annotation
Dec 6, 2022
fe8dbd6
Revert lines, add revisions
Dec 6, 2022
0e13ef6
Merge branch 'development' into openModelicaProject
Dec 6, 2022
d89a2f3
Merge branch 'development' into openModelicaProject
FWuellhorst Jan 16, 2023
34b4e87
Update DeviceDrivers to 2.1.1 to avoid warnings
Jan 16, 2023
2636a2a
Merge branch 'development' into openModelicaProject
FWuellhorst Feb 8, 2023
1f815fc
Add review
Feb 8, 2023
fae8e8d
Adjust revision based on review
Feb 8, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public
extent={{10,10},{-10,-10}},
rotation=180,
origin={-90,50})));
Modelica.Blocks.Math.Gain gain(k=cp_default)
Modelica.Blocks.Math.Gain gain(k(unit="J/(kg.K)")=cp_default, y(unit="J/(kg.K)"))
annotation (Placement(transformation(extent={{-32,40},{-12,60}})));
Modelica.Blocks.Math.Division hea2MasFlo annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public
extent={{10,10},{-10,-10}},
rotation=180,
origin={-90,46})));
Modelica.Blocks.Math.Gain gain(k=cp_default)
Modelica.Blocks.Math.Gain gain(k(unit="J/(kg.K)")=cp_default, y(unit="J/(kg.K)"))
annotation (Placement(transformation(extent={{-26,54},{-6,74}})));
Modelica.Blocks.Math.Division hea2MasFlo annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public
extent={{10,10},{-10,-10}},
rotation=180,
origin={-90,46})));
Modelica.Blocks.Math.Gain gain(k=cp_default)
Modelica.Blocks.Math.Gain gain(k(unit="J/(kg.K)")=cp_default, y(unit="J/(kg.K)"))
annotation (Placement(transformation(extent={{-26,54},{-6,74}})));
Modelica.Blocks.Math.Division hea2MasFlo annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public
annotation (Placement(transformation(extent={{-10,-10},{10,10}},
rotation=0,
origin={80,0})));
Modelica.Blocks.Math.Gain gain(k=cp_default)
Modelica.Blocks.Math.Gain gain(k(unit="J/(kg.K)")=cp_default, y(unit="J/(kg.K)"))
annotation (Placement(transformation(extent={{-40,104},{-20,124}})));
Modelica.Blocks.Math.Division hea2MasFlo annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
Expand Down
12 changes: 5 additions & 7 deletions AixLib/Fluid/DistrictHeatingCooling/Pipes/DHCPipe.mo
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
within AixLib.Fluid.DistrictHeatingCooling.Pipes;
model DHCPipe "Generic pipe model for DHC applications"
extends AixLib.Fluid.Interfaces.PartialTwoPortVector(show_T=true);
extends AixLib.Fluid.Interfaces.PartialTwoPortInterface(show_T=true);

FWuellhorst marked this conversation as resolved.
Show resolved Hide resolved
parameter Boolean use_zeta=false
"= true HydraulicResistance is implemented, zeta value has to be given next"
Expand Down Expand Up @@ -181,7 +181,7 @@ model DHCPipe "Generic pipe model for DHC applications"
redeclare final package Medium = Medium,
final m_flow_nominal=m_flow_nominal,
FWuellhorst marked this conversation as resolved.
Show resolved Hide resolved
final V=if rho_default > 500 then VEqu else VEqu/1000,
final nPorts=nPorts + 1,
final nPorts=2,
final T_start=T_start_out,
final energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
final mSenFac = if rho_default > 500 then 1 else 10)
Expand Down Expand Up @@ -284,14 +284,12 @@ equation
der(Q_los) = min(0, pipCor.heatPort.Q_flow);
der(Q_gai) = max(0, pipCor.heatPort.Q_flow);

for i in 1:nPorts loop
connect(vol.ports[i + 1], ports_b[i])
annotation (Line(points={{70,20},{72,20},{72,6},{72,0},{100,0}},
connect(vol.ports[2], port_b)
annotation (Line(points={{71,20},{72,20},{72,6},{72,0},{100,0}},
color={0,127,255}));
end for;

connect(pipCor.port_b, vol.ports[1])
annotation (Line(points={{10,0},{70,0},{70,20}}, color={0,127,255}));
annotation (Line(points={{10,0},{69,0},{69,20}}, color={0,127,255}));
connect(pipCor.heatPort, cylHeaTra1.port_a)
FWuellhorst marked this conversation as resolved.
Show resolved Hide resolved
annotation (Line(points={{0,10},{0,30}}, color={191,0,0},
pattern=LinePattern.Dash));
Expand Down
20 changes: 8 additions & 12 deletions AixLib/Fluid/DistrictHeatingCooling/Pipes/Examples/DHCPipe.mo
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@ model DHCPipe "Simple example of DHCPipe and its four different modes"
nPorts=1,
p(displayUnit="Pa") = 101325) "Pressure boundary condition"
annotation (Placement(transformation(extent={{72,40},{52,60}})));
AixLib.Fluid.DistrictHeatingCooling.Pipes.DHCPipe pip(
AixLib.Fluid.DistrictHeatingCooling.Pipes.DHCPipe pip(
redeclare package Medium = Medium,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
redeclare BaseClassesStatic.StaticCore pipCor "Static core",
nPorts=1,
dh=0.1,
length=100,
dIns=0.05,
Expand Down Expand Up @@ -66,11 +65,10 @@ model DHCPipe "Simple example of DHCPipe and its four different modes"
nPorts=1,
p(displayUnit="Pa") = 101325) "Pressure boundary condition"
annotation (Placement(transformation(extent={{72,0},{52,20}})));
AixLib.Fluid.DistrictHeatingCooling.Pipes.DHCPipe pip1(
AixLib.Fluid.DistrictHeatingCooling.Pipes.DHCPipe pip1(
redeclare package Medium = Medium,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
redeclare FixedResistances.BaseClasses.PlugFlowCore pipCor "PlugFlow core",
nPorts=1,
dh=0.1,
length=100,
dIns=0.05,
Expand Down Expand Up @@ -113,12 +111,11 @@ model DHCPipe "Simple example of DHCPipe and its four different modes"
nPorts=1,
p(displayUnit="Pa") = 101325) "Pressure boundary condition"
annotation (Placement(transformation(extent={{72,-42},{52,-22}})));
AixLib.Fluid.DistrictHeatingCooling.Pipes.DHCPipe pip2(
AixLib.Fluid.DistrictHeatingCooling.Pipes.DHCPipe pip2(
redeclare package Medium = Medium,
use_soil=true,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
redeclare FixedResistances.BaseClasses.PlugFlowCore pipCor "PlugFlow core",
nPorts=1,
dh=0.1,
length=100,
dIns=0.05,
Expand Down Expand Up @@ -161,12 +158,11 @@ model DHCPipe "Simple example of DHCPipe and its four different modes"
nPorts=1,
p(displayUnit="Pa") = 101325) "Pressure boundary condition"
annotation (Placement(transformation(extent={{72,-80},{52,-60}})));
AixLib.Fluid.DistrictHeatingCooling.Pipes.DHCPipe pip3(
AixLib.Fluid.DistrictHeatingCooling.Pipes.DHCPipe pip3(
redeclare package Medium = Medium,
sum_zetas=2.5,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
redeclare FixedResistances.BaseClasses.PlugFlowCore pipCor "PlugFlow core",
nPorts=1,
dh=0.1,
length=100,
dIns=0.05,
Expand Down Expand Up @@ -203,7 +199,7 @@ equation
connect(Tin.y, sou.T_in)
annotation (Line(points={{-79,54},{-72,54}},
color={0,0,127}));
connect(pip.ports_b[1], senTemOut.port_a)
connect(pip.port_b, senTemOut.port_a)
annotation (Line(points={{10,50},{20,50}},
color={0,127,255}));
connect(senTemOut.port_b, sin.ports[1])
Expand All @@ -219,7 +215,7 @@ equation
annotation (Line(points={{-80,90},{0,90},{0,20}}, color={191,0,0}));
connect(Tin1.y, sou1.T_in)
annotation (Line(points={{-79,14},{-72,14}}, color={0,0,127}));
connect(pip1.ports_b[1], senTemOut1.port_a)
connect(pip1.port_b, senTemOut1.port_a)
annotation (Line(points={{10,10},{20,10}}, color={0,127,255}));
connect(senTemOut1.port_b, sin1.ports[1])
annotation (Line(points={{40,10},{52,10}}, color={0,127,255}));
Expand All @@ -231,7 +227,7 @@ equation
annotation (Line(points={{-80,90},{0,90},{0,-22}}, color={191,0,0}));
connect(Tin2.y, sou2.T_in)
annotation (Line(points={{-79,-28},{-72,-28}}, color={0,0,127}));
connect(pip2.ports_b[1], senTemOut2.port_a)
connect(pip2.port_b, senTemOut2.port_a)
annotation (Line(points={{10,-32},{20,-32}}, color={0,127,255}));
connect(senTemOut2.port_b, sin2.ports[1])
annotation (Line(points={{40,-32},{52,-32}}, color={0,127,255}));
Expand All @@ -243,7 +239,7 @@ equation
annotation (Line(points={{-80,90},{0,90},{0,-60}}, color={191,0,0}));
connect(Tin3.y, sou3.T_in)
annotation (Line(points={{-79,-66},{-72,-66}}, color={0,0,127}));
connect(pip3.ports_b[1], senTemOut3.port_a)
connect(pip3.port_b, senTemOut3.port_a)
annotation (Line(points={{10,-70},{20,-70}}, color={0,127,255}));
connect(senTemOut3.port_b, sin3.ports[1])
annotation (Line(points={{40,-70},{52,-70}}, color={0,127,255}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ model PlugFlowPipeEmbedded "Simple example of PlugFlowPipeEmbedded"
pip(
redeclare package Medium = Medium,
energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyStateInitial,
nPorts=1,
dh=0.1,
length=100,
dIns=0.05,
Expand Down Expand Up @@ -60,7 +59,7 @@ equation
color={191,0,0}));
connect(Tin.y, sou.T_in)
annotation (Line(points={{-71,4},{-62,4}}, color={0,0,127}));
connect(pip.ports_b[1], senTemOut.port_a)
connect(pip.port_b, senTemOut.port_a)
annotation (Line(points={{20,0},{30,0}}, color={0,127,255}));
connect(senTemOut.port_b, sin.ports[1])
annotation (Line(points={{50,0},{62,0}}, color={0,127,255}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ model PlugFlowPipeZeta "Simple example of PlugFlowPipe"
annotation (Placement(transformation(extent={{82,-10},{62,10}})));
AixLib.Fluid.DistrictHeatingCooling.Pipes.PlugFlowPipeZeta pip(
redeclare package Medium = Medium,
nPorts=1,
dh=0.1,
length=100,
dIns=0.05,
Expand Down Expand Up @@ -57,7 +56,7 @@ equation
annotation (Line(points={{-20,70},{10,70},{10,10}}, color={191,0,0}));
connect(Tin.y, sou.T_in)
annotation (Line(points={{-71,4},{-62,4}}, color={0,0,127}));
connect(pip.ports_b[1], senTemOut.port_a)
connect(pip.port_b, senTemOut.port_a)
annotation (Line(points={{20,0},{30,0}}, color={0,127,255}));
connect(senTemOut.port_b, sin.ports[1])
annotation (Line(points={{50,0},{62,0}}, color={0,127,255}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ model StaticPipe "Simple example of StaticPipe"
annotation (Placement(transformation(extent={{82,-10},{62,10}})));
AixLib.Fluid.DistrictHeatingCooling.Pipes.StaticPipe pip(
redeclare package Medium = Medium,
nPorts=1,
dh=0.1,
length=100,
dIns=0.05,
Expand Down Expand Up @@ -57,7 +56,7 @@ equation
annotation (Line(points={{-20,70},{10,70},{10,10}}, color={191,0,0}));
connect(Tin.y, sou.T_in)
annotation (Line(points={{-71,4},{-62,4}}, color={0,0,127}));
connect(pip.ports_b[1], senTemOut.port_a)
connect(pip.port_b, senTemOut.port_a)
annotation (Line(points={{20,0},{30,0}}, color={0,127,255}));
connect(senTemOut.port_b, sin.ports[1])
annotation (Line(points={{50,0},{62,0}}, color={0,127,255}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
model PlugFlowPipeEmbedded
"Embedded pipe model using spatialDistribution for temperature delay"

extends AixLib.Fluid.Interfaces.PartialTwoPortVector(show_T=true);
extends AixLib.Fluid.Interfaces.PartialTwoPortInterface(show_T=true);

parameter Modelica.Fluid.Types.Dynamics energyDynamics=Modelica.Fluid.Types.Dynamics.DynamicFreeInitial
"Type of energy balance: dynamic (3 initialization options) or steady state"
Expand Down Expand Up @@ -61,11 +61,11 @@ model PlugFlowPipeEmbedded
parameter Modelica.Units.SI.Length thickness=0.0035 "Pipe wall thickness"
annotation (Dialog(group="Material"));

parameter Modelica.Units.SI.Temperature T_start_in(start=Medium.T_default) =
parameter Modelica.Units.SI.Temperature T_start_in(start=Medium.T_default)=
Medium.T_default "Initialization temperature at pipe inlet"
annotation (Dialog(tab="Initialization"));
parameter Modelica.Units.SI.Temperature T_start_out(start=Medium.T_default)
= T_start_in "Initialization temperature at pipe outlet"
parameter Modelica.Units.SI.Temperature T_start_out(start=Medium.T_default)=
T_start_in "Initialization temperature at pipe outlet"
annotation (Dialog(tab="Initialization"));
FWuellhorst marked this conversation as resolved.
Show resolved Hide resolved
parameter Boolean initDelay(start=false) = false
"Initialize delay for a constant mass flow rate if true, otherwise start from 0"
Expand Down Expand Up @@ -135,7 +135,6 @@ model PlugFlowPipeEmbedded
final R=R,
final fac=fac,
final sum_zetas=sum_zetas,
nPorts=nPorts,
final use_zeta=true)
annotation (Placement(transformation(extent={{-10,-10},{10,10}})));

Expand Down Expand Up @@ -215,7 +214,7 @@ equation
annotation (Line(points={{0,90.8},{0,104}}, color={191,0,0}));
connect(port_a, plugFlowPipeZeta.port_a)
annotation (Line(points={{-100,0},{-10,0}}, color={0,127,255}));
connect(plugFlowPipeZeta.ports_b, ports_b) annotation (Line(points={{10,0},{56,
connect(plugFlowPipeZeta.port_b, port_b) annotation (Line(points={{10,0},{56,
0},{56,0},{100,0}}, color={0,127,255}));
annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={
Rectangle(
Expand Down
18 changes: 8 additions & 10 deletions AixLib/Fluid/DistrictHeatingCooling/Pipes/PlugFlowPipeZeta.mo
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
within AixLib.Fluid.DistrictHeatingCooling.Pipes;
model PlugFlowPipeZeta
"Pipe model using spatialDistribution for temperature delay and conditional HydraulicResistance"
extends AixLib.Fluid.Interfaces.PartialTwoPortVector(show_T=true);
extends AixLib.Fluid.Interfaces.PartialTwoPortInterface(show_T=true);
FWuellhorst marked this conversation as resolved.
Show resolved Hide resolved

parameter Boolean use_zeta=false
"= true HydraulicResistance is implemented, zeta value has to be given next"
Expand Down Expand Up @@ -56,11 +56,11 @@ model PlugFlowPipeZeta
parameter Modelica.Units.SI.Length thickness=0.0035 "Pipe wall thickness"
annotation (Dialog(group="Material"));

parameter Modelica.Units.SI.Temperature T_start_in(start=Medium.T_default) =
parameter Modelica.Units.SI.Temperature T_start_in(start=Medium.T_default)=
Medium.T_default "Initialization temperature at pipe inlet"
annotation (Dialog(tab="Initialization"));
parameter Modelica.Units.SI.Temperature T_start_out(start=Medium.T_default)
= T_start_in "Initialization temperature at pipe outlet"
parameter Modelica.Units.SI.Temperature T_start_out(start=Medium.T_default)=
T_start_in "Initialization temperature at pipe outlet"
annotation (Dialog(tab="Initialization"));
parameter Boolean initDelay(start=false) = false
"Initialize delay for a constant mass flow rate if true, otherwise start from 0"
Expand Down Expand Up @@ -128,7 +128,7 @@ model PlugFlowPipeZeta
redeclare final package Medium = Medium,
final m_flow_nominal=m_flow_nominal,
final V=if rho_default > 500 then VEqu else VEqu/1000,
final nPorts=nPorts + 1,
final nPorts=2,
final T_start=T_start_out,
final energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
final mSenFac = if rho_default > 500 then 1 else 10)
Expand Down Expand Up @@ -178,16 +178,14 @@ equation
//calculation of the flow velocity of medium in the pipes
v_med = (4 * port_a.m_flow) / (Modelica.Constants.pi * rho_default * dh * dh);

for i in 1:nPorts loop
connect(vol.ports[i + 1], ports_b[i])
annotation (Line(points={{70,20},{72,20},{72,6},{72,0},{100,0}},
connect(vol.ports[2], port_b)
annotation (Line(points={{71,20},{72,20},{72,6},{72,0},{100,0}},
color={0,127,255}));
end for;
connect(plugFlowCore.heatPort, heatPort)
annotation (Line(points={{0,10},{0,10},{0,100}}, color={191,0,0}));

connect(plugFlowCore.port_b, vol.ports[1])
annotation (Line(points={{10,0},{70,0},{70,20}}, color={0,127,255}));
annotation (Line(points={{10,0},{69,0},{69,20}}, color={0,127,255}));
if use_zeta then
connect(hydraulicResistance.port_b, plugFlowCore.port_a)
annotation (Line(points={{-40,20},{-20,20},{-20,0},{-10,0}},
Expand Down
18 changes: 8 additions & 10 deletions AixLib/Fluid/DistrictHeatingCooling/Pipes/StaticPipe.mo
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
within AixLib.Fluid.DistrictHeatingCooling.Pipes;
model StaticPipe
"Static Pipe model using conditional HydraulicResistance"
extends AixLib.Fluid.Interfaces.PartialTwoPortVector(show_T=true);
extends AixLib.Fluid.Interfaces.PartialTwoPortInterface(show_T=true);
FWuellhorst marked this conversation as resolved.
Show resolved Hide resolved

parameter Boolean use_zeta=false
"= true HydraulicResistance is implemented, zeta value has to be given next"
Expand Down Expand Up @@ -56,11 +56,11 @@ model StaticPipe
parameter Modelica.Units.SI.Length thickness=0.0035 "Pipe wall thickness"
annotation (Dialog(group="Material"));

parameter Modelica.Units.SI.Temperature T_start_in(start=Medium.T_default) =
parameter Modelica.Units.SI.Temperature T_start_in(start=Medium.T_default)=
Medium.T_default "Initialization temperature at pipe inlet"
annotation (Dialog(tab="Initialization"));
parameter Modelica.Units.SI.Temperature T_start_out(start=Medium.T_default)
= T_start_in "Initialization temperature at pipe outlet"
parameter Modelica.Units.SI.Temperature T_start_out(start=Medium.T_default)=
T_start_in "Initialization temperature at pipe outlet"
annotation (Dialog(tab="Initialization"));
FWuellhorst marked this conversation as resolved.
Show resolved Hide resolved
parameter Boolean initDelay(start=false) = false
"Initialize delay for a constant mass flow rate if true, otherwise start from 0"
Expand Down Expand Up @@ -129,7 +129,7 @@ model StaticPipe
redeclare final package Medium = Medium,
final m_flow_nominal=m_flow_nominal,
final V=if rho_default > 500 then VEqu else VEqu/1000,
final nPorts=nPorts + 1,
final nPorts=2,
final T_start=T_start_out,
final energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
final mSenFac = if rho_default > 500 then 1 else 10)
Expand Down Expand Up @@ -179,16 +179,14 @@ equation
//calculation of the flow velocity of medium in the pipes
v_med = (4 * port_a.m_flow) / (Modelica.Constants.pi * rho_default * dh * dh);

for i in 1:nPorts loop
connect(vol.ports[i + 1], ports_b[i])
annotation (Line(points={{70,20},{72,20},{72,6},{72,0},{100,0}},
connect(vol.ports[2], port_b)
annotation (Line(points={{71,20},{72,20},{72,6},{72,0},{100,0}},
color={0,127,255}));
end for;
connect(staticCore.heatPort, heatPort)
annotation (Line(points={{0,10},{0,10},{0,100}}, color={191,0,0}));

connect(staticCore.port_b, vol.ports[1])
annotation (Line(points={{10,0},{70,0},{70,20}}, color={0,127,255}));
annotation (Line(points={{10,0},{69,0},{69,20}}, color={0,127,255}));
//Connect hydraulicResistance
if use_zeta then
connect(hydraulicResistance.port_b, staticCore.port_a)
Expand Down
6 changes: 5 additions & 1 deletion AixLib/Fluid/HeatExchangers/Examples/HeatingRod.mo
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ model HeatingRod "Example for the usage of the heating rod model"
extends Modelica.Icons.Example;
extends AixLib.Fluid.HeatExchangers.Examples.BaseClasses.Heater(
redeclare package Medium = AixLib.Media.Water,
m_flow_nominal=V*heatingRod.rho_default/3600,
m_flow_nominal=V*rhoWat/3600,
Q_flow_nominal=100,
conPI(k=10),
vol(V=V/1000),
Expand All @@ -23,6 +23,10 @@ model HeatingRod "Example for the usage of the heating rod model"
Modelica.Blocks.Interfaces.RealOutput Pel
"Electrical power used to provide current heat flow"
annotation (Placement(transformation(extent={{120,-70},{140,-50}})));

protected
parameter Modelica.Units.SI.Density rhoWat=1000 "Density of water";

FWuellhorst marked this conversation as resolved.
Show resolved Hide resolved
equation
connect(mov.port_b, heatingRod.port_a)
annotation (Line(points={{-50,-40},{-30,-40}}, color={0,127,255}));
Expand Down
Loading