From bcd88b016260bac556fccad0c27886639cb017b1 Mon Sep 17 00:00:00 2001 From: Hubertus Tummescheit Date: Thu, 20 Feb 2025 01:43:38 +0000 Subject: [PATCH 1/8] added .impact --- .impact/project.json | 70 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 .impact/project.json diff --git a/.impact/project.json b/.impact/project.json new file mode 100644 index 00000000..83457709 --- /dev/null +++ b/.impact/project.json @@ -0,0 +1,70 @@ +{ + "name": "Thermofluidstream", + "format": "1.0.0", + "dependencies": [], + "content": [ + { + "relpath": "ThermofluidStream", + "contentType": "MODELICA", + "name": "ThermofluidStrea", + "defaultDisabled": false, + "id": "e74f4457bc544294b6e50858706270d6" + }, + { + "relpath": "TILMediaWrapper", + "contentType": "MODELICA", + "name": "TILMediaWrapper", + "defaultDisabled": false, + "id": "a79a8cc6a9174ffdb2dd3823e48003ac" + }, + { + "relpath": "Resources/Views", + "contentType": "VIEWS", + "defaultDisabled": false, + "id": "aac16222f99f466c964a95374ce14877" + }, + { + "relpath": "Resources/Favorites", + "contentType": "FAVORITES", + "defaultDisabled": false, + "id": "a8b7ca68eff743bbbe6ef284693f7c5b" + }, + { + "relpath": "Resources/CustomFunctions", + "contentType": "CUSTOM_FUNCTIONS", + "defaultDisabled": false, + "id": "41005c09694840d1a8846873932506b8" + }, + { + "relpath": "Resources/Custom", + "contentType": "GENERIC", + "defaultDisabled": false, + "id": "7c56884aa265475b8c6c388a6fa8326e" + }, + { + "relpath": "ReferenceResults", + "contentType": "REFERENCE_RESULTS", + "defaultDisabled": false, + "id": "5b6e7f0fbc3248178e8a397ee3550195" + }, + { + "relpath": "Resources/ExperimentDefinitions", + "contentType": "EXPERIMENT_DEFINITIONS", + "defaultDisabled": false, + "id": "7c0cf26cfdd04ff198522c9ea7d6298e" + }, + { + "relpath": "community", + "contentType": "GENERIC", + "defaultDisabled": true, + "id": "1452459b29cd4cde99434e8891e54284" + }, + { + "relpath": "doc", + "contentType": "GENERIC", + "defaultDisabled": true, + "id": "bf313e3c81f544e480257769f62ad69d" + } + ], + "executionOptions": [] +} \ No newline at end of file From 102525f2bae8b76814b9b6e526299877522b2f82 Mon Sep 17 00:00:00 2001 From: Hubertus Tummescheit Date: Mon, 14 Apr 2025 16:57:43 +0000 Subject: [PATCH 2/8] Made cross-flow parameter public: for debugging, could be reversed --- .impact/project.json | 14 +- Examples/FromScratch.mo | 4 + Examples/SimpleEngine.mo | 262 ++++++++++++++++++ Examples/package.mo | 3 + Examples/package.order | 2 + .../Examples/SimpleEngine/Metadata.json | 3 + .../Examples/SimpleEngine/experiment_1.json | 54 ++++ .../Examples/SimpleAirCycle/Metadata.json | 3 + .../Examples/SimpleAirCycle/experiment_1.json | 51 ++++ .../Examples/SimpleStream/Metadata.json | 3 + .../Examples/SimpleStream/experiment_1.json | 52 ++++ .../impact-analysis-dashboard-view-1984.json | 16 ++ .../impact-analysis-dashboard-view-1984.json | 16 ++ .../HeatExchangers/Internal/PartialNTU.mo | 2 +- 14 files changed, 483 insertions(+), 2 deletions(-) create mode 100644 Examples/FromScratch.mo create mode 100644 Examples/SimpleEngine.mo create mode 100644 Examples/package.mo create mode 100644 Examples/package.order create mode 100644 Resources/ExperimentDefinitions/Examples/SimpleEngine/Metadata.json create mode 100644 Resources/ExperimentDefinitions/Examples/SimpleEngine/experiment_1.json create mode 100644 Resources/ExperimentDefinitions/ThermofluidStream/Examples/SimpleAirCycle/Metadata.json create mode 100644 Resources/ExperimentDefinitions/ThermofluidStream/Examples/SimpleAirCycle/experiment_1.json create mode 100644 Resources/ExperimentDefinitions/ThermofluidStream/Examples/SimpleStream/Metadata.json create mode 100644 Resources/ExperimentDefinitions/ThermofluidStream/Examples/SimpleStream/experiment_1.json create mode 100644 Resources/Views/Examples/SimpleEngine/impact-analysis-dashboard-view-1984.json create mode 100644 Resources/Views/ThermofluidStream/Examples/SimpleAirCycle/impact-analysis-dashboard-view-1984.json diff --git a/.impact/project.json b/.impact/project.json index 83457709..b900b3b9 100644 --- a/.impact/project.json +++ b/.impact/project.json @@ -1,7 +1,12 @@ { "name": "Thermofluidstream", "format": "1.0.0", - "dependencies": [], + "dependencies": [ + { + "name": "Modelica", + "versionSpecifier": "4.0.0" + } + ], "content": [ { "relpath": "ThermofluidStream", @@ -64,6 +69,13 @@ "contentType": "GENERIC", "defaultDisabled": true, "id": "bf313e3c81f544e480257769f62ad69d" + }, + { + "relpath": "Examples", + "contentType": "MODELICA", + "name": "Examples", + "defaultDisabled": false, + "id": "030ebf9f6f814647b860ae6580b29725" } ], "executionOptions": [] diff --git a/Examples/FromScratch.mo b/Examples/FromScratch.mo new file mode 100644 index 00000000..f55052f6 --- /dev/null +++ b/Examples/FromScratch.mo @@ -0,0 +1,4 @@ +within Examples; +model FromScratch + annotation(Icon(coordinateSystem(preserveAspectRatio = false,extent = {{-100.0,-100.0},{100.0,100.0}}),graphics = {Rectangle(lineColor={0,0,0},fillColor={230,230,230},fillPattern=FillPattern.Solid,extent={{-100.0,-100.0},{100.0,100.0}}),Text(lineColor={0,0,255},extent={{-150,150},{150,110}},textString="%name")})); +end FromScratch; diff --git a/Examples/SimpleEngine.mo b/Examples/SimpleEngine.mo new file mode 100644 index 00000000..393c46ee --- /dev/null +++ b/Examples/SimpleEngine.mo @@ -0,0 +1,262 @@ +within Examples; + +model SimpleEngine "Simple steam engine" + extends .Modelica.Icons.Example; + + package Water = .ThermofluidStream.Media.myMedia.Water.StandardWater; + + + inner .ThermofluidStream.DropOfCommons dropOfCommons( + L=1e-3, + assertionLevel = AssertionLevel.warning,displayParameters = true) + annotation (Placement(transformation(extent={{140,-34},{160,-14}}))); + .ThermofluidStream.Examples.Utilities.SteamSink steamSink( + redeclare package Medium = Water, + p0_par=100000, + m_flow_animate=0.25) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}, + rotation=90, + origin={190,90}))); + + .ThermofluidStream.Processes.ConductionElement conductionElement( + redeclare package Medium = Water, + A=20, + init=.ThermofluidStream.Processes.Internal.InitializationMethodsCondElement.T, + T_0=573.15) + annotation (Placement(transformation(extent={{-60,64},{-40,44}}))); + .Modelica.Thermal.HeatTransfer.Sources.FixedTemperature fixedTemperature( + T(displayUnit="degC") = 873.15) + annotation (Placement(transformation(extent={{-80,70},{-60,90}}))); + .ThermofluidStream.Examples.Utilities.CrankDrive crankDrive( + rodLength=3, + crankPoint=0.25, + translationMass=1e2, + J_flyweel=1e2, + phi0=-1.5707963267949) + annotation (Placement(transformation(extent={{2.0,-38.0},{-118.0,-98.0}},rotation = 0.0,origin = {0.0,0.0}))); + + .ThermofluidStream.Examples.Utilities.Piston piston( + redeclare package Medium = Water, + A=0.05, + l_stroke=0.5, + V_dead=0.2, + outputX=false, + initializeX=false, + m0_left=0.1, + m0_right=0.1, + x0=0.5) annotation (Placement(transformation(extent={{80,-100},{20,-40}}))); + .ThermofluidStream.Undirected.Topology.ConnectorInletOutletFore switchConnector( + redeclare package Medium = Water) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={70,34}))); + .ThermofluidStream.Undirected.Topology.ConnectorInletOutletFore switchConnector1( + redeclare package Medium = Water) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={50,54}))); + .ThermofluidStream.FlowControl.Switch switch(redeclare package Medium = Water) annotation (Placement(transformation(extent={{-10,10},{10,-10}}, + rotation=0, + origin={-10,54}))); + .ThermofluidStream.Topology.JunctionT2 junctionT2_1(redeclare package Medium = Water) + annotation (Placement(transformation( + extent={{-10,10},{10,-10}}, + rotation=0, + origin={150,54}))); + .ThermofluidStream.Processes.FlowResistance flowResistance3( + redeclare package Medium = Water, + m_flowStateSelect=StateSelect.prefer, + initM_flow=.ThermofluidStream.Utilities.Types.InitializationMethods.state, + r=0.015, + l=1, + redeclare function pLoss = .ThermofluidStream.Processes.Internal.FlowResistance.laminarTurbulentPressureLoss ( + material=.ThermofluidStream.Processes.Internal.Material.steel)) + annotation (Placement(transformation(extent={{10,44},{30,64}}))); + .ThermofluidStream.Processes.FlowResistance flowResistance4( + redeclare package Medium = Water, + m_flowStateSelect=StateSelect.prefer, + initM_flow=.ThermofluidStream.Utilities.Types.InitializationMethods.state, + r=0.015, + l=1, + redeclare function pLoss = .ThermofluidStream.Processes.Internal.FlowResistance.laminarTurbulentPressureLoss ( + material=.ThermofluidStream.Processes.Internal.Material.steel)) + annotation (Placement(transformation(extent={{-2,24},{18,44}}))); + .ThermofluidStream.Processes.FlowResistance flowResistance5( + redeclare package Medium = Water, + m_flowStateSelect=StateSelect.prefer, + initM_flow=.ThermofluidStream.Utilities.Types.InitializationMethods.state, + r=0.015, + l=1, + redeclare function pLoss = .ThermofluidStream.Processes.Internal.FlowResistance.laminarTurbulentPressureLoss ( + material=.ThermofluidStream.Processes.Internal.Material.steel)) + annotation (Placement(transformation(extent={{70,44},{90,64}}))); + .ThermofluidStream.Processes.FlowResistance flowResistance6( + redeclare package Medium = Water, + m_flowStateSelect=StateSelect.prefer, + initM_flow=.ThermofluidStream.Utilities.Types.InitializationMethods.state, + r=0.015, + l=1, + redeclare function pLoss = .ThermofluidStream.Processes.Internal.FlowResistance.laminarTurbulentPressureLoss ( + material=.ThermofluidStream.Processes.Internal.Material.steel)) + annotation (Placement(transformation(extent={{88,24},{108,44}}))); + .ThermofluidStream.FlowControl.TanValve tanValve(redeclare package Medium = Water, invertInput=false) annotation (Placement(transformation(extent={{100,64},{120,44}}))); + .ThermofluidStream.FlowControl.TanValve tanValve1(redeclare package Medium = Water, invertInput=true) annotation (Placement(transformation(extent={{120,24},{140,44}}))); + .Modelica.Blocks.Math.BooleanToReal booleanToReal(realTrue=0.0, realFalse=1.0) + annotation (Placement(transformation( + extent={{8,-8},{-8,8}}, + rotation=180, + origin={-70,-16}))); + .Modelica.Blocks.Continuous.FirstOrder firstOrder(T=0.01, initType=.Modelica.Blocks.Types.Init.SteadyState) + annotation (Placement(transformation(extent={{8,8},{-8,-8}}, + rotation=180, + origin={-40,-16}))); + .ThermofluidStream.Boundaries.PhaseSeparator boiler( + redeclare package Medium = Water, + useHeatport=true, + A=20, + p_start=400000, + V_par=0.1, + pipe_low=0.9, + pipe_high=0.95, + init_method=.ThermofluidStream.Boundaries.Internal.InitializationMethodsPhaseSeperator.l) + annotation (Placement(transformation(extent={{-100,44},{-80,64}}))); + .Modelica.Blocks.Continuous.LimPID PI1( + controllerType=.Modelica.Blocks.Types.SimpleController.PI, + k=1e6, + Ti=2, + yMax=10000000, + yMin=0, + y_start=0) annotation (Placement(transformation(extent={{-150,24},{-130,44}}))); + .Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow heating_element + annotation (Placement(transformation(extent={{-120,24},{-100,44}}))); + .Modelica.Blocks.Sources.RealExpression realExpression1(y=4) annotation (Placement(transformation(extent={{-180,24},{-160,44}}))); + .ThermofluidStream.Sensors.SingleSensorSelect singleSensorSelect( + redeclare package Medium = Water, + quantity=.ThermofluidStream.Sensors.Internal.Types.Quantities.p_bar, + outputValue=true, + filter_output=false) annotation (Placement(transformation( + extent={{-10,10},{10,-10}}, + rotation=180, + origin={-96,16}))); + .ThermofluidStream.Boundaries.TerminalSource terminalSource(redeclare package Medium = Water) annotation (Placement(transformation(extent={{-130,44},{-110,64}}))); + .ThermofluidStream.Utilities.Icons.DLRLogo dLRLogo annotation (Placement(transformation(extent={{162,-118},{218,-62}}))); + .Modelica.Blocks.Sources.Trapezoid trapezoid(period = 5,offset = 1,amplitude = 0.5,rising = 0.5,falling = 0.5,width = 1.0) annotation(Placement(transformation(extent = {{-208,-80},{-188,-60}},origin = {0,0},rotation = 0))); + .Modelica.Mechanics.Rotational.Sources.Torque torque annotation(Placement(transformation(extent = {{-166,-78},{-146,-58}},origin = {0,0},rotation = 0))); +equation + connect(fixedTemperature.port, conductionElement.heatPort) annotation (Line(points={{-60,80},{-50,80},{-50,64}}, color={191,0,0})); + connect(switchConnector.fore, piston.port_left) + annotation (Line( + points={{70,24},{70,-57.4},{80,-57.4}}, + color={28,108,200}, + thickness=0.5)); + connect(switchConnector1.fore, piston.port_right) + annotation (Line( + points={{50,44},{50,-44},{20,-44},{20,-57.4}}, + color={28,108,200}, + thickness=0.5)); + connect(flowResistance3.outlet, switchConnector1.inlet) + annotation (Line( + points={{30,54},{40,54}}, + color={28,108,200}, + thickness=0.5)); + connect(flowResistance4.outlet,switchConnector. inlet) + annotation (Line( + points={{18,34},{60,34}}, + color={28,108,200}, + thickness=0.5)); + connect(flowResistance5.inlet,switchConnector1. outlet) annotation (Line( + points={{70,54},{60,54}}, + color={28,108,200}, + thickness=0.5)); + connect(flowResistance6.inlet,switchConnector. outlet) annotation (Line( + points={{88,34},{80,34}}, + color={28,108,200}, + thickness=0.5)); + connect(tanValve.inlet,flowResistance5. outlet) annotation (Line( + points={{100,54},{90,54}}, + color={28,108,200}, + thickness=0.5)); + connect(tanValve1.inlet,flowResistance6. outlet) annotation (Line( + points={{120,34},{108,34}}, + color={28,108,200}, + thickness=0.5)); + connect(junctionT2_1.inletB,tanValve. outlet) annotation (Line( + points={{140,54},{120,54}}, + color={28,108,200}, + thickness=0.5)); + connect(tanValve1.outlet,junctionT2_1. inletA) annotation (Line( + points={{140,34},{150,34},{150,44}}, + color={28,108,200}, + thickness=0.5)); + connect(switch.outletA, flowResistance3.inlet) annotation (Line( + points={{0,54},{10,54}}, + color={28,108,200}, + thickness=0.5)); + connect(switch.outletB, flowResistance4.inlet) + annotation (Line( + points={{-10,44},{-10,34},{-2,34}}, + color={28,108,200}, + thickness=0.5)); + connect(crankDrive.h_out, booleanToReal.u) annotation (Line(points={{-88,-38},{-88,-16},{-79.6,-16}}, color={255,0,255})); + connect(steamSink.inlet, junctionT2_1.outlet) annotation (Line( + points={{190,80},{190,54},{160,54}}, + color={28,108,200}, + thickness=0.5)); + connect(booleanToReal.y, firstOrder.u) annotation (Line(points={{-61.2,-16},{-49.6,-16}}, + color={0,0,127})); + connect(firstOrder.y, tanValve.u) annotation (Line(points={{-31.2,-16},{-24,-16},{-24,14},{110,14},{110,46}}, + color={0,0,127})); + connect(boiler.outlet, conductionElement.inlet) annotation (Line( + points={{-80,54},{-60,54}}, + color={28,108,200}, + thickness=0.5)); + connect(realExpression1.y, PI1.u_s) annotation (Line(points={{-159,34},{-152,34}}, color={0,0,127})); + connect(heating_element.port, boiler.heatPort) annotation (Line(points={{-100,34},{-90,34},{-90,46}}, color={191,0,0})); + connect(singleSensorSelect.inlet, conductionElement.inlet) + annotation (Line( + points={{-86,16},{-70,16},{-70,54},{-60,54}}, + color={28,108,200}, + thickness=0.5)); + connect(singleSensorSelect.value_out, PI1.u_m) annotation (Line(points={{-104.2,16},{-140,16},{-140,22}}, color={0,0,127})); + connect(heating_element.Q_flow, PI1.y) annotation (Line(points={{-120,34},{-129,34}}, color={0,0,127})); + connect(terminalSource.outlet, boiler.inlet) annotation (Line( + points={{-110,54},{-100,54}}, + color={28,108,200}, + thickness=0.5)); + connect(switch.inlet, conductionElement.outlet) annotation (Line( + points={{-20,54},{-40,54}}, + color={28,108,200}, + thickness=0.5)); + connect(switch.u, tanValve.u) annotation (Line(points={{-10,66},{-10,74},{-24,74},{-24,14},{110,14},{110,46}}, color={0,0,127})); + connect(tanValve1.u, tanValve.u) annotation (Line(points={{130,42},{130,48},{122,48},{122,40},{110,40},{110,46}}, color={0,0,127})); + connect(crankDrive.flange_b, piston.flange) annotation (Line(points={{2,-68},{2,-70},{20,-70}}, color={0,127,0})); + connect(trapezoid.y,torque.tau) annotation(Line(points = {{-187,-70},{-177.5,-70},{-177.5,-68},{-168,-68}},color = {0,0,127})); + connect(torque.flange,crankDrive.flange_a) annotation(Line(points = {{-146,-68},{-88,-68}},color = {0,0,0})); + annotation ( + Icon(coordinateSystem(extent={{-100,-100},{100,100}})), + Diagram( + coordinateSystem(preserveAspectRatio=false, extent={{-220,-120},{220,120}}), + graphics={ + Rectangle(extent={{-192,96},{-38,6}}, lineColor={28,108,200}), + Text( + extent={{-188,94},{-96,82}}, + textColor={28,108,200}, + textString="Boiler and Preheater"), + Rectangle(extent={{-30,80},{168,20}}, lineColor={28,108,200}), + Text( + extent={{118,78},{180,66}}, + textColor={28,108,200}, + textString="Valves"), + Text( + extent={{-8,-82},{86,-100}}, + textColor={28,108,200}, + textString="Piston and Crank Drive"), + Rectangle( + extent={{-118,-32},{90,-100}}, + lineColor={28,108,200})}), + experiment(StopTime=25, Tolerance=1e-6, Interval=0.025), + Documentation(info=" +

Basic model of a steam engine. STEAM AND POWER!

+


Owner: Michael Meißner

+")); +end SimpleEngine; diff --git a/Examples/package.mo b/Examples/package.mo new file mode 100644 index 00000000..b0d434e4 --- /dev/null +++ b/Examples/package.mo @@ -0,0 +1,3 @@ +package Examples extends .Modelica.Icons.Package; + annotation(uses(Modelica(version = "4.0.0"),ThermofluidStream(version = "1.2.0"))); +end Examples; \ No newline at end of file diff --git a/Examples/package.order b/Examples/package.order new file mode 100644 index 00000000..620198cc --- /dev/null +++ b/Examples/package.order @@ -0,0 +1,2 @@ +SimpleEngine +FromScratch \ No newline at end of file diff --git a/Resources/ExperimentDefinitions/Examples/SimpleEngine/Metadata.json b/Resources/ExperimentDefinitions/Examples/SimpleEngine/Metadata.json new file mode 100644 index 00000000..fb9e14a4 --- /dev/null +++ b/Resources/ExperimentDefinitions/Examples/SimpleEngine/Metadata.json @@ -0,0 +1,3 @@ +{ + "defaultExperimentId" : "63c8046d-bf3b-4a82-98f6-09a6e1538f3f" +} \ No newline at end of file diff --git a/Resources/ExperimentDefinitions/Examples/SimpleEngine/experiment_1.json b/Resources/ExperimentDefinitions/Examples/SimpleEngine/experiment_1.json new file mode 100644 index 00000000..97b39bae --- /dev/null +++ b/Resources/ExperimentDefinitions/Examples/SimpleEngine/experiment_1.json @@ -0,0 +1,54 @@ +{ + "version" : "2", + "id" : "63c8046d-bf3b-4a82-98f6-09a6e1538f3f", + "experiment" : { + "base" : { + "analysis" : { + "variableFilters" : [ ], + "selectedType" : "dynamic", + "choices" : [ { + "type" : "dynamic", + "parameters" : { + "final_time" : 25, + "start_time" : 0 + }, + "simulationOptions" : { + "dynamic_diagnostics" : false, + "ncp" : 1000 + }, + "solverOptions" : { + "store_event_points" : true + }, + "compilerOptions" : { + "generate_html_diagnostics" : false, + "include_protected_variables" : false + }, + "runtimeOptions" : { } + } ], + "expansion" : { + "discreteAlgorithm" : { + "noOfSamples" : 0, + "seed" : 0 + }, + "continuousAlgorithm" : { + "type" : "SOBOL", + "noOfSamples" : 10, + "seed" : 0 + } + } + }, + "modifiers" : { + "initializeFrom" : "", + "variables" : [ { + "name" : "trapezoid.amplitude", + "expression" : "1.5" + } ] + } + } + }, + "metadata" : { + "created" : "2025-04-11 19:08:57.530155954", + "lastModified" : "2025-04-11T19:23:43.797062860Z", + "name" : "Experiment 1" + } +} \ No newline at end of file diff --git a/Resources/ExperimentDefinitions/ThermofluidStream/Examples/SimpleAirCycle/Metadata.json b/Resources/ExperimentDefinitions/ThermofluidStream/Examples/SimpleAirCycle/Metadata.json new file mode 100644 index 00000000..8e9f2a5f --- /dev/null +++ b/Resources/ExperimentDefinitions/ThermofluidStream/Examples/SimpleAirCycle/Metadata.json @@ -0,0 +1,3 @@ +{ + "defaultExperimentId" : "3435f49e-4efc-4211-902d-7551cfe0956b" +} \ No newline at end of file diff --git a/Resources/ExperimentDefinitions/ThermofluidStream/Examples/SimpleAirCycle/experiment_1.json b/Resources/ExperimentDefinitions/ThermofluidStream/Examples/SimpleAirCycle/experiment_1.json new file mode 100644 index 00000000..521243c2 --- /dev/null +++ b/Resources/ExperimentDefinitions/ThermofluidStream/Examples/SimpleAirCycle/experiment_1.json @@ -0,0 +1,51 @@ +{ + "version" : "2", + "id" : "3435f49e-4efc-4211-902d-7551cfe0956b", + "experiment" : { + "base" : { + "analysis" : { + "variableFilters" : [ ], + "selectedType" : "dynamic", + "choices" : [ { + "type" : "dynamic", + "parameters" : { + "final_time" : 100, + "interval" : 0.1, + "start_time" : 0 + }, + "simulationOptions" : { + "dynamic_diagnostics" : false + }, + "solverOptions" : { + "store_event_points" : true + }, + "compilerOptions" : { + "generate_html_diagnostics" : false, + "include_protected_variables" : false + }, + "runtimeOptions" : { } + } ], + "expansion" : { + "discreteAlgorithm" : { + "noOfSamples" : 0, + "seed" : 0 + }, + "continuousAlgorithm" : { + "type" : "SOBOL", + "noOfSamples" : 10, + "seed" : 0 + } + } + }, + "modifiers" : { + "initializeFrom" : "", + "variables" : [ ] + } + } + }, + "metadata" : { + "created" : "2025-04-11 19:31:25.054729864", + "lastModified" : "2025-04-11 19:31:25.054729864", + "name" : "Experiment 1" + } +} \ No newline at end of file diff --git a/Resources/ExperimentDefinitions/ThermofluidStream/Examples/SimpleStream/Metadata.json b/Resources/ExperimentDefinitions/ThermofluidStream/Examples/SimpleStream/Metadata.json new file mode 100644 index 00000000..700f7ed1 --- /dev/null +++ b/Resources/ExperimentDefinitions/ThermofluidStream/Examples/SimpleStream/Metadata.json @@ -0,0 +1,3 @@ +{ + "defaultExperimentId" : "96d0f1d2-cfc8-4b88-93f9-3158adffc5d6" +} \ No newline at end of file diff --git a/Resources/ExperimentDefinitions/ThermofluidStream/Examples/SimpleStream/experiment_1.json b/Resources/ExperimentDefinitions/ThermofluidStream/Examples/SimpleStream/experiment_1.json new file mode 100644 index 00000000..9ad4fdf7 --- /dev/null +++ b/Resources/ExperimentDefinitions/ThermofluidStream/Examples/SimpleStream/experiment_1.json @@ -0,0 +1,52 @@ +{ + "version" : "2", + "id" : "96d0f1d2-cfc8-4b88-93f9-3158adffc5d6", + "experiment" : { + "base" : { + "analysis" : { + "variableFilters" : [ ], + "selectedType" : "dynamic", + "choices" : [ { + "type" : "dynamic", + "parameters" : { + "final_time" : 100, + "interval" : 0.1, + "start_time" : 0 + }, + "simulationOptions" : { + "dynamic_diagnostics" : false, + "solver" : "CVode" + }, + "solverOptions" : { + "store_event_points" : true + }, + "compilerOptions" : { + "generate_html_diagnostics" : false, + "include_protected_variables" : false + }, + "runtimeOptions" : { } + } ], + "expansion" : { + "discreteAlgorithm" : { + "noOfSamples" : 0, + "seed" : 0 + }, + "continuousAlgorithm" : { + "type" : "SOBOL", + "noOfSamples" : 10, + "seed" : 0 + } + } + }, + "modifiers" : { + "initializeFrom" : "", + "variables" : [ ] + } + } + }, + "metadata" : { + "created" : "2025-04-11 19:30:49.453540583", + "lastModified" : "2025-04-11 19:30:49.453540583", + "name" : "Experiment 1" + } +} \ No newline at end of file diff --git a/Resources/Views/Examples/SimpleEngine/impact-analysis-dashboard-view-1984.json b/Resources/Views/Examples/SimpleEngine/impact-analysis-dashboard-view-1984.json new file mode 100644 index 00000000..bb64c30d --- /dev/null +++ b/Resources/Views/Examples/SimpleEngine/impact-analysis-dashboard-view-1984.json @@ -0,0 +1,16 @@ +{ + "stickies" : [ ], + "stickyPositions" : [ ], + "plots" : [ ], + "globalConfig" : { + "plot" : { + "common" : { + "showTitle" : true, + "colorMode" : "variable" + } + }, + "experiment" : { } + }, + "version" : "1", + "name" : "impact-analysis-dashboard-view-1984" +} \ No newline at end of file diff --git a/Resources/Views/ThermofluidStream/Examples/SimpleAirCycle/impact-analysis-dashboard-view-1984.json b/Resources/Views/ThermofluidStream/Examples/SimpleAirCycle/impact-analysis-dashboard-view-1984.json new file mode 100644 index 00000000..bb64c30d --- /dev/null +++ b/Resources/Views/ThermofluidStream/Examples/SimpleAirCycle/impact-analysis-dashboard-view-1984.json @@ -0,0 +1,16 @@ +{ + "stickies" : [ ], + "stickyPositions" : [ ], + "plots" : [ ], + "globalConfig" : { + "plot" : { + "common" : { + "showTitle" : true, + "colorMode" : "variable" + } + }, + "experiment" : { } + }, + "version" : "1", + "name" : "impact-analysis-dashboard-view-1984" +} \ No newline at end of file diff --git a/ThermofluidStream/HeatExchangers/Internal/PartialNTU.mo b/ThermofluidStream/HeatExchangers/Internal/PartialNTU.mo index 3fe56017..874b2f95 100644 --- a/ThermofluidStream/HeatExchangers/Internal/PartialNTU.mo +++ b/ThermofluidStream/HeatExchangers/Internal/PartialNTU.mo @@ -64,8 +64,8 @@ partial model PartialNTU "Partial heat exchanger model using the epsilon-NTU met ThermofluidStream.HeatExchangers.Internal.DiscretizedHEXSummary summary "Summary record of quantities"; -protected parameter Boolean crossFlow=false "Selection whether HEX is in crossflow or counterflow configuration"; +protected Modelica.Units.SI.Pressure p_A=MediumA.pressure(inletA.state) "Inlet A pressure"; Modelica.Units.SI.Pressure p_B=MediumB.pressure(inletB.state) "Inlet B pressure"; From b345fdbdfd7305af386bc5aaf84fea825f5bbfcc Mon Sep 17 00:00:00 2001 From: Hubertus Tummescheit Date: Mon, 14 Apr 2025 19:58:42 +0000 Subject: [PATCH 3/8] Minro refactoring to work around missing conditional IconTransformation in Modelon Impact: Library now fully compatible (again) with Modelon Impact --- .../Examples/ReverseHeatPump/Metadata.json | 3 + .../ReverseHeatPump/experiment_1.json | 52 ++++ .../Tests/CounterFlowNTU/Metadata.json | 3 + .../Tests/CounterFlowNTU/experiment_1.json | 52 ++++ .../impact-analysis-dashboard-view-1984.json | 16 ++ .../impact-analysis-dashboard-view-1984.json | 16 ++ .../impact-analysis-dashboard-view-1984.json | 16 ++ .../impact-analysis-dashboard-view-1984.json | 16 ++ .../impact-analysis-dashboard-view-1984.json | 16 ++ .../HeatExchangers/CounterFlowNTU.mo | 2 +- .../HeatExchangers/CrossFlowNTU.mo | 2 +- .../DiscretizedCounterFlowHEX.mo | 2 +- .../DiscretizedCounterFlowHEX_FR.mo | 2 +- .../HeatExchangers/DiscretizedCrossFlowHEX.mo | 2 +- .../DiscretizedCrossFlowHEX_FR.mo | 2 +- .../Internal/PartialCounterFlowInterface.mo | 31 +++ .../Internal/PartialCrossFlowInterface.mo | 31 +++ .../PartialDiscretizedHEXCounterFlow.mo | 183 ++++++++++++++ ...X.mo => PartialDiscretizedHEXCrossFlow.mo} | 12 +- ...PartialNTU.mo => PartialNTUCounterFlow.mo} | 17 +- .../Internal/PartialNTUCrossFlow.mo | 237 ++++++++++++++++++ .../HeatExchangers/Internal/package.order | 8 +- .../HeatExchangers/package.order | 2 +- 23 files changed, 700 insertions(+), 23 deletions(-) create mode 100644 Resources/ExperimentDefinitions/ThermofluidStream/Examples/ReverseHeatPump/Metadata.json create mode 100644 Resources/ExperimentDefinitions/ThermofluidStream/Examples/ReverseHeatPump/experiment_1.json create mode 100644 Resources/ExperimentDefinitions/ThermofluidStream/HeatExchangers/Tests/CounterFlowNTU/Metadata.json create mode 100644 Resources/ExperimentDefinitions/ThermofluidStream/HeatExchangers/Tests/CounterFlowNTU/experiment_1.json create mode 100644 Resources/Views/ThermofluidStream/HeatExchangers/Internal/PartialCounterFlowInterface/impact-analysis-dashboard-view-1984.json create mode 100644 Resources/Views/ThermofluidStream/HeatExchangers/Internal/PartialCrossFlowInterface/impact-analysis-dashboard-view-1984.json create mode 100644 Resources/Views/ThermofluidStream/HeatExchangers/Internal/PartialDiscretizedHEXCounterFlow/impact-analysis-dashboard-view-1984.json create mode 100644 Resources/Views/ThermofluidStream/HeatExchangers/Internal/PartialDiscretizedHEXCrossFlow/impact-analysis-dashboard-view-1984.json create mode 100644 Resources/Views/ThermofluidStream/HeatExchangers/Internal/PartialNTUCounterFlow/impact-analysis-dashboard-view-1984.json create mode 100644 ThermofluidStream/HeatExchangers/Internal/PartialCounterFlowInterface.mo create mode 100644 ThermofluidStream/HeatExchangers/Internal/PartialCrossFlowInterface.mo create mode 100644 ThermofluidStream/HeatExchangers/Internal/PartialDiscretizedHEXCounterFlow.mo rename ThermofluidStream/HeatExchangers/Internal/{PartialDiscretizedHEX.mo => PartialDiscretizedHEXCrossFlow.mo} (94%) rename ThermofluidStream/HeatExchangers/Internal/{PartialNTU.mo => PartialNTUCounterFlow.mo} (92%) create mode 100644 ThermofluidStream/HeatExchangers/Internal/PartialNTUCrossFlow.mo diff --git a/Resources/ExperimentDefinitions/ThermofluidStream/Examples/ReverseHeatPump/Metadata.json b/Resources/ExperimentDefinitions/ThermofluidStream/Examples/ReverseHeatPump/Metadata.json new file mode 100644 index 00000000..0d9c9d31 --- /dev/null +++ b/Resources/ExperimentDefinitions/ThermofluidStream/Examples/ReverseHeatPump/Metadata.json @@ -0,0 +1,3 @@ +{ + "defaultExperimentId" : "6914ee4f-64ba-491e-a8cc-7fac464d5f52" +} \ No newline at end of file diff --git a/Resources/ExperimentDefinitions/ThermofluidStream/Examples/ReverseHeatPump/experiment_1.json b/Resources/ExperimentDefinitions/ThermofluidStream/Examples/ReverseHeatPump/experiment_1.json new file mode 100644 index 00000000..1f170cb3 --- /dev/null +++ b/Resources/ExperimentDefinitions/ThermofluidStream/Examples/ReverseHeatPump/experiment_1.json @@ -0,0 +1,52 @@ +{ + "version" : "2", + "id" : "6914ee4f-64ba-491e-a8cc-7fac464d5f52", + "experiment" : { + "base" : { + "analysis" : { + "variableFilters" : [ ], + "selectedType" : "dynamic", + "choices" : [ { + "type" : "dynamic", + "parameters" : { + "final_time" : 200, + "interval" : 0.2, + "start_time" : 0 + }, + "simulationOptions" : { + "dynamic_diagnostics" : false, + "solver" : "CVode" + }, + "solverOptions" : { + "store_event_points" : true + }, + "compilerOptions" : { + "generate_html_diagnostics" : false, + "include_protected_variables" : false + }, + "runtimeOptions" : { } + } ], + "expansion" : { + "discreteAlgorithm" : { + "noOfSamples" : 0, + "seed" : 0 + }, + "continuousAlgorithm" : { + "type" : "SOBOL", + "noOfSamples" : 10, + "seed" : 0 + } + } + }, + "modifiers" : { + "initializeFrom" : "", + "variables" : [ ] + } + } + }, + "metadata" : { + "created" : "2025-04-14 19:57:36.616287852", + "lastModified" : "2025-04-14 19:57:36.616287852", + "name" : "Experiment 1" + } +} \ No newline at end of file diff --git a/Resources/ExperimentDefinitions/ThermofluidStream/HeatExchangers/Tests/CounterFlowNTU/Metadata.json b/Resources/ExperimentDefinitions/ThermofluidStream/HeatExchangers/Tests/CounterFlowNTU/Metadata.json new file mode 100644 index 00000000..9d91fe87 --- /dev/null +++ b/Resources/ExperimentDefinitions/ThermofluidStream/HeatExchangers/Tests/CounterFlowNTU/Metadata.json @@ -0,0 +1,3 @@ +{ + "defaultExperimentId" : "ba7c1233-77e4-4111-8ed0-ca9e33a7bf17" +} \ No newline at end of file diff --git a/Resources/ExperimentDefinitions/ThermofluidStream/HeatExchangers/Tests/CounterFlowNTU/experiment_1.json b/Resources/ExperimentDefinitions/ThermofluidStream/HeatExchangers/Tests/CounterFlowNTU/experiment_1.json new file mode 100644 index 00000000..955e7530 --- /dev/null +++ b/Resources/ExperimentDefinitions/ThermofluidStream/HeatExchangers/Tests/CounterFlowNTU/experiment_1.json @@ -0,0 +1,52 @@ +{ + "version" : "2", + "id" : "ba7c1233-77e4-4111-8ed0-ca9e33a7bf17", + "experiment" : { + "base" : { + "analysis" : { + "variableFilters" : [ ], + "selectedType" : "dynamic", + "choices" : [ { + "type" : "dynamic", + "parameters" : { + "final_time" : 100, + "interval" : 0.1, + "start_time" : 0 + }, + "simulationOptions" : { + "dynamic_diagnostics" : false, + "solver" : "CVode" + }, + "solverOptions" : { + "store_event_points" : true + }, + "compilerOptions" : { + "generate_html_diagnostics" : false, + "include_protected_variables" : false + }, + "runtimeOptions" : { } + } ], + "expansion" : { + "discreteAlgorithm" : { + "noOfSamples" : 0, + "seed" : 0 + }, + "continuousAlgorithm" : { + "type" : "SOBOL", + "noOfSamples" : 10, + "seed" : 0 + } + } + }, + "modifiers" : { + "initializeFrom" : "", + "variables" : [ ] + } + } + }, + "metadata" : { + "created" : "2025-04-14 18:39:36.186597856", + "lastModified" : "2025-04-14 18:39:36.186597856", + "name" : "Experiment 1" + } +} \ No newline at end of file diff --git a/Resources/Views/ThermofluidStream/HeatExchangers/Internal/PartialCounterFlowInterface/impact-analysis-dashboard-view-1984.json b/Resources/Views/ThermofluidStream/HeatExchangers/Internal/PartialCounterFlowInterface/impact-analysis-dashboard-view-1984.json new file mode 100644 index 00000000..bb64c30d --- /dev/null +++ b/Resources/Views/ThermofluidStream/HeatExchangers/Internal/PartialCounterFlowInterface/impact-analysis-dashboard-view-1984.json @@ -0,0 +1,16 @@ +{ + "stickies" : [ ], + "stickyPositions" : [ ], + "plots" : [ ], + "globalConfig" : { + "plot" : { + "common" : { + "showTitle" : true, + "colorMode" : "variable" + } + }, + "experiment" : { } + }, + "version" : "1", + "name" : "impact-analysis-dashboard-view-1984" +} \ No newline at end of file diff --git a/Resources/Views/ThermofluidStream/HeatExchangers/Internal/PartialCrossFlowInterface/impact-analysis-dashboard-view-1984.json b/Resources/Views/ThermofluidStream/HeatExchangers/Internal/PartialCrossFlowInterface/impact-analysis-dashboard-view-1984.json new file mode 100644 index 00000000..bb64c30d --- /dev/null +++ b/Resources/Views/ThermofluidStream/HeatExchangers/Internal/PartialCrossFlowInterface/impact-analysis-dashboard-view-1984.json @@ -0,0 +1,16 @@ +{ + "stickies" : [ ], + "stickyPositions" : [ ], + "plots" : [ ], + "globalConfig" : { + "plot" : { + "common" : { + "showTitle" : true, + "colorMode" : "variable" + } + }, + "experiment" : { } + }, + "version" : "1", + "name" : "impact-analysis-dashboard-view-1984" +} \ No newline at end of file diff --git a/Resources/Views/ThermofluidStream/HeatExchangers/Internal/PartialDiscretizedHEXCounterFlow/impact-analysis-dashboard-view-1984.json b/Resources/Views/ThermofluidStream/HeatExchangers/Internal/PartialDiscretizedHEXCounterFlow/impact-analysis-dashboard-view-1984.json new file mode 100644 index 00000000..bb64c30d --- /dev/null +++ b/Resources/Views/ThermofluidStream/HeatExchangers/Internal/PartialDiscretizedHEXCounterFlow/impact-analysis-dashboard-view-1984.json @@ -0,0 +1,16 @@ +{ + "stickies" : [ ], + "stickyPositions" : [ ], + "plots" : [ ], + "globalConfig" : { + "plot" : { + "common" : { + "showTitle" : true, + "colorMode" : "variable" + } + }, + "experiment" : { } + }, + "version" : "1", + "name" : "impact-analysis-dashboard-view-1984" +} \ No newline at end of file diff --git a/Resources/Views/ThermofluidStream/HeatExchangers/Internal/PartialDiscretizedHEXCrossFlow/impact-analysis-dashboard-view-1984.json b/Resources/Views/ThermofluidStream/HeatExchangers/Internal/PartialDiscretizedHEXCrossFlow/impact-analysis-dashboard-view-1984.json new file mode 100644 index 00000000..bb64c30d --- /dev/null +++ b/Resources/Views/ThermofluidStream/HeatExchangers/Internal/PartialDiscretizedHEXCrossFlow/impact-analysis-dashboard-view-1984.json @@ -0,0 +1,16 @@ +{ + "stickies" : [ ], + "stickyPositions" : [ ], + "plots" : [ ], + "globalConfig" : { + "plot" : { + "common" : { + "showTitle" : true, + "colorMode" : "variable" + } + }, + "experiment" : { } + }, + "version" : "1", + "name" : "impact-analysis-dashboard-view-1984" +} \ No newline at end of file diff --git a/Resources/Views/ThermofluidStream/HeatExchangers/Internal/PartialNTUCounterFlow/impact-analysis-dashboard-view-1984.json b/Resources/Views/ThermofluidStream/HeatExchangers/Internal/PartialNTUCounterFlow/impact-analysis-dashboard-view-1984.json new file mode 100644 index 00000000..bb64c30d --- /dev/null +++ b/Resources/Views/ThermofluidStream/HeatExchangers/Internal/PartialNTUCounterFlow/impact-analysis-dashboard-view-1984.json @@ -0,0 +1,16 @@ +{ + "stickies" : [ ], + "stickyPositions" : [ ], + "plots" : [ ], + "globalConfig" : { + "plot" : { + "common" : { + "showTitle" : true, + "colorMode" : "variable" + } + }, + "experiment" : { } + }, + "version" : "1", + "name" : "impact-analysis-dashboard-view-1984" +} \ No newline at end of file diff --git a/ThermofluidStream/HeatExchangers/CounterFlowNTU.mo b/ThermofluidStream/HeatExchangers/CounterFlowNTU.mo index 8384f2db..40d73d95 100644 --- a/ThermofluidStream/HeatExchangers/CounterFlowNTU.mo +++ b/ThermofluidStream/HeatExchangers/CounterFlowNTU.mo @@ -1,7 +1,7 @@ within ThermofluidStream.HeatExchangers; model CounterFlowNTU "Counter flow heat exchanger using the epsilon-NTU method" - extends ThermofluidStream.HeatExchangers.Internal.PartialNTU; + extends ThermofluidStream.HeatExchangers.Internal.PartialNTUCounterFlow; equation //Calculating heat exchanger effectiveness derived from NTU correlations (see VDI Waermeatlas) diff --git a/ThermofluidStream/HeatExchangers/CrossFlowNTU.mo b/ThermofluidStream/HeatExchangers/CrossFlowNTU.mo index 4bf8cc68..e180c7ed 100644 --- a/ThermofluidStream/HeatExchangers/CrossFlowNTU.mo +++ b/ThermofluidStream/HeatExchangers/CrossFlowNTU.mo @@ -1,7 +1,7 @@ within ThermofluidStream.HeatExchangers; model CrossFlowNTU "Cross flow heat exchanger using the epsilon-NTU method" - extends ThermofluidStream.HeatExchangers.Internal.PartialNTU(crossFlow=true); + extends ThermofluidStream.HeatExchangers.Internal.PartialNTUCrossFlow(crossFlow=true); equation //Calculating heat exchanger effectiveness derived from NTU correlations (see VDI Waermeatlas) diff --git a/ThermofluidStream/HeatExchangers/DiscretizedCounterFlowHEX.mo b/ThermofluidStream/HeatExchangers/DiscretizedCounterFlowHEX.mo index e622fc72..8d7193e3 100644 --- a/ThermofluidStream/HeatExchangers/DiscretizedCounterFlowHEX.mo +++ b/ThermofluidStream/HeatExchangers/DiscretizedCounterFlowHEX.mo @@ -1,7 +1,7 @@ within ThermofluidStream.HeatExchangers; model DiscretizedCounterFlowHEX "Discretized heat exchanger for single- or two-phase working fluids without pressure drop" - extends Internal.PartialDiscretizedHEX; + extends Internal.PartialDiscretizedHEXCounterFlow; initial equation if initializeMassFlow then diff --git a/ThermofluidStream/HeatExchangers/DiscretizedCounterFlowHEX_FR.mo b/ThermofluidStream/HeatExchangers/DiscretizedCounterFlowHEX_FR.mo index 7e202695..4d6bb8de 100644 --- a/ThermofluidStream/HeatExchangers/DiscretizedCounterFlowHEX_FR.mo +++ b/ThermofluidStream/HeatExchangers/DiscretizedCounterFlowHEX_FR.mo @@ -1,7 +1,7 @@ within ThermofluidStream.HeatExchangers; model DiscretizedCounterFlowHEX_FR "Discretized Heat Exchanger for single- or two-phase working fluid with pressure drop" - extends Internal.PartialDiscretizedHEX; + extends Internal.PartialDiscretizedHEXCrossFlow; parameter Real k1_A=1e2 "Linear flow resistance coefficient at side A" annotation (Dialog(group="Flow resistance coefficients")); diff --git a/ThermofluidStream/HeatExchangers/DiscretizedCrossFlowHEX.mo b/ThermofluidStream/HeatExchangers/DiscretizedCrossFlowHEX.mo index fa6a3804..9e536f92 100644 --- a/ThermofluidStream/HeatExchangers/DiscretizedCrossFlowHEX.mo +++ b/ThermofluidStream/HeatExchangers/DiscretizedCrossFlowHEX.mo @@ -1,7 +1,7 @@ within ThermofluidStream.HeatExchangers; model DiscretizedCrossFlowHEX "Discretized heat exchanger for single- or two-phase working fluid without pressure drop" - extends Internal.PartialDiscretizedHEX(nCellsParallel=nCells,crossFlow=true); + extends Internal.PartialDiscretizedHEXCrossFlow(nCellsParallel=nCells,crossFlow=true); Processes.FlowResistance flowResistanceA[nCells]( redeclare package Medium = MediumA, diff --git a/ThermofluidStream/HeatExchangers/DiscretizedCrossFlowHEX_FR.mo b/ThermofluidStream/HeatExchangers/DiscretizedCrossFlowHEX_FR.mo index e2867610..2714af04 100644 --- a/ThermofluidStream/HeatExchangers/DiscretizedCrossFlowHEX_FR.mo +++ b/ThermofluidStream/HeatExchangers/DiscretizedCrossFlowHEX_FR.mo @@ -1,7 +1,7 @@ within ThermofluidStream.HeatExchangers; model DiscretizedCrossFlowHEX_FR "Discretized Heat Exchanger for single- or two-phase working fluid with pressure drop" - extends Internal.PartialDiscretizedHEX(nCellsParallel=nCells,crossFlow=true); + extends Internal.PartialDiscretizedHEXCrossFlow(nCellsParallel=nCells,crossFlow=true); parameter Real k1_A=1e2 "Linear flow resistance coefficient at side A" annotation (Dialog(group="Flow resistance coefficients")); diff --git a/ThermofluidStream/HeatExchangers/Internal/PartialCounterFlowInterface.mo b/ThermofluidStream/HeatExchangers/Internal/PartialCounterFlowInterface.mo new file mode 100644 index 00000000..48eed13a --- /dev/null +++ b/ThermofluidStream/HeatExchangers/Internal/PartialCounterFlowInterface.mo @@ -0,0 +1,31 @@ +within ThermofluidStream.HeatExchangers.Internal; + +partial model PartialCounterFlowInterface "Partial heat exchanger icon and connectors for cross flow" + +replaceable package MediumA = ThermofluidStream.Media.myMedia.Interfaces.PartialMedium "Medium model A" + annotation (choicesAllMatching=true); + replaceable package MediumB = ThermofluidStream.Media.myMedia.Interfaces.PartialMedium "Medium model B" + annotation (choicesAllMatching=true); + + .ThermofluidStream.Interfaces.Inlet inletA(redeclare package Medium = MediumA) annotation (Placement(transformation( + extent={{-20,-20},{20,20}}, + rotation=0, + origin={-100,-60}), iconTransformation(extent={{-120,-80},{-80,-40}}))); + .ThermofluidStream.Interfaces.Outlet outletA(redeclare package Medium = MediumA) annotation (Placement(transformation( + extent={{-20,-20},{20,20}}, + rotation=0, + origin={100,-60}), iconTransformation(extent={{80,-80},{120,-40}}))); + .ThermofluidStream.Interfaces.Inlet inletB(redeclare package Medium = MediumB) annotation (Placement(transformation( + extent={{20,-20},{-20,20}}, + rotation=0, + origin={100,60}), iconTransformation(extent={{120,80},{80,40}}))); + .ThermofluidStream.Interfaces.Outlet outletB(redeclare package Medium = MediumB) annotation (Placement(transformation( + extent={{20,-20},{-20,20}}, + rotation=0, + origin={-100,60}), iconTransformation(extent={{-80,80},{-120,40}}))); + + annotation (Documentation(info=" +

