Skip to content

Commit 986a9c9

Browse files
authored
adding faulty mode to CCG specific components (#279)
* adding faulty mode to CCG specific components * no more max value for filter_Kfr fouling * again : changing Kfr ;p
1 parent b84cabd commit 986a9c9

File tree

14 files changed

+134
-12
lines changed

14 files changed

+134
-12
lines changed

MetroscopeModelingLibrary/MultiFluid/HeatExchangers/Evaporator.mo

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ model Evaporator
3131
Units.Temperature T_cold_out;
3232
Units.Temperature T_hot_out;
3333

34+
// Failure modes
35+
parameter Boolean faulty = false;
36+
Units.Percentage fouling(min = 0, max=100); // Fouling percentage
37+
3438
// Initialization parameters
3539
parameter Units.MassFlowRate Q_cold_0 = 500;
3640
parameter Units.MassFlowRate Q_hot_0 = 50;
@@ -77,6 +81,11 @@ model Evaporator
7781
WaterSteam.Connectors.Outlet C_cold_out annotation (Placement(transformation(extent={{-40,60},{-20,80}}), iconTransformation(extent={{-40,60},{-20,80}})));
7882

7983
equation
84+
// Failure modes
85+
if not faulty then
86+
fouling = 0;
87+
end if;
88+
8089
// Definitions
8190
Q_cold = cold_side_heating.Q;
8291
Q_hot = hot_side_vaporising.Q;
@@ -115,7 +124,7 @@ equation
115124
cold_side_vaporising.h_out = x_steam_out * h_vap_sat + (1-x_steam_out)*h_liq_sat;
116125

117126
HX_vaporising.W = W_vaporising;
118-
HX_vaporising.Kth = Kth;
127+
HX_vaporising.Kth = Kth*(1-fouling/100);
119128
HX_vaporising.S = S_vaporising;
120129
HX_vaporising.Q_cold = Q_cold;
121130
HX_vaporising.Q_hot = Q_hot;

MetroscopeModelingLibrary/MultiFluid/HeatExchangers/FuelHeater.mo

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ model FuelHeater
2525
Units.Temperature T_hot_in;
2626
Units.Temperature T_hot_out;
2727

28+
// Failure modes
29+
parameter Boolean faulty = false;
30+
Units.Percentage fouling(min = 0, max=100); // Fouling percentage
31+
2832
// Initialization parameters
2933
parameter Units.MassFlowRate Q_cold_0 = 500;
3034
parameter Units.MassFlowRate Q_hot_0 = 50;
@@ -57,6 +61,12 @@ model FuelHeater
5761
Fuel.Pipes.Pipe cold_side_pipe annotation (Placement(transformation(extent={{-52,-10},{-32,10}})));
5862
Fuel.BaseClasses.IsoPFlowModel cold_side annotation (Placement(transformation(extent={{0,-10},{20,10}})));
5963
equation
64+
65+
// Failure modes
66+
if not faulty then
67+
fouling = 0;
68+
end if;
69+
6070
// Definitions
6171
Q_cold = cold_side.Q;
6272
Q_hot = hot_side.Q;
@@ -78,7 +88,7 @@ equation
7888
// Power Exchange
7989
HX.W = W;
8090
HX.S = S;
81-
HX.Kth = Kth;
91+
HX.Kth = Kth*(1-fouling/100);
8292
HX.Q_cold = Q_cold;
8393
HX.Q_hot = Q_hot;
8494
HX.T_cold_in = T_cold_in;

MetroscopeModelingLibrary/Partial/HeatExchangers/hrsg_monophasic_HX.mo

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ partial model hrsg_monophasic_HX
2323
Units.Temperature T_cold_out;
2424
Units.Temperature T_hot_out;
2525

26+
// Failure modes
27+
parameter Boolean faulty = false;
28+
Units.Percentage fouling(min = 0, max=100); // Fouling percentage
29+
2630
// Initialization parameters
2731
parameter Units.MassFlowRate Q_cold_0 = 500;
2832
parameter Units.MassFlowRate Q_hot_0 = 50;
@@ -69,6 +73,11 @@ protected
6973
MetroscopeModelingLibrary.Media.FlueGasesMedium.ThermodynamicState state_hot_out; // estimation of the flue gases outlet thermodynamic state
7074

7175
equation
76+
// Failure modes
77+
if not faulty then
78+
fouling = 0;
79+
end if;
80+
7281
// Definitions
7382
Q_cold =cold_side.Q;
7483
Q_hot =hot_side.Q;
@@ -89,7 +98,7 @@ equation
8998

9099
// Power Exchange
91100
HX.W = W;
92-
HX.Kth = Kth;
101+
HX.Kth = Kth*(1-fouling/100);
93102
HX.S = S;
94103
HX.Q_cold = Q_cold;
95104
HX.Q_hot = Q_hot;

MetroscopeModelingLibrary/Partial/Pipes/Pipe.mo

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,19 @@ partial model Pipe
99
Inputs.InputDifferentialHeight delta_z(nominal=5) "Height difference between outlet and inlet";
1010
Units.DifferentialPressure DP_f "Singular pressure loss";
1111
Units.DifferentialPressure DP_z "Singular pressure loss";
12+
13+
// Failure modes
14+
parameter Boolean faulty = false;
15+
Real fouling; // Fouling coefficient
16+
1217
equation
13-
DP_f = -Kfr * Q^2 / rho;
18+
19+
// Failure modes
20+
if not faulty then
21+
fouling = 0;
22+
end if;
23+
24+
DP_f = - (1+ fouling) * Kfr * Q^2 / rho;
1425
DP_z = -rho * Constants.g * delta_z;
1526

1627
DP = DP_f + DP_z;
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
within MetroscopeModelingLibrary.Tests.FlueGases.Pipes;
2+
model Filter_faulty
3+
extends Filter_direct(filter(faulty=true));
4+
5+
Real Failure_fouling(start=0);
6+
7+
equation
8+
9+
// Failure input
10+
Failure_fouling = 0 + 1*time;
11+
12+
// Failure definition
13+
filter.fouling = Failure_fouling;
14+
annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)));
15+
end Filter_faulty;

