Skip to content

Commit

Permalink
3. Variant with choicesAllMatching = true
Browse files Browse the repository at this point in the history
  • Loading branch information
dietmarw committed Nov 4, 2022
1 parent 40783de commit 6203c3a
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ within VirtualFCS.Examples.SubsystemExamples;
model TestCoolingSubsystem "Example to evaluate the performance of the cooling subsystem."
extends Modelica.Icons.Example;
replaceable package Medium = Modelica.Media.Water.ConstantPropertyLiquidWater;
VirtualFCS.SubSystems.Cooling.SubSystemCooling subSystemCooling annotation(
VirtualFCS.SubSystems.Cooling.SubSystemCooling subSystemCooling(redeclare VirtualFCS.Utilities.SystemRecords.HydrogenDataPlantC hydrogenData) annotation(
Placement(visible = true, transformation(origin = {0, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));
Modelica.Blocks.Sources.Constant getTermperature(k = 273.15 + 80) annotation(
Placement(visible = true, transformation(origin = {-60, 10}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ model TestHydrogenSubsystem "Example to evaluate the performance of the hydrogen
Placement(visible = true, transformation(origin = {0, 40}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Fluid.Sources.MassFlowSource_T boundary(redeclare package Medium = Anode_Medium, nPorts = 1, use_m_flow_in = true) annotation(
Placement(visible = true, transformation(origin = {0, 72}, extent = {{10, -10}, {-10, 10}}, rotation = 90)));
VirtualFCS.SubSystems.Hydrogen.SubSystemHydrogen subSystemHydrogen annotation(
VirtualFCS.SubSystems.Hydrogen.SubSystemHydrogen subSystemHydrogen(redeclare VirtualFCS.Utilities.SystemRecords.HydrogenDataPlantD hydrogenData) annotation(
Placement(visible = true, transformation(origin = {-0.999964, -0.666637}, extent = {{-30, -20}, {30, 20}}, rotation = 0)));
Modelica.Blocks.Math.Gain gain(k = -0.00202 * 1 / (96485 * 2)) annotation(
Placement(visible = true, transformation(origin = {-34, 80}, extent = {{-8, -8}, {8, 8}}, rotation = 0)));
Expand Down
2 changes: 2 additions & 0 deletions VirtualFCS/SubSystems/Cooling/SubSystemCooling.mo
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ model SubSystemCooling
Placement(visible = true, transformation(origin = {68, 16}, extent = {{-10, 10}, {10, -10}}, rotation = 0)));
VirtualFCS.Thermal.HeatSink heatSink(redeclare package Medium = Coolant_Medium) annotation(
Placement(visible = true, transformation(origin = {-20, -26}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
inner replaceable VirtualFCS.Utilities.SystemRecords.HydrogenData hydrogenData annotation(choicesAllMatching = true,
Placement(visible = true, transformation(origin = {90, 90}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
equation
//*** DEFINE CONNECTIONS ***//
connect(tankCoolant.ports[1], teeJunctionTankCoolant.port_3) annotation(
Expand Down
2 changes: 2 additions & 0 deletions VirtualFCS/SubSystems/Hydrogen/SubSystemHydrogen.mo
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ model SubSystemHydrogen
Placement(visible = true, transformation(origin = {-60, 116}, extent = {{15, -10}, {-15, 10}}, rotation = 0)));
Modelica.Thermal.HeatTransfer.Components.BodyRadiation bodyRadiation(Gr = 0.95 * A_tank_H2) annotation(
Placement(visible = true, transformation(origin = {-140, 116}, extent = {{10, -10}, {-10, 10}}, rotation = -90)));
inner replaceable VirtualFCS.Utilities.SystemRecords.HydrogenData hydrogenData annotation(choicesAllMatching = true,
Placement(visible = true, transformation(origin = {130, 52}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
equation
//*** DEFINE CONNECTIONS ***//
connect(sensors, multiplex.y) annotation(
Expand Down
2 changes: 1 addition & 1 deletion VirtualFCS/Utilities/SystemRecords/HydrogenData.mo
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
within VirtualFCS.Utilities.SystemRecords;

record HydrogenData
record HydrogenData "Generic Plant Data"
extends Modelica.Icons.Record;
parameter Real PumpSpeed_k = 1 "Gain for the pump speed controller"
annotation(Dialog(group = "Speed controller"));
Expand Down
5 changes: 5 additions & 0 deletions VirtualFCS/Utilities/SystemRecords/HydrogenDataPlantC.mo
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
within VirtualFCS.Utilities.SystemRecords;

record HydrogenDataPlantC "Data set for Plant C"
extends VirtualFCS.Utilities.SystemRecords.HydrogenData(PumpSpeed_k=50);
end HydrogenDataPlantC;
5 changes: 5 additions & 0 deletions VirtualFCS/Utilities/SystemRecords/HydrogenDataPlantD.mo
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
within VirtualFCS.Utilities.SystemRecords;

record HydrogenDataPlantD
extends VirtualFCS.Utilities.SystemRecords.HydrogenData(PumpSpeed_Td = 23, PumpSpeed_k = 14, Pump_N_nominal = 500);
end HydrogenDataPlantD;
2 changes: 2 additions & 0 deletions VirtualFCS/Utilities/SystemRecords/package.order
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
HydrogenData
HydrogenDataPlantA
HydrogenDataPlantB
HydrogenDataPlantC
HydrogenDataPlantD

0 comments on commit 6203c3a

Please sign in to comment.