+This is the partial parent class for all heat exchangers in counter flow configuration. +")); +end PartialCounterFlowInterface; diff --git a/ThermofluidStream/HeatExchangers/Internal/PartialCrossFlowInterface.mo b/ThermofluidStream/HeatExchangers/Internal/PartialCrossFlowInterface.mo new file mode 100644 index 00000000..8bdd40e2 --- /dev/null +++ b/ThermofluidStream/HeatExchangers/Internal/PartialCrossFlowInterface.mo @@ -0,0 +1,31 @@ +within ThermofluidStream.HeatExchangers.Internal; + +partial model PartialCrossFlowInterface "Partial heat exchanger icon and connectors for cross flow" + + replaceable package MediumA = ThermofluidStream.Media.myMedia.Interfaces.PartialMedium "Medium model A" + annotation (choicesAllMatching=true); + replaceable package MediumB = ThermofluidStream.Media.myMedia.Interfaces.PartialMedium "Medium model B" + annotation (choicesAllMatching=true); + + ThermofluidStream.Interfaces.Inlet inletA(redeclare package Medium = MediumA) annotation (Placement(transformation( + extent={{-20,-20},{20,20}}, + rotation=0, + origin={-100,-60}), iconTransformation(extent={{-120,-20},{-80,20}}))); + ThermofluidStream.Interfaces.Outlet outletA(redeclare package Medium = MediumA) annotation (Placement(transformation( + extent={{-20,-20},{20,20}}, + rotation=0, + origin={100,-60}), iconTransformation(extent= {{80,-20},{120,20}}))); + ThermofluidStream.Interfaces.Inlet inletB(redeclare package Medium = MediumB) annotation (Placement(transformation( + extent={{20,-20},{-20,20}}, + rotation=0, + origin={100,60}), iconTransformation(extent={{-120,-20},{-80,20}}, rotation=-90))); + ThermofluidStream.Interfaces.Outlet outletB(redeclare package Medium = MediumB) annotation (Placement(transformation( + extent={{20,-20},{-20,20}}, + rotation=0, + origin={-100,60}), iconTransformation(extent={{80,-20},{120,20}}, rotation=-90))); + + annotation (Documentation(info=" +

