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

Fixes for #4424 #4547

Merged
merged 3 commits into from
Feb 27, 2025
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ model DynamicPipeEnergyConservationCheck2
modelStructure=Modelica.Fluid.Types.ModelStructure.av_b,
useInnerPortProperties=true)
annotation (Placement(transformation(extent={{-10,40},{10,60}})));
inner Modelica.Fluid.System system
inner Modelica.Fluid.System system(energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial)
annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
Modelica.Fluid.Sources.MassFlowSource_h boundary(
nPorts=1,
Expand Down Expand Up @@ -59,9 +59,9 @@ model DynamicPipeEnergyConservationCheck2
redeclare package Medium = Modelica.Media.Air.DryAirNasa,
m_flow=1) annotation (Placement(transformation(extent={{-40,0},{-20,20}})));
Modelica.Fluid.Sources.FixedBoundary boundary7(
nPorts=1,
redeclare package Medium = Modelica.Media.Air.DryAirNasa,
p=100000) annotation (Placement(transformation(extent={{40,0},{20,20}})));
p=100000,
nPorts=1) annotation (Placement(transformation(extent={{70,0},{50,20}})));
Modelica.Fluid.Pipes.DynamicPipe pipeAV_VB(
length=100,
redeclare package Medium = Modelica.Media.Air.DryAirNasa,
Expand All @@ -86,9 +86,9 @@ model DynamicPipeEnergyConservationCheck2
redeclare package Medium = Modelica.Media.Air.DryAirNasa,
m_flow=1) annotation (Placement(transformation(extent={{-40,-40},{-20,-20}})));
Modelica.Fluid.Sources.FixedBoundary boundary13(
nPorts=1,
redeclare package Medium = Modelica.Media.Air.DryAirNasa,
p=100000) annotation (Placement(transformation(extent={{40,-40},{20,-20}})));
p=100000,
nPorts=1) annotation (Placement(transformation(extent={{70,-40},{50,-20}})));
Modelica.Fluid.Pipes.DynamicPipe pipeA_V_B(
length=100,
redeclare package Medium = Modelica.Media.Air.DryAirNasa,
Expand Down Expand Up @@ -116,6 +116,14 @@ model DynamicPipeEnergyConservationCheck2
nPorts=1,
redeclare package Medium = Modelica.Media.Air.DryAirNasa,
p=100000) annotation (Placement(transformation(extent={{40,-80},{20,-60}})));
Modelica.Fluid.Fittings.GenericResistances.VolumeFlowRate loss1(
redeclare package Medium = Modelica.Media.Air.DryAirNasa,
a=1e4,
b=0) annotation (Placement(transformation(extent={{22,0},{42,20}})));
Modelica.Fluid.Fittings.GenericResistances.VolumeFlowRate loss2(
redeclare package Medium = Modelica.Media.Air.DryAirNasa,
a=1e4,
b=0) annotation (Placement(transformation(extent={{20,-40},{40,-20}})));
equation
total_AV_B_a = pipeAV_B.H_flows[1] + pipeAV_B.m_flows[1]*pipeAV_B.flowModel.vs[1]^2/2;
total_AV_B_b = pipeAV_B.H_flows[end] + pipeAV_B.m_flows[end]*pipeAV_B.flowModel.vs[end]^2/2;
Expand All @@ -135,16 +143,20 @@ equation
annotation (Line(points={{10,50},{20,50}}, color={0,127,255}));
connect(boundary6.ports[1], pipeA_VB.port_a)
annotation (Line(points={{-20,10},{-10,10}}, color={0,127,255}));
connect(pipeA_VB.port_b, boundary7.ports[1])
annotation (Line(points={{10,10},{20,10}}, color={0,127,255}));
connect(boundary12.ports[1], pipeAV_VB.port_a)
annotation (Line(points={{-20,-30},{-10,-30}}, color={0,127,255}));
connect(pipeAV_VB.port_b, boundary13.ports[1])
annotation (Line(points={{10,-30},{20,-30}}, color={0,127,255}));
connect(boundary18.ports[1], pipeA_V_B.port_a)
annotation (Line(points={{-20,-70},{-10,-70}}, color={0,127,255}));
connect(pipeA_V_B.port_b, boundary19.ports[1])
annotation (Line(points={{10,-70},{20,-70}}, color={0,127,255}));
connect(pipeA_VB.port_b, loss1.port_a)
annotation (Line(points={{10,10},{22,10}}, color={0,127,255}));
connect(boundary7.ports[1], loss1.port_b)
annotation (Line(points={{50,10},{42,10}}, color={0,127,255}));
connect(pipeAV_VB.port_b, loss2.port_a)
annotation (Line(points={{10,-30},{20,-30}}, color={0,127,255}));
connect(boundary13.ports[1], loss2.port_b)
annotation (Line(points={{50,-30},{40,-30}}, color={0,127,255}));
annotation (experiment(StopTime=500),
Documentation(info="<html>
Test of energy conservation in dynamic pipes.
Expand Down