-
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 9 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| within MetroscopeModelingLibrary.FlueGases.Pipes; | ||
| model HeatLoss | ||
| package FlueGasesMedium = MetroscopeModelingLibrary.Media.FlueGasesMedium; | ||
| extends Partial.Pipes.HeatLoss( | ||
| redeclare MetroscopeModelingLibrary.FlueGases.Connectors.Inlet C_in, | ||
| redeclare MetroscopeModelingLibrary.FlueGases.Connectors.Outlet C_out, | ||
| redeclare package Medium = FlueGasesMedium) | ||
| annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); | ||
| end HeatLoss; |
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,2 +1,3 @@ | ||
| Pipe | ||
| Filter | ||
| HeatLoss |
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
106 changes: 106 additions & 0 deletions
106
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,106 @@ | ||
| 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
|
||
| parameter Real h_hot_in_0 = 2e4; | ||
| parameter Real h_hot_out_0 = 1e4; | ||
| parameter Real h_cold_in_0 = 6e5; | ||
| parameter Real h_cold_out_0 = 1e6; | ||
helenev-met marked this conversation as resolved.
Outdated
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, | ||
| h_in_0 = h_hot_in_0) annotation (Placement(transformation( | ||
helenev-met marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| 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,h_0=h_hot_in_0) annotation (Placement(transformation( | ||
pierre-eliep-met marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| extent={{10,-10},{-10,10}}, | ||
| rotation=90, | ||
| origin={-14,-24}))); | ||
| Fuel.Pipes.Pipe cold_side_pipe(h_0=h_cold_in_0) annotation (Placement(transformation(extent={{-52,-10},{-32,10}}))); | ||
| Fuel.BaseClasses.IsoPFlowModel cold_side(h_in_0 = h_cold_in_0) 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(h_outflow(start=h_cold_out_0)) 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(h_outflow(start=h_hot_out_0)) 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
54 changes: 54 additions & 0 deletions
54
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,54 @@ | ||
| 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
|
||
|
|
||
| /* 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=100) "Heat exchange surface"; | ||
pierre-eliep-met marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Inputs.InputHeatExchangeCoefficient Kth(start=1900) "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 | ||
| Units.DifferentialTemperature dT_a(start = 15); | ||
pierre-eliep-met marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| Units.DifferentialTemperature dT_b(start=1); | ||
helenev-met marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
pierre-eliep-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
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
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.