+This is the partial parent class for all heat exchangers cross flow configuration. +")); +end PartialCrossFlowInterface; diff --git a/ThermofluidStream/HeatExchangers/Internal/PartialDiscretizedHEXCounterFlow.mo b/ThermofluidStream/HeatExchangers/Internal/PartialDiscretizedHEXCounterFlow.mo new file mode 100644 index 00000000..d93d5b51 --- /dev/null +++ b/ThermofluidStream/HeatExchangers/Internal/PartialDiscretizedHEXCounterFlow.mo @@ -0,0 +1,183 @@ +within ThermofluidStream.HeatExchangers.Internal; + +partial model PartialDiscretizedHEXCounterFlow "Base class for discretized heat exchangers" + + extends .ThermofluidStream.Utilities.DropOfCommonsPlus; + extends .ThermofluidStream.HeatExchangers.Internal.DiscretizedHexIcon; + + replaceable package MediumA = .ThermofluidStream.Media.myMedia.Interfaces.PartialMedium "Medium model side A" + annotation (choicesAllMatching=true, Dialog(group="Medium definitions")); + replaceable package MediumB = .ThermofluidStream.Media.myMedia.Interfaces.PartialMedium "Medium model side B" + annotation (choicesAllMatching=true, Dialog(group="Medium definitions")); + replaceable model ConductionElementA = .ThermofluidStream.HeatExchangers.Internal.ConductionElementHEX + constrainedby .ThermofluidStream.HeatExchangers.Internal.PartialConductionElementHEX( + final nCellsParallel=nCellsParallel, + final A=A/nCells, + final V=V_Hex/nCells, + redeclare package Medium = MediumA, + final enforce_global_energy_conservation=enforce_global_energy_conservation) "Heat transfer element model for side A" annotation (choicesAllMatching=true, Dialog(group="Medium definitions")); + replaceable model ConductionElementB = .ThermofluidStream.HeatExchangers.Internal.ConductionElementHEX + constrainedby .ThermofluidStream.HeatExchangers.Internal.PartialConductionElementHEX( + final nCellsParallel=1, + final A=A/nCells, + final V=V_Hex/nCells, + redeclare package Medium = MediumB, + final enforce_global_energy_conservation=enforce_global_energy_conservation) "Heat transfer element model for side B" annotation (choicesAllMatching=true, Dialog(group="Medium definitions")); + + parameter Integer nCells=3 "Number of discretization elements"; + parameter Boolean calculate_efficiency=false "= true, if heat exchanger efficiency is calculated" + annotation(Evaluate=true, HideResult=true, choices(checkBox=true)); + + parameter .Modelica.Units.SI.Area A=10 "Heat transfer area" + annotation (Dialog(group="Heat transfer parameters")); + parameter .Modelica.Units.SI.Volume V_Hex=0.001 "Volume for heat transfer calculation" + annotation (Dialog(group="Heat transfer parameters")); + parameter .Modelica.Units.SI.CoefficientOfHeatTransfer k_wall=100 "Coefficient of heat transfer for pipe wall" + annotation (Dialog(group="Heat transfer parameters")); + + parameter Boolean initializeMassFlow=false "= true, if inlet mass flow rates are initialized" + annotation (Dialog(tab="Initialization", group="Mass flow rate"),Evaluate=true, HideResult=true, choices(checkBox=true)); + parameter .Modelica.Units.SI.MassFlowRate m_flow_0_A=0 "Initial mass flow rate for side A" + annotation (Dialog( + tab="Initialization", + group="Mass flow rate", + enable=initializeMassFlow)); + parameter .Modelica.Units.SI.MassFlowRate m_flow_0_B=0 "Initial mass flow rate for side B" + annotation (Dialog( + tab="Initialization", + group="Mass flow rate", + enable=initializeMassFlow)); + parameter .Modelica.Units.SI.MassFlowRate m_flow_assert(max=0) = -dropOfCommons.m_flow_reg "Assertion threshold for negative mass flow rate" + annotation (Dialog(tab="Advanced")); + parameter Boolean enforce_global_energy_conservation=false "= true, if global conservation of energy is enforced" + annotation (Dialog(tab="Advanced"),Evaluate=true, HideResult=true, choices(checkBox=true)); + + // ------ Parameter Display Configuration ------------------------ + parameter Boolean displayArea = true "= true, if heat transfer area A is displayed" + annotation(Dialog(tab="Layout",group="Display parameters",enable=displayParameters),Evaluate=true, HideResult=true, choices(checkBox=true)); + final parameter Boolean d1A = displayParameters and displayArea "displayArea at position 1" + annotation(Evaluate=true, HideResult=true); //d1A -> Display at position 1 A=Area + //----------------------------------------------------------------- + + .ThermofluidStream.Interfaces.Inlet inletB(redeclare package Medium = MediumB) + annotation (Placement(transformation(extent={{-120,40},{-80,80}}), iconTransformation(extent={{-120,40},{-80,80}}))); + .ThermofluidStream.Interfaces.Outlet outletB(redeclare package Medium = MediumB) + annotation (Placement(transformation(extent={{80,40},{120,80}}), iconTransformation(extent={{80,40},{120,80}}))); + .ThermofluidStream.Interfaces.Inlet inletA(redeclare package Medium = MediumA) + annotation (Placement(transformation(extent={{120,-80},{80,-40}}), iconTransformation(extent={{120,-80},{80,-40}}, rotation=0))); + .ThermofluidStream.Interfaces.Outlet outletA(redeclare package Medium = MediumA) + annotation (Placement(transformation(extent={{-80,-80},{-120,-40}}), iconTransformation(extent={{-80,-80},{-120,-40}}, rotation=0))); + + + .Modelica.Units.SI.HeatFlowRate Q_flow_A=sum(thermalElementA.heatPort.Q_flow) "Heat flow rate into medium A"; + .Modelica.Units.SI.HeatFlowRate Q_flow_B=sum(thermalElementB.heatPort.Q_flow) "Heat flow rate into medium B"; + .Modelica.Units.SI.Mass M_A=sum(thermalElementA.M) "Mass of medium A"; + .Modelica.Units.SI.Mass M_B=sum(thermalElementB.M) "Mass of medium B"; + .Modelica.Units.SI.Energy deltaE_system=sum(thermalElementA.deltaE_system) + sum(thermalElementB.deltaE_system) "Error in global conservation of energy"; + + + .ThermofluidStream.HeatExchangers.Internal.DiscretizedHEXSummary summary "Summary record of Quantities"; + +protected + parameter Boolean crossFlow=false "Selection whether HEX is in crossflow or counterflow configuration"; + parameter Integer nCellsParallel=1 "Number of discretization elements in parallel"; + parameter .Modelica.Units.SI.ThermalConductance G=k_wall*A "Wall thermal conductance" + annotation (Dialog(group="Wall parameters")); + function efficiency = .ThermofluidStream.HeatExchangers.Internal.calculateEfficiency (redeclare package MediumA = MediumA, redeclare package MediumB = MediumB) "Heat exchanger efficiency"; + +public + .Modelica.Thermal.HeatTransfer.Components.ThermalConductor thermalConductor[nCells](each G=G/nCells) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=90, + origin={0,0}))); + + ConductionElementB thermalElementB[nCells] annotation (Placement(transformation(extent={{-10,50},{10,70}}))); + ConductionElementA thermalElementA[nCells] annotation (Placement(transformation(extent={{10,-50},{-10,-70}}))); + +equation + assert( + inletB.m_flow > m_flow_assert, + "Negative mass flow rate at inlet B", + dropOfCommons.assertionLevel); + assert( + inletA.m_flow > m_flow_assert, + "Negative massflow at inlet A", + dropOfCommons.assertionLevel); + + //Summary record + summary.Tin_B = MediumB.temperature(inletB.state); + summary.Tin_A = MediumA.temperature(inletA.state); + summary.Tout_B = MediumB.temperature(outletB.state); + summary.Tout_A = MediumA.temperature(outletA.state); + summary.hin_B = MediumB.specificEnthalpy(inletB.state); + summary.hin_A = MediumA.specificEnthalpy(inletA.state); + summary.hout_B = MediumB.specificEnthalpy(outletB.state); + summary.hout_A = MediumA.specificEnthalpy(outletA.state); + summary.dT_A = summary.Tout_A - summary.Tin_A; + summary.dT_B = summary.Tout_B - summary.Tin_B; + summary.dh_A = summary.hout_A - summary.hin_A; + summary.dh_B = summary.hout_B - summary.hin_B; + summary.Q_flow_A = Q_flow_A; + summary.Q_flow_B = Q_flow_B; + summary.efficiency = if calculate_efficiency then efficiency( + inletA.state, + inletB.state, + outletA.state, + outletB.state, + inletA.m_flow, + inletB.m_flow, + Q_flow_A) else 0; + + annotation (Documentation(info=" +