MetroscopeModelingLibrary/Tests/FlueGases/Pipes/package.order

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ Pipe_direct
22
Pipe_reverse
33
Filter_direct
44
Filter_reverse
5+
Filter_faulty

MetroscopeModelingLibrary/Tests/Multifluid/HeatExchangers/Economiser_direct.mo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ equation
5353

5454
connect(economiser.C_cold_in, cold_source.C_out) annotation (Line(points={{1,7},{0,7},{0,30},{10,30},{10,39}}, color={28,108,200}));
5555
connect(economiser.C_hot_out, hot_sink.C_in) annotation (Line(points={{5,0},{63,0}}, color={95,95,95}));
56-
connect(economiser.C_cold_out, cold_sink.C_in) annotation (Line(points={{-5,-7},{-5,-41},{-12,-41}}, color={28,108,200}));
56+
connect(economiser.C_cold_out, cold_sink.C_in) annotation (Line(points={{-5,7},{-5,-41},{-12,-41}}, color={28,108,200}));
5757
connect(economiser.C_hot_in, hot_source.C_out) annotation (Line(points={{-9,0},{-49,0}}, color={95,95,95}));
5858
annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={
5959
Ellipse(lineColor = {75,138,73},
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
within MetroscopeModelingLibrary.Tests.Multifluid.HeatExchangers;
2+
model Economiser_faulty
3+
extends Economiser_direct(economiser(faulty=true));
4+
5+
Real Failure_fouling(start=0);
6+
7+
equation
8+
9+
// Failure input
10+
Failure_fouling = 0 + 10*time;
11+
12+
// Failure definition
13+
economiser.fouling = Failure_fouling;
14+
15+
annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)));
16+
end Economiser_faulty;
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
within MetroscopeModelingLibrary.Tests.Multifluid.HeatExchangers;
2+
model Evaporator_faulty
3+
extends Evaporator_direct(evaporator(faulty=true));
4+
5+
Real Failure_fouling(start=0);
6+
7+
equation
8+
9+
// Failure input
10+
Failure_fouling = 0 + 10*time;
11+
12+
// Failure definition
13+
evaporator.fouling = Failure_fouling;
14+
15+
annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)));
16+
end Evaporator_faulty;

MetroscopeModelingLibrary/Tests/Multifluid/HeatExchangers/FuelHeater_direct.mo

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ equation
4848

4949
connect(fuelHeater.C_cold_in, cold_source.C_out) annotation (Line(points={{-35,0},{-63,0}}, color={213,213,0}));
5050
connect(fuelHeater.C_cold_out, cold_sink.C_in) annotation (Line(points={{35,0},{65,0}}, color={213,213,0}));
51-
connect(fuelHeater.C_hot_out, hot_sink.C_in) annotation (Line(points={{-15,33.6},{-14,33.6},{-14,57}}, color={28,108,200}));
52-
connect(fuelHeater.C_hot_in, hot_source.C_out) annotation (Line(points={{15,33.6},{16,33.6},{16,57}}, color={28,108,200}));
51+
connect(fuelHeater.C_hot_out, hot_sink.C_in) annotation (Line(points={{-20,-33.6},{-14,-33.6},{-14,57}},
52+
color={28,108,200}));
53+
connect(fuelHeater.C_hot_in, hot_source.C_out) annotation (Line(points={{20,33.6},{16,33.6},{16,57}}, color={28,108,200}));
5354
annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)));
5455
end FuelHeater_direct;

0 commit comments

Comments
 (0)