Skip to content

Commit 97a1987

Browse files
committed
3. Variant with choicesAllMatching = true
1 parent e6b1db9 commit 97a1987

8 files changed

Lines changed: 19 additions & 3 deletions

File tree

VirtualFCS/Examples/SubsystemExamples/TestCoolingSubsystem.mo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ within VirtualFCS.Examples.SubsystemExamples;
33
model TestCoolingSubsystem "Example to evaluate the performance of the cooling subsystem."
44
extends Modelica.Icons.Example;
55
replaceable package Medium = Modelica.Media.Water.ConstantPropertyLiquidWater;
6-
VirtualFCS.SubSystems.Cooling.SubSystemCooling subSystemCooling annotation(
6+
VirtualFCS.SubSystems.Cooling.SubSystemCooling subSystemCooling(redeclare VirtualFCS.Utilities.SystemRecords.HydrogenDataPlantC hydrogenData) annotation(
77
Placement(visible = true, transformation(origin = {0, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));
88
Modelica.Blocks.Sources.Constant getTermperature(k = 273.15 + 80) annotation(
99
Placement(visible = true, transformation(origin = {-60, 10}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));

VirtualFCS/Examples/SubsystemExamples/TestHydrogenSubsystem.mo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ model TestHydrogenSubsystem "Example to evaluate the performance of the hydrogen
77
Placement(visible = true, transformation(origin = {0, 40}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
88
Modelica.Fluid.Sources.MassFlowSource_T boundary(redeclare package Medium = Anode_Medium, nPorts = 1, use_m_flow_in = true) annotation(
99
Placement(visible = true, transformation(origin = {0, 72}, extent = {{10, -10}, {-10, 10}}, rotation = 90)));
10-
VirtualFCS.SubSystems.Hydrogen.SubSystemHydrogen subSystemHydrogen annotation(
10+
VirtualFCS.SubSystems.Hydrogen.SubSystemHydrogen subSystemHydrogen(redeclare VirtualFCS.Utilities.SystemRecords.HydrogenDataPlantD hydrogenData) annotation(
1111
Placement(visible = true, transformation(origin = {-0.999964, -0.666637}, extent = {{-30, -20}, {30, 20}}, rotation = 0)));
1212
Modelica.Blocks.Math.Gain gain(k = -0.00202 * 1 / (96485 * 2)) annotation(
1313
Placement(visible = true, transformation(origin = {-34, 80}, extent = {{-8, -8}, {8, 8}}, rotation = 0)));

VirtualFCS/SubSystems/Cooling/SubSystemCooling.mo

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ model SubSystemCooling
4242
Placement(visible = true, transformation(origin = {68, 16}, extent = {{-10, 10}, {10, -10}}, rotation = 0)));
4343
VirtualFCS.Thermal.HeatSink heatSink(redeclare package Medium = Coolant_Medium) annotation(
4444
Placement(visible = true, transformation(origin = {-20, -26}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
45+
inner replaceable VirtualFCS.Utilities.SystemRecords.HydrogenData hydrogenData annotation(choicesAllMatching = true,
46+
Placement(visible = true, transformation(origin = {90, 90}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
4547
equation
4648
//*** DEFINE CONNECTIONS ***//
4749
connect(tankCoolant.ports[1], teeJunctionTankCoolant.port_3) annotation(

VirtualFCS/SubSystems/Hydrogen/SubSystemHydrogen.mo

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ model SubSystemHydrogen
7070
Placement(visible = true, transformation(origin = {-60, 116}, extent = {{15, -10}, {-15, 10}}, rotation = 0)));
7171
Modelica.Thermal.HeatTransfer.Components.BodyRadiation bodyRadiation(Gr = 0.95 * A_tank_H2) annotation(
7272
Placement(visible = true, transformation(origin = {-140, 116}, extent = {{10, -10}, {-10, 10}}, rotation = -90)));
73+
inner replaceable VirtualFCS.Utilities.SystemRecords.HydrogenData hydrogenData annotation(choicesAllMatching = true,
74+
Placement(visible = true, transformation(origin = {130, 52}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
7375
equation
7476
//*** DEFINE CONNECTIONS ***//
7577
connect(sensors, multiplex.y) annotation(

VirtualFCS/Utilities/SystemRecords/HydrogenData.mo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
within VirtualFCS.Utilities.SystemRecords;
22

3-
record HydrogenData
3+
record HydrogenData "Generic Plant Data"
44
extends Modelica.Icons.Record;
55
parameter Real PumpSpeed_k = 1 "Gain for the pump speed controller"
66
annotation(Dialog(group = "Speed controller"));
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
within VirtualFCS.Utilities.SystemRecords;
2+
3+
record HydrogenDataPlantC "Data set for Plant C"
4+
extends VirtualFCS.Utilities.SystemRecords.HydrogenData(PumpSpeed_k=50);
5+
end HydrogenDataPlantC;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
within VirtualFCS.Utilities.SystemRecords;
2+
3+
record HydrogenDataPlantD
4+
extends VirtualFCS.Utilities.SystemRecords.HydrogenData(PumpSpeed_Td = 23, PumpSpeed_k = 14, Pump_N_nominal = 500);
5+
end HydrogenDataPlantD;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
HydrogenData
22
HydrogenDataPlantA
33
HydrogenDataPlantB
4+
HydrogenDataPlantC
5+
HydrogenDataPlantD

0 commit comments

Comments
 (0)