+This is the partial parent class for discretized heat exchangers. It contains +the inlet and outlet connectors as well as a number of conduction elements (which +is set by the parameter nCells) as discrete control volumes to +exchange heat between two fluid streams. +

+

+The conduction elements are computing a heat transfer coefficient between their +heatport and the fluid contained. They are replaceable with a choice between +a single-phase and a two-phase version, both can be further parametrized. +Although the single-phase version works for two-phase media (not the other +way around), using the two-phase one for two-phase media enables to set different +heat transfer coefficients depending on the phase (liquid/gaseous/2-phase) state +of the medium. +

+

+Note that since the model uses conductionElements as discrete control volumes that +in turn assume quasi-stationary mass and, therefore, are part of a fluid stream +rather than break it into two (like a full volume would), the same holds for +both sides of the heat exchanger – they are part of a fluid stream and +don't break it. The quasi-stationary mass assumption also implies that for +(fast) changing masses/densities in any of the conduction elements the heat +exchanger will (slightly) violate the conservation of energy. Furthermore, the +conduction elements change their behavior for reversed mass-flow, therefore, this +model asserts for negative mass-flow with the level +"DropOfCommons.assertionLevel". +

+

+The parameters A (heat transferring area), k_wall (heat +transfer coefficient of the wall between the streams) and the heat transfer +coefficients in the conduction elements scale the transferred heat (the middle +only if the wall and the latter only of the heat transfer into a fluid is the +choke of the heatflow). +

+

+The parameter V determines the amount of fluid in the heat exchanger +and, therefore, the dynamic for non-steady states. +

+

+The "Initialization" tab allows for a mass-flow initialization for both paths. +

+

+The "Advanced" tab allows to modify the massflow that triggers the +reverse-massflow-assertion and has an option to enforce global conservation of +energy. The latter is done by feeding back any energy the conduction elements +accumulated over time, basically making it impossible to store energy in their +fluid long-term. While this enforces long-term conservation of energy, it +changes the medium-/short-term dynamics of the system and is, therefore, +disabled by default. +

