-
Notifications
You must be signed in to change notification settings - Fork 2
added : LMTD heat exchange function, LMTDfuelHeater componenent and u… #266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
465e7d4
added : LMTD heat exchange function, LMTDfuelHeater componenent and u…
helenev-met 6328269
Update CHANGELOG.md
helenev-met 488a08f
Merge branch 'mml3-main' into HV_fuelHeater
helenev-met 73811c6
added : LMTD heat exchange function, LMTDfuelHeater componenent and u…
helenev-met 46add86
Merge branch 'HV_fuelHeater' of github.com:Metroscope-dev/metroscope-…
helenev-met 874088d
mise à jour du LMTDFuelHEater
helenev-met 9035161
modif related to PEP PR comment
helenev-met f866dd6
changing : test to check QCpmin < QCmax raises warning instead of an …
helenev-met c4272f6
adding heat loss for flue gases
helenev-met 6c25087
Merge branch 'mml3-main' into HV_fuelHeater
helenev-met 34e7a9b
Merge branch 'mml3-main' into HV_fuelHeater
helenev-met 8e578aa
adding start values to LMTDFuelHeater
helenev-met bb7bb0e
last modif on LMTD
helenev-met 6655d6a
Failure mode in LMTFuelHeater
helenev-met f08d038
changing fluegases heat loss icon
helenev-met 4ca8d20
Update CHANGELOG.md
helenev-met e83e440
last changes
helenev-met File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
101 changes: 101 additions & 0 deletions
101
MetroscopeModelingLibrary/MultiFluid/HeatExchangers/LMTDFuelHeater.mo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,101 @@ | ||
| within MetroscopeModelingLibrary.MultiFluid.HeatExchangers; | ||
| model LMTDFuelHeater | ||
|
|
||
| extends MetroscopeModelingLibrary.Icons.KeepingScaleIcon; | ||
| package WaterSteamMedium = MetroscopeModelingLibrary.Media.WaterSteamMedium; | ||
| package FuelMedium = MetroscopeModelingLibrary.Media.FuelMedium; | ||
| import MetroscopeModelingLibrary.Units; | ||
| import MetroscopeModelingLibrary.Units.Inputs; | ||
|
|
||
| // Pressure Losses | ||
| Inputs.InputFrictionCoefficient Kfr_cold; | ||
| Inputs.InputFrictionCoefficient Kfr_hot; | ||
|
|
||
| // Heating | ||
| Inputs.InputArea S; | ||
| Inputs.InputHeatExchangeCoefficient Kth; | ||
| Units.Power W; | ||
|
|
||
| // Definitions | ||
| Units.MassFlowRate Q_cold; | ||
| Units.MassFlowRate Q_hot; | ||
| Units.Temperature T_cold_in; | ||
| Units.Temperature T_cold_out; | ||
| Units.Temperature T_hot_in; | ||
| Units.Temperature T_hot_out; | ||
|
|
||
| // Initialization parameters | ||
| parameter Units.MassFlowRate Q_cold_0 = 12; | ||
| parameter Units.MassFlowRate Q_hot_0 = 8.6; | ||
| parameter Units.Temperature T_cold_in_0 = 29.5 + 273.15; | ||
| parameter Units.Temperature T_hot_in_0 = 230 +273.15; | ||
| parameter Units.Pressure P_cold_in_0 = 29.7 *1e5; | ||
| parameter Units.Pressure P_hot_in_0 = 47 *1e5; | ||
helenev-met marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| Power.HeatExchange.LMTDHeatExchange HX( | ||
| T_cold_in_0=T_cold_in_0) annotation (Placement(transformation( | ||
| extent={{-10,10},{10,-10}}, | ||
| rotation=0, | ||
| origin={10,14}))); | ||
helenev-met marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| WaterSteam.BaseClasses.IsoPFlowModel hot_side( | ||
| Q_0=Q_hot_0, | ||
| T_in_0=T_hot_in_0, | ||
| P_in_0=P_hot_in_0) annotation (Placement(transformation( | ||
| extent={{10,10},{-10,-10}}, | ||
| rotation=0, | ||
| origin={10,28}))); | ||
| WaterSteam.Pipes.Pipe hot_side_pipe(Q_0=Q_hot_0, T_in_0=T_hot_in_0) annotation (Placement(transformation( | ||
| extent={{10,-10},{-10,10}}, | ||
| rotation=90, | ||
| origin={-14,-24}))); | ||
| Fuel.Pipes.Pipe cold_side_pipe annotation (Placement(transformation(extent={{-52,-10},{-32,10}}))); | ||
| Fuel.BaseClasses.IsoPFlowModel cold_side annotation (Placement(transformation(extent={{0,-10},{20,10}}))); | ||
| Fuel.Connectors.Inlet C_cold_in annotation (Placement(transformation(extent={{-80,-10},{-60,10}}), iconTransformation(extent={{-80,-10},{-60,10}}))); | ||
pierre-eliep-met marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| Fuel.Connectors.Outlet C_cold_out annotation (Placement(transformation(extent={{60,-10},{80,10}}), iconTransformation(extent={{60,-10},{80,10}}))); | ||
| WaterSteam.Connectors.Inlet C_hot_in annotation (Placement(transformation(extent={{30,60},{50,80}}), iconTransformation(extent={{30,60},{50,80}}))); | ||
pierre-eliep-met marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| WaterSteam.Connectors.Outlet C_hot_out annotation (Placement(transformation(extent={{-50,-80},{-30,-60}}), | ||
| iconTransformation(extent={{-50,-80},{-30,-60}}))); | ||
| equation | ||
| // Definitions | ||
| Q_cold = cold_side.Q; | ||
| Q_hot = hot_side.Q; | ||
| T_cold_in = cold_side.T_in; | ||
| T_cold_out = cold_side.T_out; | ||
| T_hot_in = hot_side.T_in; | ||
| T_hot_out = hot_side.T_out; | ||
| cold_side.W = W; | ||
|
|
||
| // Energy balance | ||
| hot_side.W + cold_side.W = 0; | ||
|
|
||
| // Pressure losses | ||
| cold_side_pipe.delta_z = 0; | ||
| cold_side_pipe.Kfr = Kfr_cold; | ||
| hot_side_pipe.delta_z = 0; | ||
| hot_side_pipe.Kfr = Kfr_hot; | ||
|
|
||
| // Power Exchange | ||
| HX.W = W; | ||
| HX.S = S; | ||
| HX.Kth = Kth; | ||
| HX.T_cold_in = T_cold_in; | ||
| HX.T_hot_in = T_hot_in; | ||
| HX.T_cold_out = T_cold_out; | ||
| HX.T_hot_out = T_hot_out; | ||
| connect(hot_side_pipe.C_out,C_hot_out) annotation (Line(points={{-14,-34},{-14,-70},{-40,-70}}, color={28,108,200})); | ||
| connect(hot_side_pipe.C_in,hot_side. C_out) annotation (Line(points={{-14,-14},{-14,28},{0,28}},color={28,108,200})); | ||
helenev-met marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| connect(hot_side.C_in,C_hot_in) annotation (Line(points={{20,28},{40,28},{40,70}}, color={28,108,200})); | ||
| connect(cold_side_pipe.C_in,C_cold_in) annotation (Line(points={{-52,0},{-70,0}}, color={213,213,0})); | ||
| connect(cold_side_pipe.C_out,cold_side. C_in) annotation (Line(points={{-32,0},{0,0}}, color={213,213,0})); | ||
helenev-met marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| connect(cold_side.C_out,C_cold_out) annotation (Line(points={{20,0},{70,0}}, color={213,213,0})); | ||
| annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ | ||
| Rectangle( | ||
| extent={{-70,50},{70,-50}}, | ||
| lineColor={0,0,0}, | ||
| fillColor={226,230,140}, | ||
| fillPattern=FillPattern.Solid), Line( | ||
| points={{40,66},{40,-60},{20,-60},{20,64},{0,64},{0,-60},{-20,-60},{-20,65.6309},{-40,66},{-40,-66}}, | ||
| color={28,108,200}, | ||
| thickness=1, | ||
| smooth=Smooth.Bezier)}), Diagram(coordinateSystem(preserveAspectRatio=false))); | ||
| end LMTDFuelHeater; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,3 +2,4 @@ Economiser | |
| Superheater | ||
| Evaporator | ||
| FuelHeater | ||
| LMTDFuelHeater | ||
56 changes: 56 additions & 0 deletions
56
MetroscopeModelingLibrary/Power/HeatExchange/LMTDHeatExchange.mo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| within MetroscopeModelingLibrary.Power.HeatExchange; | ||
| model LMTDHeatExchange | ||
| import MetroscopeModelingLibrary.Units.Inputs; | ||
| import MetroscopeModelingLibrary.Units; | ||
|
|
||
| // Initialization parameters | ||
| parameter Units.Temperature T_hot_in_0 = 273.15 + 200 "Init parameter for Hot mass flow rate at the inlet"; | ||
| parameter Units.Temperature T_cold_in_0 = 273.15 + 100 "Init parameter for Cold mass flow rate at the inlet"; | ||
| parameter Units.Temperature T_hot_out_0 = 273.15 + 200 "Init parameter for Hot mass flow rate at the outlet"; | ||
| parameter Units.Temperature T_cold_out_0 = 273.15 + 100 "Init parameter for Cold mass flow rate at the outlet"; | ||
helenev-met marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
helenev-met marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| parameter Units.Area S_0 = 100 "init parameter for Heat exchange surface"; | ||
helenev-met marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| parameter Units.HeatExchangeCoefficient Kth_0 = 5000 "init parameter for Heat exchange coefficient"; | ||
|
|
||
| /* Exchanger configuration and parameters */ | ||
| //parameter String config = "LMTD_monophasic_counter_current"; No need for parameter as long as there is only one configuration !! | ||
| Inputs.InputArea S(start=S_0) "Heat exchange surface"; | ||
| Inputs.InputHeatExchangeCoefficient Kth(start=Kth_0) "Heat exchange coefficient"; | ||
|
|
||
| /* Exchanger output */ | ||
| Units.Power W(start=1e4); | ||
|
|
||
| /* Exchanger boundary conditions */ | ||
| Inputs.InputTemperature T_hot_in(start=T_hot_in_0) "Temperature, hot side, at the inlet"; | ||
| Inputs.InputTemperature T_cold_in(start=T_cold_in_0) "Temperature, cold side, at the inlet"; | ||
| Inputs.InputTemperature T_hot_out(start=T_hot_out_0) "Temperature, hot side, at the outlet"; | ||
| Inputs.InputTemperature T_cold_out(start=T_cold_out_0) "Temperature, cold side, at the outlet"; | ||
|
|
||
| // intermediate variables | ||
| Real dT_a(start = 15); | ||
| Real dT_b(start=1); | ||
helenev-met marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| equation | ||
|
|
||
| dT_a = T_hot_in - T_cold_out; | ||
| dT_b = T_hot_out - T_cold_in; | ||
|
|
||
| // Log mean equation written in an exponential way | ||
| 0 = - dT_a + dT_b * exp(Kth*S*(dT_a - dT_b)/W); | ||
|
|
||
|
|
||
| annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ | ||
| Polygon( | ||
| points={{-66,-72},{-48,-72},{-48,-66},{-50,-54},{-54,-44},{-58,-34},{-60,-28},{-60,-16},{-60,-8},{-54,8},{-52,12},{-50,20},{-48,30},{-48,36},{-32,36},{-56,68},{-56,68},{-80,36},{-64,36},{-64,30},{-66,24},{-68,16},{-72,8},{-74,2},{-76,-6},{-76,-16},{-76,-28},{-74,-36},{-70,-48},{-66,-58},{-66,-72}}, | ||
| lineColor={255,170,255}, | ||
| fillColor={255,170,255}, | ||
| fillPattern=FillPattern.Solid), | ||
| Polygon( | ||
| points={{-10,-72},{8,-72},{8,-66},{6,-54},{2,-44},{-2,-34},{-4,-28},{-4,-16},{-4,-8},{2,8},{4,12},{6,20},{8,30},{8,36},{24,36},{0,68},{0,68},{-24,36},{-8,36},{-8,30},{-10,24},{-12,16},{-16,8},{-18,2},{-20,-6},{-20,-16},{-20,-28},{-18,-36},{-14,-48},{-10,-58},{-10,-72}}, | ||
| lineColor={255,170,255}, | ||
| fillColor={255,170,255}, | ||
| fillPattern=FillPattern.Solid), | ||
| Polygon( | ||
| points={{48,-72},{66,-72},{66,-66},{64,-54},{60,-44},{56,-34},{54,-28},{54,-16},{54,-8},{60,8},{62,12},{64,20},{66,30},{66,36},{82,36},{58,68},{58,68},{34,36},{50,36},{50,30},{48,24},{46,16},{42,8},{40,2},{38,-6},{38,-16},{38,-28},{40,-36},{44,-48},{48,-58},{48,-72}}, | ||
| lineColor={255,170,255}, | ||
| fillColor={255,170,255}, | ||
| fillPattern=FillPattern.Solid)}), Diagram(coordinateSystem(preserveAspectRatio=false))); | ||
| end LMTDHeatExchange; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,2 @@ | ||
| NTUHeatExchange | ||
| LMTDHeatExchange |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
MetroscopeModelingLibrary/Tests/Multifluid/HeatExchangers/LMTDFuelHeater_reverse.mo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| within MetroscopeModelingLibrary.Tests.Multifluid.HeatExchangers; | ||
| model LMTDFuelHeater_reverse | ||
| extends MetroscopeModelingLibrary.Icons.Tests.MultifluidTestIcon; | ||
| // Boundary conditions | ||
| input Real P_hot_source(start=47, min=0, nominal=10) "barA"; | ||
| input Units.MassFlowRate Q_hot_source(start=8.6) "kg/s"; | ||
| input Real T_hot_source(start=230) "J/kg"; | ||
|
|
||
| input Real P_cold_source(start=30, min=0, nominal=10) "barA"; | ||
| input Units.MassFlowRate Q_cold_source(start=12) "kg/s"; | ||
| input Real T_cold_source(start = 30, min = 0, nominal = 50) "degC"; | ||
| //input Units.SpecificEnthalpy h_cold_source(start=1e6) "J/kg"; | ||
| // Parameters | ||
| parameter Units.Area S = 100; | ||
|
|
||
| // Calibrated parameters | ||
| output Units.HeatExchangeCoefficient Kth; | ||
| output Units.FrictionCoefficient Kfr_hot; | ||
| output Units.FrictionCoefficient Kfr_cold; | ||
|
|
||
| // Calibration inputs | ||
| input Real P_cold_out(start = 30, min= 0, nominal = 10) "barA"; // Outlet pressure on cold side, to calibrate Kfr cold | ||
| input Real P_hot_out(start = 47, min = 0, nominal = 10) "barA"; // Outlet pressure on hot side, to calibrate Kfr hot | ||
| //input Real T_hot_out(start = 80, min = 0, nominal = 100) "degC"; // Outlet temperature on cold side, to calibrate Kth | ||
| input Real T_cold_out(start = 200, nominal = 200); | ||
helenev-met marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| MultiFluid.HeatExchangers.LMTDFuelHeater | ||
| lMTDFuelHeater annotation (Placement(transformation(extent={{-36,-34},{40,34}}))); | ||
| MetroscopeModelingLibrary.WaterSteam.BoundaryConditions.Source hot_source annotation (Placement(transformation( | ||
| extent={{-10,-10},{10,10}}, | ||
| rotation=270, | ||
| origin={18,50}))); | ||
| MetroscopeModelingLibrary.WaterSteam.BoundaryConditions.Sink hot_sink annotation (Placement(transformation( | ||
| extent={{10,-10},{-10,10}}, | ||
| rotation=90, | ||
| origin={-12,-92}))); | ||
| MetroscopeModelingLibrary.Fuel.BoundaryConditions.Source cold_source annotation (Placement(transformation(extent={{-64,-10},{-44,10}}))); | ||
| MetroscopeModelingLibrary.Fuel.BoundaryConditions.Sink cold_sink annotation (Placement(transformation(extent={{76,-10},{96,10}}))); | ||
| MetroscopeModelingLibrary.Sensors.Fuel.PressureSensor P_cold_out_sensor annotation (Placement(transformation(extent={{36,-10},{56,10}}))); | ||
| MetroscopeModelingLibrary.Sensors.WaterSteam.PressureSensor P_hot_out_sensor annotation (Placement(transformation( | ||
| extent={{10,-10},{-10,10}}, | ||
| rotation=90, | ||
| origin={-12,-70}))); | ||
| MetroscopeModelingLibrary.Sensors.Fuel.TemperatureSensor T_cold_out_sensor annotation (Placement(transformation(extent={{58,-10},{78,10}}))); | ||
| equation | ||
| // Boundary conditions | ||
| hot_source.P_out = P_hot_source * 1e5; | ||
| hot_source.T_out = T_hot_source+273.15; | ||
| hot_source.Q_out = - Q_hot_source; | ||
| cold_source.P_out = P_cold_source *1e5; | ||
| cold_source.T_out = 273.15 + T_cold_source; | ||
| cold_source.Q_out = - Q_cold_source; | ||
| cold_source.Xi_out = {0.92,0.048,0.005,0.002,0.015,0.01}; | ||
|
|
||
| // Parameters | ||
| lMTDFuelHeater.S = S; | ||
|
|
||
| // Inputs for calibration | ||
| T_cold_out_sensor.T_degC = T_cold_out; | ||
| P_cold_out_sensor.P_barA = P_cold_out; | ||
| P_hot_out_sensor.P_barA = P_hot_out; | ||
|
|
||
| // Calibrated parameters | ||
| lMTDFuelHeater.Kth = Kth; | ||
| lMTDFuelHeater.Kfr_hot = Kfr_hot; | ||
| lMTDFuelHeater.Kfr_cold = Kfr_cold; | ||
| connect(lMTDFuelHeater.C_hot_in, hot_source.C_out) annotation (Line(points={{17.2,23.8},{18,23.8},{18,45}}, color={28,108,200})); | ||
| connect(lMTDFuelHeater.C_cold_in, cold_source.C_out) annotation (Line(points={{-24.6,0},{-49,0}}, color={213,213,0})); | ||
| connect(lMTDFuelHeater.C_cold_out, P_cold_out_sensor.C_in) annotation (Line(points={{28.6,0},{36,0}}, color={213,213,0})); | ||
| connect(hot_sink.C_in,P_hot_out_sensor. C_out) annotation (Line(points={{-12,-87},{-12,-80}}, | ||
| color={28,108,200})); | ||
| connect(lMTDFuelHeater.C_hot_out, P_hot_out_sensor.C_in) annotation (Line(points={{-13.2,-23.8},{-12,-23.8},{-12,-60}}, color={28,108,200})); | ||
| connect(cold_sink.C_in, T_cold_out_sensor.C_out) annotation (Line(points={{81,0},{78,0}}, color={213,213,0})); | ||
| connect(T_cold_out_sensor.C_in, P_cold_out_sensor.C_out) annotation (Line(points={{58,0},{56,0}}, color={213,213,0})); | ||
| annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); | ||
| end LMTDFuelHeater_reverse; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,3 +6,4 @@ Evaporator_direct | |
| Evaporator_reverse | ||
| FuelHeater_direct | ||
| FuelHeater_reverse | ||
| LMTDFuelHeater_reverse | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.