+")); +end PartialDiscretizedHEXCounterFlow; diff --git a/ThermofluidStream/HeatExchangers/Internal/PartialDiscretizedHEX.mo b/ThermofluidStream/HeatExchangers/Internal/PartialDiscretizedHEXCrossFlow.mo similarity index 94% rename from ThermofluidStream/HeatExchangers/Internal/PartialDiscretizedHEX.mo rename to ThermofluidStream/HeatExchangers/Internal/PartialDiscretizedHEXCrossFlow.mo index 4314df40..e51a1bb7 100644 --- a/ThermofluidStream/HeatExchangers/Internal/PartialDiscretizedHEX.mo +++ b/ThermofluidStream/HeatExchangers/Internal/PartialDiscretizedHEXCrossFlow.mo @@ -1,5 +1,5 @@ within ThermofluidStream.HeatExchangers.Internal; -partial model PartialDiscretizedHEX "Base class for discretized heat exchangers" +partial model PartialDiscretizedHEXCrossFlow "Base class for discretized heat exchangers" extends ThermofluidStream.Utilities.DropOfCommonsPlus; extends Internal.DiscretizedHexIcon; @@ -59,13 +59,13 @@ partial model PartialDiscretizedHEX "Base class for discretized heat exchangers" //----------------------------------------------------------------- Interfaces.Inlet inletB(redeclare package Medium = MediumB) - annotation (Placement(transformation(extent={{-120,40},{-80,80}}), iconTransformation(extent=if crossFlow then {{120,-80},{80,-40}} else {{-120,40},{-80,80}}))); + annotation (Placement(transformation(extent={{-120,40},{-80,80}}), iconTransformation(extent= {{120,-80},{80,-40}}))); Interfaces.Outlet outletB(redeclare package Medium = MediumB) - annotation (Placement(transformation(extent={{80,40},{120,80}}), iconTransformation(extent=if crossFlow then {{-80,-80},{-120,-40}} else {{80,40},{120,80}}))); + annotation (Placement(transformation(extent={{80,40},{120,80}}), iconTransformation(extent={{-80,-80},{-120,-40}}))); Interfaces.Inlet inletA(redeclare package Medium = MediumA) - annotation (Placement(transformation(extent={{120,-80},{80,-40}}), iconTransformation(extent=if crossFlow then {{-120,-20},{-80,20}} else {{120,-80},{80,-40}}, rotation=if crossFlow then -90 else 0))); + annotation (Placement(transformation(extent={{120,-80},{80,-40}}), iconTransformation(extent={{-120,-20},{-80,20}}, rotation=-90))); Interfaces.Outlet outletA(redeclare package Medium = MediumA) - annotation (Placement(transformation(extent={{-80,-80},{-120,-40}}), iconTransformation(extent=if crossFlow then {{80,-20},{120,20}} else {{-80,-80},{-120,-40}}, rotation=if crossFlow then -90 else 0))); + annotation (Placement(transformation(extent={{-80,-80},{-120,-40}}), iconTransformation(extent={{80,-20},{120,20}}, rotation=-90))); SI.HeatFlowRate Q_flow_A=sum(thermalElementA.heatPort.Q_flow) "Heat flow rate into medium A"; @@ -179,4 +179,4 @@ changes the medium-/short-term dynamics of the system and is, therefore, disabled by default.

")); -end PartialDiscretizedHEX; +end PartialDiscretizedHEXCrossFlow; diff --git a/ThermofluidStream/HeatExchangers/Internal/PartialNTU.mo b/ThermofluidStream/HeatExchangers/Internal/PartialNTUCounterFlow.mo similarity index 92% rename from ThermofluidStream/HeatExchangers/Internal/PartialNTU.mo rename to ThermofluidStream/HeatExchangers/Internal/PartialNTUCounterFlow.mo index 874b2f95..1a80da49 100644 --- a/ThermofluidStream/HeatExchangers/Internal/PartialNTU.mo +++ b/ThermofluidStream/HeatExchangers/Internal/PartialNTUCounterFlow.mo @@ -1,8 +1,9 @@ within ThermofluidStream.HeatExchangers.Internal; -partial model PartialNTU "Partial heat exchanger model using the epsilon-NTU method" +partial model PartialNTUCounterFlow "Partial heat exchanger model using the epsilon-NTU method" extends ThermofluidStream.Utilities.DropOfCommonsPlus; + replaceable package MediumA = ThermofluidStream.Media.myMedia.Interfaces.PartialMedium "Medium model A" annotation (choicesAllMatching=true); replaceable package MediumB = ThermofluidStream.Media.myMedia.Interfaces.PartialMedium "Medium model B" @@ -30,23 +31,23 @@ partial model PartialNTU "Partial heat exchanger model using the epsilon-NTU met annotation(Evaluate=true, HideResult=true); //----------------------------------------------------------------- - ThermofluidStream.Interfaces.Inlet inletA(redeclare package Medium = MediumA) annotation (Placement(transformation( + + ThermofluidStream.Interfaces.Inlet inletA(redeclare package Medium = MediumA) annotation (Placement(transformation( extent={{-20,-20},{20,20}}, rotation=0, - origin={-100,-60}), iconTransformation(extent=if crossFlow then {{-120,-20},{-80,20}} else {{-120,-80},{-80,-40}}))); + origin={-100,-60}), iconTransformation(extent={{-120,-80},{-80,-40}}))); ThermofluidStream.Interfaces.Outlet outletA(redeclare package Medium = MediumA) annotation (Placement(transformation( extent={{-20,-20},{20,20}}, rotation=0, - origin={100,-60}), iconTransformation(extent=if crossFlow then {{80,-20},{120,20}} else {{80,-80},{120,-40}}))); + origin={100,-60}), iconTransformation(extent={{80,-80},{120,-40}}))); ThermofluidStream.Interfaces.Inlet inletB(redeclare package Medium = MediumB) annotation (Placement(transformation( extent={{20,-20},{-20,20}}, rotation=0, - origin={100,60}), iconTransformation(extent=if crossFlow then {{-120,-20},{-80,20}} else {{120,80},{80,40}}, rotation=if crossFlow then -90 else 0))); + origin={100,60}), iconTransformation(extent={{120,80},{80,40}}, rotation=0))); ThermofluidStream.Interfaces.Outlet outletB(redeclare package Medium = MediumB) annotation (Placement(transformation( extent={{20,-20},{-20,20}}, rotation=0, - origin={-100,60}), iconTransformation(extent=if crossFlow then {{80,-20},{120,20}} else {{-80,80},{-120,40}}, rotation=if crossFlow then -90 else 0))); - + origin={-100,60}), iconTransformation(extent={{-80,80},{-120,40}}, rotation=0))); Modelica.Units.SI.TemperatureDifference Delta_T_max "Maximum temperature difference"; @@ -232,4 +233,4 @@ flow regularization close to zero: ")); -end PartialNTU; +end PartialNTUCounterFlow; diff --git a/ThermofluidStream/HeatExchangers/Internal/PartialNTUCrossFlow.mo b/ThermofluidStream/HeatExchangers/Internal/PartialNTUCrossFlow.mo new file mode 100644 index 00000000..5ea944af --- /dev/null +++ b/ThermofluidStream/HeatExchangers/Internal/PartialNTUCrossFlow.mo @@ -0,0 +1,237 @@ +within ThermofluidStream.HeatExchangers.Internal; + +partial model PartialNTUCrossFlow "Partial heat exchanger model using the epsilon-NTU method" + + extends .ThermofluidStream.Utilities.DropOfCommonsPlus; + + + replaceable package MediumA = .ThermofluidStream.Media.myMedia.Interfaces.PartialMedium "Medium model A" + annotation (choicesAllMatching=true); + replaceable package MediumB = .ThermofluidStream.Media.myMedia.Interfaces.PartialMedium "Medium model B" + annotation (choicesAllMatching=true); + + parameter .Modelica.Units.SI.Area A "Heat transfer area"; + parameter .Modelica.Units.SI.CoefficientOfHeatTransfer k_NTU=50 "Thermal transmittance"; + parameter .ThermofluidStream.Utilities.Units.Inertance L=dropOfCommons.L "Inertance" + annotation (Dialog(tab="Advanced")); + parameter .Modelica.Units.SI.MassFlowRate m_flow_reg=dropOfCommons.m_flow_reg "Nominal mass flow rate for regularization" + annotation (Dialog(tab="Advanced", group="Regularization parameters")); + parameter .Modelica.Units.SI.Time TC=0.01 "Time constant for specific enthalpy difference dh" + annotation (Dialog(tab="Advanced")); + + // ------ Parameter Display Configuration ------------------------ + parameter Boolean displayArea = true "= true, if the heat transfer area A is displayed" + annotation(Dialog(tab="Layout",group="Display parameters",enable=displayParameters),Evaluate=true, HideResult=true, choices(checkBox=true)); + parameter Boolean displaykNTU = true "= true, if the thermal transmittance k_NTU is displayed" + annotation(Dialog(tab="Layout",group="Display parameters",enable=displayParameters),Evaluate=true, HideResult=true, choices(checkBox=true)); + final parameter Boolean d1A = displayParameters and displayArea "displayArea at position 1" + annotation(Evaluate=true, HideResult=true); //d1A -> Display at position 1 A=Area + final parameter Boolean d1kNTU = displayParameters and displaykNTU and not d1A "displaykNTU at position 1" + annotation(Evaluate=true, HideResult=true); + final parameter Boolean d2kNTU = displayParameters and displaykNTU and not d1kNTU "displaykNTU at position 2" + annotation(Evaluate=true, HideResult=true); + //----------------------------------------------------------------- + + + .ThermofluidStream.Interfaces.Inlet inletA(redeclare package Medium = MediumA) annotation (Placement(transformation( + extent={{-20,-20},{20,20}}, + rotation=0, + origin={-100,-60}), iconTransformation(extent={{-120,-20},{-80,20}}))); + .ThermofluidStream.Interfaces.Outlet outletA(redeclare package Medium = MediumA) annotation (Placement(transformation( + extent={{-20,-20},{20,20}}, + rotation=0, + origin={100,-60}), iconTransformation(extent={{80,-20},{120,20}}))); + .ThermofluidStream.Interfaces.Inlet inletB(redeclare package Medium = MediumB) annotation (Placement(transformation( + extent={{20,-20},{-20,20}}, + rotation=0, + origin={100,60}), iconTransformation(extent={{-120,-20},{-80,20}}, rotation=-90))); + .ThermofluidStream.Interfaces.Outlet outletB(redeclare package Medium = MediumB) annotation (Placement(transformation( + extent={{20,-20},{-20,20}}, + rotation=0, + origin={-100,60}), iconTransformation(extent={{80,-20},{120,20}}, rotation=-90))); + + + .Modelica.Units.SI.TemperatureDifference Delta_T_max "Maximum temperature difference"; + + .Modelica.Units.SI.SpecificEnthalpy dh_A "Specific enthalpy difference medium A"; + .Modelica.Units.SI.SpecificEnthalpy dh_B "Specific enthalpy difference medium B"; + + .Modelica.Units.SI.HeatFlowRate q_flow "Heat flow rate (Q_flow)"; + Real effectiveness(unit="1") "Heat exchanger efficiency"; + Real NTU(unit="1") "Number of transfer units"; + + //Inlet and outlet temperatures + MediumA.Temperature T_in_MediumA "Inlet temperature of medium A"; + MediumB.Temperature T_in_MediumB "Inlet temperature of medium B"; + + .ThermofluidStream.HeatExchangers.Internal.DiscretizedHEXSummary summary "Summary record of quantities"; + + parameter Boolean crossFlow=false "Selection whether HEX is in crossflow or counterflow configuration"; +protected + + .Modelica.Units.SI.Pressure p_A=MediumA.pressure(inletA.state) "Inlet A pressure"; + .Modelica.Units.SI.Pressure p_B=MediumB.pressure(inletB.state) "Inlet B pressure"; + + MediumA.MassFraction Xi_A[MediumA.nXi]=MediumA.massFraction(inletA.state) "Inlet A mass fractions"; + MediumB.MassFraction Xi_B[MediumB.nXi]=MediumB.massFraction(inletB.state) "Inlet B mass fractions"; + + //Inlet and outlet specific enthalpies and enthalpy differences + .Modelica.Units.SI.SpecificEnthalpy h_in_A "Specific enthalpy at inlet A"; + .Modelica.Units.SI.SpecificEnthalpy h_in_B "Specific enthalpy at inlet B"; + .Modelica.Units.SI.SpecificEnthalpy h_out_A "Specific enthalpy at outlet A"; + .Modelica.Units.SI.SpecificEnthalpy h_out_B "Specific enthalpy at outlet B"; + + .Modelica.Units.SI.HeatFlowRate q_max "Maximum heat flow rate (Q_max)"; + .Modelica.Units.SI.HeatFlowRate q_flowA "Heat flow rate side A (Q_flowA)"; + .Modelica.Units.SI.HeatFlowRate q_flowB "Heat flow rate side B (Q_flowB)"; + + Real C_A(unit="J/(K.s)") "Heat capacity flow rate of Medium A"; + Real C_B(unit="J/(K.s)") "Heat capacity flow rate of Medium B"; + Real C_min(unit="J/(K.s)") "Minimum heat capacity flow rate"; + Real C_max(unit="J/(K.s)") "Maximum heat capacity flow rate"; + Real C_r(unit="1") "Ratio of heat capacity rates, Cmin/Cmax"; + + .Modelica.Units.SI.SpecificHeatCapacityAtConstantPressure cp_A "Specific heat capacity of Medium A"; + .Modelica.Units.SI.SpecificHeatCapacityAtConstantPressure cp_B "Specific heat capacity of Medium B"; + + .Modelica.Units.SI.MassFlowRate m_flow_A=inletA.m_flow "Mass flow rate on side A"; + .Modelica.Units.SI.MassFlowRate m_flow_B=inletB.m_flow "Mass flow rate on side B"; + + .Modelica.Units.SI.SpecificHeatCapacity cpA_in=MediumA.specificHeatCapacityCp(inletA.state) "Inlet A specific heat capacity"; + .Modelica.Units.SI.SpecificHeatCapacity cpA_out=MediumA.specificHeatCapacityCp(outletA.state) "Outlet A specific heat capacity"; + .Modelica.Units.SI.SpecificHeatCapacity cpB_in=MediumB.specificHeatCapacityCp(inletB.state) "Inlet B specific heat capacity"; + .Modelica.Units.SI.SpecificHeatCapacity cpB_out=MediumB.specificHeatCapacityCp(outletB.state) "Outlet B specific heat capacity"; + + constant Real eps(unit="kg/s") = .Modelica.Constants.eps "Mass flow rate regularization"; + +initial equation + h_out_A = h_in_A; + h_out_B = h_in_B; + +equation + //Balance Equations + inletA.m_flow + outletA.m_flow= 0; + inletB.m_flow + outletB.m_flow = 0; + inletA.r - outletA.r = der(inletA.m_flow)*L; + inletB.r - outletB.r = der(inletB.m_flow)*L; + + //Specific heat capacities + cp_A = (cpA_in + cpA_out)/2; + cp_B = (cpB_in + cpB_out)/2; + + //Heat capacity rates + C_A = (abs(inletA.m_flow) + eps)*cp_A; + C_B = (abs(inletB.m_flow) + eps)*cp_B; + + //Inlet temperatures and enthalpies + T_in_MediumA = MediumA.temperature(inletA.state); + T_in_MediumB = MediumB.temperature(inletB.state); + + h_in_A = MediumA.specificEnthalpy(inletA.state); + h_in_B = MediumB.specificEnthalpy(inletB.state); + + //Finding minimum heat capacity rate + if noEvent(C_A > C_B) then + C_min = C_B; + C_max = C_A; + else + C_min = C_A; + C_max = C_B; + end if; + + C_r = C_min/(max(C_max, 1e-3)); + + //Number of Transfer Units + NTU = (k_NTU*A)/(max(C_min, 1e-3)); + + + //Maximum possible temperature difference + Delta_T_max = T_in_MediumA - T_in_MediumB; + + //Maximum possible heat flow rate + q_max = Delta_T_max*C_min; + + //Actual heat flow rate + q_flow = effectiveness*q_max; + + if noEvent(C_A < C_B) then + + //No heat is transferred, if both mass flow rates are smaller than regularization mass flow rate + if noEvent(inletA.m_flow < m_flow_reg) and noEvent(inletB.m_flow < m_flow_reg) then + dh_A = 0; + else + dh_A = Delta_T_max*cp_A*effectiveness; + end if; + + q_flowA = m_flow_A*dh_A; + q_flowB = -q_flowA; + + //Based on regularization for mass flow + dh_B = (m_flow_B*q_flowB)/(m_flow_B^2 + (m_flow_reg/10)^2); + + der(h_out_A)*TC = h_in_A - dh_A - h_out_A; + der(h_out_B)*TC = h_in_B - dh_B - h_out_B; + + else + + //No heat is transferred, if both mass flow rates are smaller than regularization mass flow rate + if noEvent(inletA.m_flow < m_flow_reg) and noEvent(inletB.m_flow < m_flow_reg) then + dh_B = 0; + else + dh_B = -Delta_T_max*cp_B*effectiveness; + end if; + + q_flowB = m_flow_B*dh_B; + q_flowA = -q_flowB; + + //Based on regularization for mass flow + dh_A = (m_flow_A*q_flowA)/(m_flow_A^2 + (m_flow_reg/10)^2); + + der(h_out_A)*TC = h_in_A - dh_A - h_out_A; + der(h_out_B)*TC = h_in_B - dh_B - h_out_B; + + end if; + + outletA.state = MediumA.setState_phX( + p_A, + h_out_A, + Xi_A); + outletB.state = MediumB.setState_phX( + p_B, + h_out_B, + Xi_B); + + //Summary record + summary.Tin_B = MediumB.temperature(inletB.state); + summary.Tin_A = MediumA.temperature(inletA.state); + summary.Tout_B = MediumB.temperature(outletB.state); + summary.Tout_A = MediumA.temperature(outletA.state); + summary.hin_A = h_in_A; + summary.hout_A = h_out_A; + summary.hin_B = h_in_B; + summary.hout_B = h_out_B; + summary.dT_A = summary.Tout_A - summary.Tin_A; + summary.dT_B = summary.Tout_B - summary.Tin_B; + summary.dh_A = summary.hout_A - summary.hin_A; + summary.dh_B = summary.hout_B - summary.hin_B; + summary.Q_flow_A = q_flowA; + summary.Q_flow_B = q_flowB; + summary.efficiency = effectiveness; + + annotation (Documentation(info=" +

+This is the partial parent class for all heat exchangers based on the the +effectiveness-NTU method. +

+

+For stream dominated applications the following assumptions are made for mass +flow regularization close to zero: +

+
    +
  • + if the mass flow on both sides of the heat exchanger is zero, no heat + is transferred +
  • +
+")); +end PartialNTUCrossFlow; diff --git a/ThermofluidStream/HeatExchangers/Internal/package.order b/ThermofluidStream/HeatExchangers/Internal/package.order index 957c814a..4fd0c91a 100644 --- a/ThermofluidStream/HeatExchangers/Internal/package.order +++ b/ThermofluidStream/HeatExchangers/Internal/package.order @@ -1,8 +1,12 @@ +PartialCounterFlowInterface +PartialCrossFlowInterface PartialConductionElementHEX ConductionElementHEX ConductionElementHEX_twoPhase DiscretizedHEXSummary DiscretizedHexIcon calculateEfficiency -PartialDiscretizedHEX -PartialNTU +PartialDiscretizedHEXCrossFlow +PartialDiscretizedHEXCounterFlow +PartialNTUCounterFlow +PartialNTUCrossFlow \ No newline at end of file diff --git a/ThermofluidStream/HeatExchangers/package.order b/ThermofluidStream/HeatExchangers/package.order index 96bb7e14..56d59299 100644 --- a/ThermofluidStream/HeatExchangers/package.order +++ b/ThermofluidStream/HeatExchangers/package.order @@ -5,4 +5,4 @@ DiscretizedCrossFlowHEX DiscretizedCounterFlowHEX_FR DiscretizedCrossFlowHEX_FR Tests -Internal +Internal \ No newline at end of file From 6fd4c4aa651a4a52fb883ba918c2e754f6dd5100 Mon Sep 17 00:00:00 2001 From: Hubertus Tummescheit Date: Mon, 14 Apr 2025 16:18:31 -0400 Subject: [PATCH 4/8] Removed unnecessary metadata --- Examples/FromScratch.mo | 4 - Examples/SimpleEngine.mo | 262 ------------------ Examples/package.mo | 3 - Examples/package.order | 2 - .../Examples/SimpleEngine/Metadata.json | 3 - .../Examples/SimpleEngine/experiment_1.json | 54 ---- .../Examples/ReverseHeatPump/Metadata.json | 3 - .../ReverseHeatPump/experiment_1.json | 52 ---- .../Examples/SimpleAirCycle/Metadata.json | 3 - .../Examples/SimpleAirCycle/experiment_1.json | 51 ---- .../Examples/SimpleStream/Metadata.json | 3 - .../Examples/SimpleStream/experiment_1.json | 52 ---- .../Tests/CounterFlowNTU/Metadata.json | 3 - .../Tests/CounterFlowNTU/experiment_1.json | 52 ---- .../impact-analysis-dashboard-view-1984.json | 16 -- .../impact-analysis-dashboard-view-1984.json | 16 -- .../impact-analysis-dashboard-view-1984.json | 16 -- .../impact-analysis-dashboard-view-1984.json | 16 -- .../impact-analysis-dashboard-view-1984.json | 16 -- .../impact-analysis-dashboard-view-1984.json | 16 -- .../impact-analysis-dashboard-view-1984.json | 16 -- 21 files changed, 659 deletions(-) delete mode 100644 Examples/FromScratch.mo delete mode 100644 Examples/SimpleEngine.mo delete mode 100644 Examples/package.mo delete mode 100644 Examples/package.order delete mode 100644 Resources/ExperimentDefinitions/Examples/SimpleEngine/Metadata.json delete mode 100644 Resources/ExperimentDefinitions/Examples/SimpleEngine/experiment_1.json delete mode 100644 Resources/ExperimentDefinitions/ThermofluidStream/Examples/ReverseHeatPump/Metadata.json delete mode 100644 Resources/ExperimentDefinitions/ThermofluidStream/Examples/ReverseHeatPump/experiment_1.json delete mode 100644 Resources/ExperimentDefinitions/ThermofluidStream/Examples/SimpleAirCycle/Metadata.json delete mode 100644 Resources/ExperimentDefinitions/ThermofluidStream/Examples/SimpleAirCycle/experiment_1.json delete mode 100644 Resources/ExperimentDefinitions/ThermofluidStream/Examples/SimpleStream/Metadata.json delete mode 100644 Resources/ExperimentDefinitions/ThermofluidStream/Examples/SimpleStream/experiment_1.json delete mode 100644 Resources/ExperimentDefinitions/ThermofluidStream/HeatExchangers/Tests/CounterFlowNTU/Metadata.json delete mode 100644 Resources/ExperimentDefinitions/ThermofluidStream/HeatExchangers/Tests/CounterFlowNTU/experiment_1.json delete mode 100644 Resources/Views/Examples/SimpleEngine/impact-analysis-dashboard-view-1984.json delete mode 100644 Resources/Views/ThermofluidStream/Examples/SimpleAirCycle/impact-analysis-dashboard-view-1984.json delete mode 100644 Resources/Views/ThermofluidStream/HeatExchangers/Internal/PartialCounterFlowInterface/impact-analysis-dashboard-view-1984.json delete mode 100644 Resources/Views/ThermofluidStream/HeatExchangers/Internal/PartialCrossFlowInterface/impact-analysis-dashboard-view-1984.json delete mode 100644 Resources/Views/ThermofluidStream/HeatExchangers/Internal/PartialDiscretizedHEXCounterFlow/impact-analysis-dashboard-view-1984.json delete mode 100644 Resources/Views/ThermofluidStream/HeatExchangers/Internal/PartialDiscretizedHEXCrossFlow/impact-analysis-dashboard-view-1984.json delete mode 100644 Resources/Views/ThermofluidStream/HeatExchangers/Internal/PartialNTUCounterFlow/impact-analysis-dashboard-view-1984.json diff --git a/Examples/FromScratch.mo b/Examples/FromScratch.mo deleted file mode 100644 index f55052f6..00000000 --- a/Examples/FromScratch.mo +++ /dev/null @@ -1,4 +0,0 @@ -within Examples; -model FromScratch - annotation(Icon(coordinateSystem(preserveAspectRatio = false,extent = {{-100.0,-100.0},{100.0,100.0}}),graphics = {Rectangle(lineColor={0,0,0},fillColor={230,230,230},fillPattern=FillPattern.Solid,extent={{-100.0,-100.0},{100.0,100.0}}),Text(lineColor={0,0,255},extent={{-150,150},{150,110}},textString="%name")})); -end FromScratch; diff --git a/Examples/SimpleEngine.mo b/Examples/SimpleEngine.mo deleted file mode 100644 index 393c46ee..00000000 --- a/Examples/SimpleEngine.mo +++ /dev/null @@ -1,262 +0,0 @@ -within Examples; - -model SimpleEngine "Simple steam engine" - extends .Modelica.Icons.Example; - - package Water = .ThermofluidStream.Media.myMedia.Water.StandardWater; - - - inner .ThermofluidStream.DropOfCommons dropOfCommons( - L=1e-3, - assertionLevel = AssertionLevel.warning,displayParameters = true) - annotation (Placement(transformation(extent={{140,-34},{160,-14}}))); - .ThermofluidStream.Examples.Utilities.SteamSink steamSink( - redeclare package Medium = Water, - p0_par=100000, - m_flow_animate=0.25) - annotation (Placement(transformation(extent={{-10,-10},{10,10}}, - rotation=90, - origin={190,90}))); - - .ThermofluidStream.Processes.ConductionElement conductionElement( - redeclare package Medium = Water, - A=20, - init=.ThermofluidStream.Processes.Internal.InitializationMethodsCondElement.T, - T_0=573.15) - annotation (Placement(transformation(extent={{-60,64},{-40,44}}))); - .Modelica.Thermal.HeatTransfer.Sources.FixedTemperature fixedTemperature( - T(displayUnit="degC") = 873.15) - annotation (Placement(transformation(extent={{-80,70},{-60,90}}))); - .ThermofluidStream.Examples.Utilities.CrankDrive crankDrive( - rodLength=3, - crankPoint=0.25, - translationMass=1e2, - J_flyweel=1e2, - phi0=-1.5707963267949) - annotation (Placement(transformation(extent={{2.0,-38.0},{-118.0,-98.0}},rotation = 0.0,origin = {0.0,0.0}))); - - .ThermofluidStream.Examples.Utilities.Piston piston( - redeclare package Medium = Water, - A=0.05, - l_stroke=0.5, - V_dead=0.2, - outputX=false, - initializeX=false, - m0_left=0.1, - m0_right=0.1, - x0=0.5) annotation (Placement(transformation(extent={{80,-100},{20,-40}}))); - .ThermofluidStream.Undirected.Topology.ConnectorInletOutletFore switchConnector( - redeclare package Medium = Water) annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={70,34}))); - .ThermofluidStream.Undirected.Topology.ConnectorInletOutletFore switchConnector1( - redeclare package Medium = Water) annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={50,54}))); - .ThermofluidStream.FlowControl.Switch switch(redeclare package Medium = Water) annotation (Placement(transformation(extent={{-10,10},{10,-10}}, - rotation=0, - origin={-10,54}))); - .ThermofluidStream.Topology.JunctionT2 junctionT2_1(redeclare package Medium = Water) - annotation (Placement(transformation( - extent={{-10,10},{10,-10}}, - rotation=0, - origin={150,54}))); - .ThermofluidStream.Processes.FlowResistance flowResistance3( - redeclare package Medium = Water, - m_flowStateSelect=StateSelect.prefer, - initM_flow=.ThermofluidStream.Utilities.Types.InitializationMethods.state, - r=0.015, - l=1, - redeclare function pLoss = .ThermofluidStream.Processes.Internal.FlowResistance.laminarTurbulentPressureLoss ( - material=.ThermofluidStream.Processes.Internal.Material.steel)) - annotation (Placement(transformation(extent={{10,44},{30,64}}))); - .ThermofluidStream.Processes.FlowResistance flowResistance4( - redeclare package Medium = Water, - m_flowStateSelect=StateSelect.prefer, - initM_flow=.ThermofluidStream.Utilities.Types.InitializationMethods.state, - r=0.015, - l=1, - redeclare function pLoss = .ThermofluidStream.Processes.Internal.FlowResistance.laminarTurbulentPressureLoss ( - material=.ThermofluidStream.Processes.Internal.Material.steel)) - annotation (Placement(transformation(extent={{-2,24},{18,44}}))); - .ThermofluidStream.Processes.FlowResistance flowResistance5( - redeclare package Medium = Water, - m_flowStateSelect=StateSelect.prefer, - initM_flow=.ThermofluidStream.Utilities.Types.InitializationMethods.state, - r=0.015, - l=1, - redeclare function pLoss = .ThermofluidStream.Processes.Internal.FlowResistance.laminarTurbulentPressureLoss ( - material=.ThermofluidStream.Processes.Internal.Material.steel)) - annotation (Placement(transformation(extent={{70,44},{90,64}}))); - .ThermofluidStream.Processes.FlowResistance flowResistance6( - redeclare package Medium = Water, - m_flowStateSelect=StateSelect.prefer, - initM_flow=.ThermofluidStream.Utilities.Types.InitializationMethods.state, - r=0.015, - l=1, - redeclare function pLoss = .ThermofluidStream.Processes.Internal.FlowResistance.laminarTurbulentPressureLoss ( - material=.ThermofluidStream.Processes.Internal.Material.steel)) - annotation (Placement(transformation(extent={{88,24},{108,44}}))); - .ThermofluidStream.FlowControl.TanValve tanValve(redeclare package Medium = Water, invertInput=false) annotation (Placement(transformation(extent={{100,64},{120,44}}))); - .ThermofluidStream.FlowControl.TanValve tanValve1(redeclare package Medium = Water, invertInput=true) annotation (Placement(transformation(extent={{120,24},{140,44}}))); - .Modelica.Blocks.Math.BooleanToReal booleanToReal(realTrue=0.0, realFalse=1.0) - annotation (Placement(transformation( - extent={{8,-8},{-8,8}}, - rotation=180, - origin={-70,-16}))); - .Modelica.Blocks.Continuous.FirstOrder firstOrder(T=0.01, initType=.Modelica.Blocks.Types.Init.SteadyState) - annotation (Placement(transformation(extent={{8,8},{-8,-8}}, - rotation=180, - origin={-40,-16}))); - .ThermofluidStream.Boundaries.PhaseSeparator boiler( - redeclare package Medium = Water, - useHeatport=true, - A=20, - p_start=400000, - V_par=0.1, - pipe_low=0.9, - pipe_high=0.95, - init_method=.ThermofluidStream.Boundaries.Internal.InitializationMethodsPhaseSeperator.l) - annotation (Placement(transformation(extent={{-100,44},{-80,64}}))); - .Modelica.Blocks.Continuous.LimPID PI1( - controllerType=.Modelica.Blocks.Types.SimpleController.PI, - k=1e6, - Ti=2, - yMax=10000000, - yMin=0, - y_start=0) annotation (Placement(transformation(extent={{-150,24},{-130,44}}))); - .Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow heating_element - annotation (Placement(transformation(extent={{-120,24},{-100,44}}))); - .Modelica.Blocks.Sources.RealExpression realExpression1(y=4) annotation (Placement(transformation(extent={{-180,24},{-160,44}}))); - .ThermofluidStream.Sensors.SingleSensorSelect singleSensorSelect( - redeclare package Medium = Water, - quantity=.ThermofluidStream.Sensors.Internal.Types.Quantities.p_bar, - outputValue=true, - filter_output=false) annotation (Placement(transformation( - extent={{-10,10},{10,-10}}, - rotation=180, - origin={-96,16}))); - .ThermofluidStream.Boundaries.TerminalSource terminalSource(redeclare package Medium = Water) annotation (Placement(transformation(extent={{-130,44},{-110,64}}))); - .ThermofluidStream.Utilities.Icons.DLRLogo dLRLogo annotation (Placement(transformation(extent={{162,-118},{218,-62}}))); - .Modelica.Blocks.Sources.Trapezoid trapezoid(period = 5,offset = 1,amplitude = 0.5,rising = 0.5,falling = 0.5,width = 1.0) annotation(Placement(transformation(extent = {{-208,-80},{-188,-60}},origin = {0,0},rotation = 0))); - .Modelica.Mechanics.Rotational.Sources.Torque torque annotation(Placement(transformation(extent = {{-166,-78},{-146,-58}},origin = {0,0},rotation = 0))); -equation - connect(fixedTemperature.port, conductionElement.heatPort) annotation (Line(points={{-60,80},{-50,80},{-50,64}}, color={191,0,0})); - connect(switchConnector.fore, piston.port_left) - annotation (Line( - points={{70,24},{70,-57.4},{80,-57.4}}, - color={28,108,200}, - thickness=0.5)); - connect(switchConnector1.fore, piston.port_right) - annotation (Line( - points={{50,44},{50,-44},{20,-44},{20,-57.4}}, - color={28,108,200}, - thickness=0.5)); - connect(flowResistance3.outlet, switchConnector1.inlet) - annotation (Line( - points={{30,54},{40,54}}, - color={28,108,200}, - thickness=0.5)); - connect(flowResistance4.outlet,switchConnector. inlet) - annotation (Line( - points={{18,34},{60,34}}, - color={28,108,200}, - thickness=0.5)); - connect(flowResistance5.inlet,switchConnector1. outlet) annotation (Line( - points={{70,54},{60,54}}, - color={28,108,200}, - thickness=0.5)); - connect(flowResistance6.inlet,switchConnector. outlet) annotation (Line( - points={{88,34},{80,34}}, - color={28,108,200}, - thickness=0.5)); - connect(tanValve.inlet,flowResistance5. outlet) annotation (Line( - points={{100,54},{90,54}}, - color={28,108,200}, - thickness=0.5)); - connect(tanValve1.inlet,flowResistance6. outlet) annotation (Line( - points={{120,34},{108,34}}, - color={28,108,200}, - thickness=0.5)); - connect(junctionT2_1.inletB,tanValve. outlet) annotation (Line( - points={{140,54},{120,54}}, - color={28,108,200}, - thickness=0.5)); - connect(tanValve1.outlet,junctionT2_1. inletA) annotation (Line( - points={{140,34},{150,34},{150,44}}, - color={28,108,200}, - thickness=0.5)); - connect(switch.outletA, flowResistance3.inlet) annotation (Line( - points={{0,54},{10,54}}, - color={28,108,200}, - thickness=0.5)); - connect(switch.outletB, flowResistance4.inlet) - annotation (Line( - points={{-10,44},{-10,34},{-2,34}}, - color={28,108,200}, - thickness=0.5)); - connect(crankDrive.h_out, booleanToReal.u) annotation (Line(points={{-88,-38},{-88,-16},{-79.6,-16}}, color={255,0,255})); - connect(steamSink.inlet, junctionT2_1.outlet) annotation (Line( - points={{190,80},{190,54},{160,54}}, - color={28,108,200}, - thickness=0.5)); - connect(booleanToReal.y, firstOrder.u) annotation (Line(points={{-61.2,-16},{-49.6,-16}}, - color={0,0,127})); - connect(firstOrder.y, tanValve.u) annotation (Line(points={{-31.2,-16},{-24,-16},{-24,14},{110,14},{110,46}}, - color={0,0,127})); - connect(boiler.outlet, conductionElement.inlet) annotation (Line( - points={{-80,54},{-60,54}}, - color={28,108,200}, - thickness=0.5)); - connect(realExpression1.y, PI1.u_s) annotation (Line(points={{-159,34},{-152,34}}, color={0,0,127})); - connect(heating_element.port, boiler.heatPort) annotation (Line(points={{-100,34},{-90,34},{-90,46}}, color={191,0,0})); - connect(singleSensorSelect.inlet, conductionElement.inlet) - annotation (Line( - points={{-86,16},{-70,16},{-70,54},{-60,54}}, - color={28,108,200}, - thickness=0.5)); - connect(singleSensorSelect.value_out, PI1.u_m) annotation (Line(points={{-104.2,16},{-140,16},{-140,22}}, color={0,0,127})); - connect(heating_element.Q_flow, PI1.y) annotation (Line(points={{-120,34},{-129,34}}, color={0,0,127})); - connect(terminalSource.outlet, boiler.inlet) annotation (Line( - points={{-110,54},{-100,54}}, - color={28,108,200}, - thickness=0.5)); - connect(switch.inlet, conductionElement.outlet) annotation (Line( - points={{-20,54},{-40,54}}, - color={28,108,200}, - thickness=0.5)); - connect(switch.u, tanValve.u) annotation (Line(points={{-10,66},{-10,74},{-24,74},{-24,14},{110,14},{110,46}}, color={0,0,127})); - connect(tanValve1.u, tanValve.u) annotation (Line(points={{130,42},{130,48},{122,48},{122,40},{110,40},{110,46}}, color={0,0,127})); - connect(crankDrive.flange_b, piston.flange) annotation (Line(points={{2,-68},{2,-70},{20,-70}}, color={0,127,0})); - connect(trapezoid.y,torque.tau) annotation(Line(points = {{-187,-70},{-177.5,-70},{-177.5,-68},{-168,-68}},color = {0,0,127})); - connect(torque.flange,crankDrive.flange_a) annotation(Line(points = {{-146,-68},{-88,-68}},color = {0,0,0})); - annotation ( - Icon(coordinateSystem(extent={{-100,-100},{100,100}})), - Diagram( - coordinateSystem(preserveAspectRatio=false, extent={{-220,-120},{220,120}}), - graphics={ - Rectangle(extent={{-192,96},{-38,6}}, lineColor={28,108,200}), - Text( - extent={{-188,94},{-96,82}}, - textColor={28,108,200}, - textString="Boiler and Preheater"), - Rectangle(extent={{-30,80},{168,20}}, lineColor={28,108,200}), - Text( - extent={{118,78},{180,66}}, - textColor={28,108,200}, - textString="Valves"), - Text( - extent={{-8,-82},{86,-100}}, - textColor={28,108,200}, - textString="Piston and Crank Drive"), - Rectangle( - extent={{-118,-32},{90,-100}}, - lineColor={28,108,200})}), - experiment(StopTime=25, Tolerance=1e-6, Interval=0.025), - Documentation(info=" -

Basic model of a steam engine. STEAM AND POWER!

-


Owner: Michael Meißner

-")); -end SimpleEngine; diff --git a/Examples/package.mo b/Examples/package.mo deleted file mode 100644 index b0d434e4..00000000 --- a/Examples/package.mo +++ /dev/null @@ -1,3 +0,0 @@ -package Examples extends .Modelica.Icons.Package; - annotation(uses(Modelica(version = "4.0.0"),ThermofluidStream(version = "1.2.0"))); -end Examples; \ No newline at end of file diff --git a/Examples/package.order b/Examples/package.order deleted file mode 100644 index 620198cc..00000000 --- a/Examples/package.order +++ /dev/null @@ -1,2 +0,0 @@ -SimpleEngine -FromScratch \ No newline at end of file diff --git a/Resources/ExperimentDefinitions/Examples/SimpleEngine/Metadata.json b/Resources/ExperimentDefinitions/Examples/SimpleEngine/Metadata.json deleted file mode 100644 index fb9e14a4..00000000 --- a/Resources/ExperimentDefinitions/Examples/SimpleEngine/Metadata.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "defaultExperimentId" : "63c8046d-bf3b-4a82-98f6-09a6e1538f3f" -} \ No newline at end of file diff --git a/Resources/ExperimentDefinitions/Examples/SimpleEngine/experiment_1.json b/Resources/ExperimentDefinitions/Examples/SimpleEngine/experiment_1.json deleted file mode 100644 index 97b39bae..00000000 --- a/Resources/ExperimentDefinitions/Examples/SimpleEngine/experiment_1.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "version" : "2", - "id" : "63c8046d-bf3b-4a82-98f6-09a6e1538f3f", - "experiment" : { - "base" : { - "analysis" : { - "variableFilters" : [ ], - "selectedType" : "dynamic", - "choices" : [ { - "type" : "dynamic", - "parameters" : { - "final_time" : 25, - "start_time" : 0 - }, - "simulationOptions" : { - "dynamic_diagnostics" : false, - "ncp" : 1000 - }, - "solverOptions" : { - "store_event_points" : true - }, - "compilerOptions" : { - "generate_html_diagnostics" : false, - "include_protected_variables" : false - }, - "runtimeOptions" : { } - } ], - "expansion" : { - "discreteAlgorithm" : { - "noOfSamples" : 0, - "seed" : 0 - }, - "continuousAlgorithm" : { - "type" : "SOBOL", - "noOfSamples" : 10, - "seed" : 0 - } - } - }, - "modifiers" : { - "initializeFrom" : "", - "variables" : [ { - "name" : "trapezoid.amplitude", - "expression" : "1.5" - } ] - } - } - }, - "metadata" : { - "created" : "2025-04-11 19:08:57.530155954", - "lastModified" : "2025-04-11T19:23:43.797062860Z", - "name" : "Experiment 1" - } -} \ No newline at end of file diff --git a/Resources/ExperimentDefinitions/ThermofluidStream/Examples/ReverseHeatPump/Metadata.json b/Resources/ExperimentDefinitions/ThermofluidStream/Examples/ReverseHeatPump/Metadata.json deleted file mode 100644 index 0d9c9d31..00000000 --- a/Resources/ExperimentDefinitions/ThermofluidStream/Examples/ReverseHeatPump/Metadata.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "defaultExperimentId" : "6914ee4f-64ba-491e-a8cc-7fac464d5f52" -} \ No newline at end of file diff --git a/Resources/ExperimentDefinitions/ThermofluidStream/Examples/ReverseHeatPump/experiment_1.json b/Resources/ExperimentDefinitions/ThermofluidStream/Examples/ReverseHeatPump/experiment_1.json deleted file mode 100644 index 1f170cb3..00000000 --- a/Resources/ExperimentDefinitions/ThermofluidStream/Examples/ReverseHeatPump/experiment_1.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "version" : "2", - "id" : "6914ee4f-64ba-491e-a8cc-7fac464d5f52", - "experiment" : { - "base" : { - "analysis" : { - "variableFilters" : [ ], - "selectedType" : "dynamic", - "choices" : [ { - "type" : "dynamic", - "parameters" : { - "final_time" : 200, - "interval" : 0.2, - "start_time" : 0 - }, - "simulationOptions" : { - "dynamic_diagnostics" : false, - "solver" : "CVode" - }, - "solverOptions" : { - "store_event_points" : true - }, - "compilerOptions" : { - "generate_html_diagnostics" : false, - "include_protected_variables" : false - }, - "runtimeOptions" : { } - } ], - "expansion" : { - "discreteAlgorithm" : { - "noOfSamples" : 0, - "seed" : 0 - }, - "continuousAlgorithm" : { - "type" : "SOBOL", - "noOfSamples" : 10, - "seed" : 0 - } - } - }, - "modifiers" : { - "initializeFrom" : "", - "variables" : [ ] - } - } - }, - "metadata" : { - "created" : "2025-04-14 19:57:36.616287852", - "lastModified" : "2025-04-14 19:57:36.616287852", - "name" : "Experiment 1" - } -} \ No newline at end of file diff --git a/Resources/ExperimentDefinitions/ThermofluidStream/Examples/SimpleAirCycle/Metadata.json b/Resources/ExperimentDefinitions/ThermofluidStream/Examples/SimpleAirCycle/Metadata.json deleted file mode 100644 index 8e9f2a5f..00000000 --- a/Resources/ExperimentDefinitions/ThermofluidStream/Examples/SimpleAirCycle/Metadata.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "defaultExperimentId" : "3435f49e-4efc-4211-902d-7551cfe0956b" -} \ No newline at end of file diff --git a/Resources/ExperimentDefinitions/ThermofluidStream/Examples/SimpleAirCycle/experiment_1.json b/Resources/ExperimentDefinitions/ThermofluidStream/Examples/SimpleAirCycle/experiment_1.json deleted file mode 100644 index 521243c2..00000000 --- a/Resources/ExperimentDefinitions/ThermofluidStream/Examples/SimpleAirCycle/experiment_1.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "version" : "2", - "id" : "3435f49e-4efc-4211-902d-7551cfe0956b", - "experiment" : { - "base" : { - "analysis" : { - "variableFilters" : [ ], - "selectedType" : "dynamic", - "choices" : [ { - "type" : "dynamic", - "parameters" : { - "final_time" : 100, - "interval" : 0.1, - "start_time" : 0 - }, - "simulationOptions" : { - "dynamic_diagnostics" : false - }, - "solverOptions" : { - "store_event_points" : true - }, - "compilerOptions" : { - "generate_html_diagnostics" : false, - "include_protected_variables" : false - }, - "runtimeOptions" : { } - } ], - "expansion" : { - "discreteAlgorithm" : { - "noOfSamples" : 0, - "seed" : 0 - }, - "continuousAlgorithm" : { - "type" : "SOBOL", - "noOfSamples" : 10, - "seed" : 0 - } - } - }, - "modifiers" : { - "initializeFrom" : "", - "variables" : [ ] - } - } - }, - "metadata" : { - "created" : "2025-04-11 19:31:25.054729864", - "lastModified" : "2025-04-11 19:31:25.054729864", - "name" : "Experiment 1" - } -} \ No newline at end of file diff --git a/Resources/ExperimentDefinitions/ThermofluidStream/Examples/SimpleStream/Metadata.json b/Resources/ExperimentDefinitions/ThermofluidStream/Examples/SimpleStream/Metadata.json deleted file mode 100644 index 700f7ed1..00000000 --- a/Resources/ExperimentDefinitions/ThermofluidStream/Examples/SimpleStream/Metadata.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "defaultExperimentId" : "96d0f1d2-cfc8-4b88-93f9-3158adffc5d6" -} \ No newline at end of file diff --git a/Resources/ExperimentDefinitions/ThermofluidStream/Examples/SimpleStream/experiment_1.json b/Resources/ExperimentDefinitions/ThermofluidStream/Examples/SimpleStream/experiment_1.json deleted file mode 100644 index 9ad4fdf7..00000000 --- a/Resources/ExperimentDefinitions/ThermofluidStream/Examples/SimpleStream/experiment_1.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "version" : "2", - "id" : "96d0f1d2-cfc8-4b88-93f9-3158adffc5d6", - "experiment" : { - "base" : { - "analysis" : { - "variableFilters" : [ ], - "selectedType" : "dynamic", - "choices" : [ { - "type" : "dynamic", - "parameters" : { - "final_time" : 100, - "interval" : 0.1, - "start_time" : 0 - }, - "simulationOptions" : { - "dynamic_diagnostics" : false, - "solver" : "CVode" - }, - "solverOptions" : { - "store_event_points" : true - }, - "compilerOptions" : { - "generate_html_diagnostics" : false, - "include_protected_variables" : false - }, - "runtimeOptions" : { } - } ], - "expansion" : { - "discreteAlgorithm" : { - "noOfSamples" : 0, - "seed" : 0 - }, - "continuousAlgorithm" : { - "type" : "SOBOL", - "noOfSamples" : 10, - "seed" : 0 - } - } - }, - "modifiers" : { - "initializeFrom" : "", - "variables" : [ ] - } - } - }, - "metadata" : { - "created" : "2025-04-11 19:30:49.453540583", - "lastModified" : "2025-04-11 19:30:49.453540583", - "name" : "Experiment 1" - } -} \ No newline at end of file diff --git a/Resources/ExperimentDefinitions/ThermofluidStream/HeatExchangers/Tests/CounterFlowNTU/Metadata.json b/Resources/ExperimentDefinitions/ThermofluidStream/HeatExchangers/Tests/CounterFlowNTU/Metadata.json deleted file mode 100644 index 9d91fe87..00000000 --- a/Resources/ExperimentDefinitions/ThermofluidStream/HeatExchangers/Tests/CounterFlowNTU/Metadata.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "defaultExperimentId" : "ba7c1233-77e4-4111-8ed0-ca9e33a7bf17" -} \ No newline at end of file diff --git a/Resources/ExperimentDefinitions/ThermofluidStream/HeatExchangers/Tests/CounterFlowNTU/experiment_1.json b/Resources/ExperimentDefinitions/ThermofluidStream/HeatExchangers/Tests/CounterFlowNTU/experiment_1.json deleted file mode 100644 index 955e7530..00000000 --- a/Resources/ExperimentDefinitions/ThermofluidStream/HeatExchangers/Tests/CounterFlowNTU/experiment_1.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "version" : "2", - "id" : "ba7c1233-77e4-4111-8ed0-ca9e33a7bf17", - "experiment" : { - "base" : { - "analysis" : { - "variableFilters" : [ ], - "selectedType" : "dynamic", - "choices" : [ { - "type" : "dynamic", - "parameters" : { - "final_time" : 100, - "interval" : 0.1, - "start_time" : 0 - }, - "simulationOptions" : { - "dynamic_diagnostics" : false, - "solver" : "CVode" - }, - "solverOptions" : { - "store_event_points" : true - }, - "compilerOptions" : { - "generate_html_diagnostics" : false, - "include_protected_variables" : false - }, - "runtimeOptions" : { } - } ], - "expansion" : { - "discreteAlgorithm" : { - "noOfSamples" : 0, - "seed" : 0 - }, - "continuousAlgorithm" : { - "type" : "SOBOL", - "noOfSamples" : 10, - "seed" : 0 - } - } - }, - "modifiers" : { - "initializeFrom" : "", - "variables" : [ ] - } - } - }, - "metadata" : { - "created" : "2025-04-14 18:39:36.186597856", - "lastModified" : "2025-04-14 18:39:36.186597856", - "name" : "Experiment 1" - } -} \ No newline at end of file diff --git a/Resources/Views/Examples/SimpleEngine/impact-analysis-dashboard-view-1984.json b/Resources/Views/Examples/SimpleEngine/impact-analysis-dashboard-view-1984.json deleted file mode 100644 index bb64c30d..00000000 --- a/Resources/Views/Examples/SimpleEngine/impact-analysis-dashboard-view-1984.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "stickies" : [ ], - "stickyPositions" : [ ], - "plots" : [ ], - "globalConfig" : { - "plot" : { - "common" : { - "showTitle" : true, - "colorMode" : "variable" - } - }, - "experiment" : { } - }, - "version" : "1", - "name" : "impact-analysis-dashboard-view-1984" -} \ No newline at end of file diff --git a/Resources/Views/ThermofluidStream/Examples/SimpleAirCycle/impact-analysis-dashboard-view-1984.json b/Resources/Views/ThermofluidStream/Examples/SimpleAirCycle/impact-analysis-dashboard-view-1984.json deleted file mode 100644 index bb64c30d..00000000 --- a/Resources/Views/ThermofluidStream/Examples/SimpleAirCycle/impact-analysis-dashboard-view-1984.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "stickies" : [ ], - "stickyPositions" : [ ], - "plots" : [ ], - "globalConfig" : { - "plot" : { - "common" : { - "showTitle" : true, - "colorMode" : "variable" - } - }, - "experiment" : { } - }, - "version" : "1", - "name" : "impact-analysis-dashboard-view-1984" -} \ No newline at end of file diff --git a/Resources/Views/ThermofluidStream/HeatExchangers/Internal/PartialCounterFlowInterface/impact-analysis-dashboard-view-1984.json b/Resources/Views/ThermofluidStream/HeatExchangers/Internal/PartialCounterFlowInterface/impact-analysis-dashboard-view-1984.json deleted file mode 100644 index bb64c30d..00000000 --- a/Resources/Views/ThermofluidStream/HeatExchangers/Internal/PartialCounterFlowInterface/impact-analysis-dashboard-view-1984.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "stickies" : [ ], - "stickyPositions" : [ ], - "plots" : [ ], - "globalConfig" : { - "plot" : { - "common" : { - "showTitle" : true, - "colorMode" : "variable" - } - }, - "experiment" : { } - }, - "version" : "1", - "name" : "impact-analysis-dashboard-view-1984" -} \ No newline at end of file diff --git a/Resources/Views/ThermofluidStream/HeatExchangers/Internal/PartialCrossFlowInterface/impact-analysis-dashboard-view-1984.json b/Resources/Views/ThermofluidStream/HeatExchangers/Internal/PartialCrossFlowInterface/impact-analysis-dashboard-view-1984.json deleted file mode 100644 index bb64c30d..00000000 --- a/Resources/Views/ThermofluidStream/HeatExchangers/Internal/PartialCrossFlowInterface/impact-analysis-dashboard-view-1984.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "stickies" : [ ], - "stickyPositions" : [ ], - "plots" : [ ], - "globalConfig" : { - "plot" : { - "common" : { - "showTitle" : true, - "colorMode" : "variable" - } - }, - "experiment" : { } - }, - "version" : "1", - "name" : "impact-analysis-dashboard-view-1984" -} \ No newline at end of file diff --git a/Resources/Views/ThermofluidStream/HeatExchangers/Internal/PartialDiscretizedHEXCounterFlow/impact-analysis-dashboard-view-1984.json b/Resources/Views/ThermofluidStream/HeatExchangers/Internal/PartialDiscretizedHEXCounterFlow/impact-analysis-dashboard-view-1984.json deleted file mode 100644 index bb64c30d..00000000 --- a/Resources/Views/ThermofluidStream/HeatExchangers/Internal/PartialDiscretizedHEXCounterFlow/impact-analysis-dashboard-view-1984.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "stickies" : [ ], - "stickyPositions" : [ ], - "plots" : [ ], - "globalConfig" : { - "plot" : { - "common" : { - "showTitle" : true, - "colorMode" : "variable" - } - }, - "experiment" : { } - }, - "version" : "1", - "name" : "impact-analysis-dashboard-view-1984" -} \ No newline at end of file diff --git a/Resources/Views/ThermofluidStream/HeatExchangers/Internal/PartialDiscretizedHEXCrossFlow/impact-analysis-dashboard-view-1984.json b/Resources/Views/ThermofluidStream/HeatExchangers/Internal/PartialDiscretizedHEXCrossFlow/impact-analysis-dashboard-view-1984.json deleted file mode 100644 index bb64c30d..00000000 --- a/Resources/Views/ThermofluidStream/HeatExchangers/Internal/PartialDiscretizedHEXCrossFlow/impact-analysis-dashboard-view-1984.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "stickies" : [ ], - "stickyPositions" : [ ], - "plots" : [ ], - "globalConfig" : { - "plot" : { - "common" : { - "showTitle" : true, - "colorMode" : "variable" - } - }, - "experiment" : { } - }, - "version" : "1", - "name" : "impact-analysis-dashboard-view-1984" -} \ No newline at end of file diff --git a/Resources/Views/ThermofluidStream/HeatExchangers/Internal/PartialNTUCounterFlow/impact-analysis-dashboard-view-1984.json b/Resources/Views/ThermofluidStream/HeatExchangers/Internal/PartialNTUCounterFlow/impact-analysis-dashboard-view-1984.json deleted file mode 100644 index bb64c30d..00000000 --- a/Resources/Views/ThermofluidStream/HeatExchangers/Internal/PartialNTUCounterFlow/impact-analysis-dashboard-view-1984.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "stickies" : [ ], - "stickyPositions" : [ ], - "plots" : [ ], - "globalConfig" : { - "plot" : { - "common" : { - "showTitle" : true, - "colorMode" : "variable" - } - }, - "experiment" : { } - }, - "version" : "1", - "name" : "impact-analysis-dashboard-view-1984" -} \ No newline at end of file From 7c9fae9b7b45e605230ee28b1ccc4e9c7b8313d4 Mon Sep 17 00:00:00 2001 From: Hubertus Tummescheit Date: Mon, 14 Apr 2025 16:21:32 -0400 Subject: [PATCH 5/8] Update project.json removed irrelevant things --- .impact/project.json | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/.impact/project.json b/.impact/project.json index b900b3b9..1bb9409a 100644 --- a/.impact/project.json +++ b/.impact/project.json @@ -46,37 +46,12 @@ "defaultDisabled": false, "id": "7c56884aa265475b8c6c388a6fa8326e" }, - { - "relpath": "ReferenceResults", - "contentType": "REFERENCE_RESULTS", - "defaultDisabled": false, - "id": "5b6e7f0fbc3248178e8a397ee3550195" - }, { "relpath": "Resources/ExperimentDefinitions", "contentType": "EXPERIMENT_DEFINITIONS", "defaultDisabled": false, "id": "7c0cf26cfdd04ff198522c9ea7d6298e" - }, - { - "relpath": "community", - "contentType": "GENERIC", - "defaultDisabled": true, - "id": "1452459b29cd4cde99434e8891e54284" - }, - { - "relpath": "doc", - "contentType": "GENERIC", - "defaultDisabled": true, - "id": "bf313e3c81f544e480257769f62ad69d" - }, - { - "relpath": "Examples", - "contentType": "MODELICA", - "name": "Examples", - "defaultDisabled": false, - "id": "030ebf9f6f814647b860ae6580b29725" } ], "executionOptions": [] -} \ No newline at end of file +} From c672db4b5a63c5416c439afdfd5e5d8ed1c08f1d Mon Sep 17 00:00:00 2001 From: Hubertus Tummescheit Date: Mon, 14 Apr 2025 16:28:24 -0400 Subject: [PATCH 6/8] removed failed attempts to refactor --- .../Internal/PartialCounterFlowInterface.mo | 31 ------------------- .../Internal/PartialCrossFlowInterface.mo | 31 ------------------- 2 files changed, 62 deletions(-) delete mode 100644 ThermofluidStream/HeatExchangers/Internal/PartialCounterFlowInterface.mo delete mode 100644 ThermofluidStream/HeatExchangers/Internal/PartialCrossFlowInterface.mo diff --git a/ThermofluidStream/HeatExchangers/Internal/PartialCounterFlowInterface.mo b/ThermofluidStream/HeatExchangers/Internal/PartialCounterFlowInterface.mo deleted file mode 100644 index 48eed13a..00000000 --- a/ThermofluidStream/HeatExchangers/Internal/PartialCounterFlowInterface.mo +++ /dev/null @@ -1,31 +0,0 @@ -within ThermofluidStream.HeatExchangers.Internal; - -partial model PartialCounterFlowInterface "Partial heat exchanger icon and connectors for cross flow" - -replaceable package MediumA = ThermofluidStream.Media.myMedia.Interfaces.PartialMedium "Medium model A" - annotation (choicesAllMatching=true); - replaceable package MediumB = ThermofluidStream.Media.myMedia.Interfaces.PartialMedium "Medium model B" - annotation (choicesAllMatching=true); - - .ThermofluidStream.Interfaces.Inlet inletA(redeclare package Medium = MediumA) annotation (Placement(transformation( - extent={{-20,-20},{20,20}}, - rotation=0, - origin={-100,-60}), iconTransformation(extent={{-120,-80},{-80,-40}}))); - .ThermofluidStream.Interfaces.Outlet outletA(redeclare package Medium = MediumA) annotation (Placement(transformation( - extent={{-20,-20},{20,20}}, - rotation=0, - origin={100,-60}), iconTransformation(extent={{80,-80},{120,-40}}))); - .ThermofluidStream.Interfaces.Inlet inletB(redeclare package Medium = MediumB) annotation (Placement(transformation( - extent={{20,-20},{-20,20}}, - rotation=0, - origin={100,60}), iconTransformation(extent={{120,80},{80,40}}))); - .ThermofluidStream.Interfaces.Outlet outletB(redeclare package Medium = MediumB) annotation (Placement(transformation( - extent={{20,-20},{-20,20}}, - rotation=0, - origin={-100,60}), iconTransformation(extent={{-80,80},{-120,40}}))); - - annotation (Documentation(info=" -

-This is the partial parent class for all heat exchangers in counter flow configuration. -")); -end PartialCounterFlowInterface; diff --git a/ThermofluidStream/HeatExchangers/Internal/PartialCrossFlowInterface.mo b/ThermofluidStream/HeatExchangers/Internal/PartialCrossFlowInterface.mo deleted file mode 100644 index 8bdd40e2..00000000 --- a/ThermofluidStream/HeatExchangers/Internal/PartialCrossFlowInterface.mo +++ /dev/null @@ -1,31 +0,0 @@ -within ThermofluidStream.HeatExchangers.Internal; - -partial model PartialCrossFlowInterface "Partial heat exchanger icon and connectors for cross flow" - - replaceable package MediumA = ThermofluidStream.Media.myMedia.Interfaces.PartialMedium "Medium model A" - annotation (choicesAllMatching=true); - replaceable package MediumB = ThermofluidStream.Media.myMedia.Interfaces.PartialMedium "Medium model B" - annotation (choicesAllMatching=true); - - ThermofluidStream.Interfaces.Inlet inletA(redeclare package Medium = MediumA) annotation (Placement(transformation( - extent={{-20,-20},{20,20}}, - rotation=0, - origin={-100,-60}), iconTransformation(extent={{-120,-20},{-80,20}}))); - ThermofluidStream.Interfaces.Outlet outletA(redeclare package Medium = MediumA) annotation (Placement(transformation( - extent={{-20,-20},{20,20}}, - rotation=0, - origin={100,-60}), iconTransformation(extent= {{80,-20},{120,20}}))); - ThermofluidStream.Interfaces.Inlet inletB(redeclare package Medium = MediumB) annotation (Placement(transformation( - extent={{20,-20},{-20,20}}, - rotation=0, - origin={100,60}), iconTransformation(extent={{-120,-20},{-80,20}}, rotation=-90))); - ThermofluidStream.Interfaces.Outlet outletB(redeclare package Medium = MediumB) annotation (Placement(transformation( - extent={{20,-20},{-20,20}}, - rotation=0, - origin={-100,60}), iconTransformation(extent={{80,-20},{120,20}}, rotation=-90))); - - annotation (Documentation(info=" -

-This is the partial parent class for all heat exchangers cross flow configuration. -")); -end PartialCrossFlowInterface; From c443b2285f8141abb9ac2e8f9c4c1f2684952f79 Mon Sep 17 00:00:00 2001 From: Hubertus Tummescheit Date: Wed, 16 Apr 2025 16:11:38 -0400 Subject: [PATCH 7/8] Update project.json --- .impact/project.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.impact/project.json b/.impact/project.json index 1bb9409a..a29838d8 100644 --- a/.impact/project.json +++ b/.impact/project.json @@ -11,7 +11,7 @@ { "relpath": "ThermofluidStream", "contentType": "MODELICA", - "name": "ThermofluidStrea", + "name": "ThermofluidStream", "defaultDisabled": false, "id": "e74f4457bc544294b6e50858706270d6" }, From 4ee763ba10466dfc10d65427e1ef99a6405cffcb Mon Sep 17 00:00:00 2001 From: Hubertus Tummescheit Date: Wed, 16 Apr 2025 16:14:49 -0400 Subject: [PATCH 8/8] Update .impact/project.json accepted suggestion Co-authored-by: tobolar --- .impact/project.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.impact/project.json b/.impact/project.json index a29838d8..779c9bb8 100644 --- a/.impact/project.json +++ b/.impact/project.json @@ -1,5 +1,5 @@ { - "name": "Thermofluidstream", + "name": "ThermofluidStream", "format": "1.0.0", "dependencies": [ {